Changeset 6880 for extensions/Register_FluxBB
- Timestamp:
- Sep 11, 2010, 7:07:48 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Register_FluxBB/trunk/main.inc.php
r6826 r6880 2 2 /* 3 3 Plugin Name: Register FluxBB 4 Version: 2.3. 14 Version: 2.3.2 5 5 Description: Link user registration from Piwigo to FluxBB forum (registration, password changing, deletion) - Original Nicco's NBC_LinkUser2PunBB plugin upgraded to Piwigo / Liez l'inscription des utilisateurs de Piwigo avec votre forum FluxBB - Portage du plugin NBC_LinkUser2PunBB de Nicco vers Piwigo 6 6 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=252 … … 57 57 2.3.0 - 28/08/10 - Bug 1434 fixed : Bridge between Register_FluxBB and UserAdvManager for new users validation 58 58 59 2.3.1 - 31/08/10 - Bug 1825 fixed : Password corruption after Piwigo's profile page visit 59 2.3.1 - 31/08/10 - Bug 1825 fixed : Password corruption after Piwigo's profile page visit 60 61 2.3.2 - 11/09/10 - Bug 1847 fixed : Admins and webmasters was not excluded from registration validation 60 62 -------------------------------------------------------------------------------- 61 63 */ … … 150 152 151 153 // Check if UAM is installed and if bridge is set - Exception for admins and webmasters 152 if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true' and !is_admin() and !is_webmaster()) 154 $query =' 155 SELECT user_id, status 156 FROM '.USER_INFOS_TABLE.' 157 WHERE user_id = '.$user['id'].' 158 ;'; 159 $data = pwg_db_fetch_assoc(pwg_query($query)); 160 161 if ($data['status'] <> "admin" and $data['status'] <> "webmaster") 153 162 { 154 $conf_UAM = unserialize($conf['UserAdvManager']); 163 if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true') 164 { 165 $conf_UAM = unserialize($conf['UserAdvManager']); 155 166 156 // Getting unvalidated users group else Piwigo's default group157 if (isset($conf_UAM[2]) and $conf_UAM[2] != '-1')158 {159 $Waitingroup = $conf_UAM[2];160 }161 else162 {163 $query = '167 // Getting unvalidated users group else Piwigo's default group 168 if (isset($conf_UAM[2]) and $conf_UAM[2] != '-1') 169 { 170 $Waitingroup = $conf_UAM[2]; 171 } 172 else 173 { 174 $query = ' 164 175 SELECT id 165 176 FROM '.GROUPS_TABLE.' … … 167 178 LIMIT 1 168 179 ;'; 169 $data = pwg_db_fetch_assoc(pwg_query($query));170 $Waitingroup = $data['id'];171 }180 $data = pwg_db_fetch_assoc(pwg_query($query)); 181 $Waitingroup = $data['id']; 182 } 172 183 173 // check if logged in user is in a Piwigo's validated or unvalidated users group174 $query = '184 // check if logged in user is in a Piwigo's validated or unvalidated users group 185 $query = ' 175 186 SELECT * 176 187 FROM '.USER_GROUP_TABLE.' … … 178 189 AND group_id = '.$Waitingroup.' 179 190 ;'; 180 $count = pwg_db_num_rows(pwg_query($query));181 182 // Check if logged in user is in a FluxBB's unvalidated group183 $query = "191 $count = pwg_db_num_rows(pwg_query($query)); 192 193 // Check if logged in user is in a FluxBB's unvalidated group 194 $query = " 184 195 SELECT group_id 185 196 FROM ".FluxBB_USERS_TABLE." … … 187 198 ;"; 188 199 189 $data = pwg_db_fetch_assoc(pwg_query($query));190 191 // Logged in user switch to the default FluxBB's group if he'is validated192 if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB[7])193 {194 $query = "200 $data = pwg_db_fetch_assoc(pwg_query($query)); 201 202 // Logged in user switch to the default FluxBB's group if he'is validated 203 if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB[7]) 204 { 205 $query = " 195 206 SELECT conf_value 196 207 FROM ".FluxBB_CONFIG_TABLE." … … 198 209 ;"; 199 210 200 $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));211 $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query)); 201 212 202 $query = "213 $query = " 203 214 UPDATE ".FluxBB_USERS_TABLE." 204 215 SET group_id = ".$o_default_user_group['conf_value']." 205 216 WHERE id = ".FluxBB_Searchuser($user['id'])." 206 217 ;"; 207 pwg_query($query); 218 pwg_query($query); 219 } 208 220 } 209 221 }
Note: See TracChangeset
for help on using the changeset viewer.