Changeset 7983 for extensions
- Timestamp:
- Dec 2, 2010, 10:36:33 PM (14 years ago)
- Location:
- extensions/Register_FluxBB/branches/2.3
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Register_FluxBB/branches/2.3/admin/template/info.tpl
r5606 r7983 5 5 </div> 6 6 7 <div align="left" style="margin-left: 1em; margin-right: 1em;">{'Disclaimer'|@translate}</div>7 <div style="text-align: left; margin-left: 1em; margin-right: 1em;">{'Disclaimer'|@translate}</div> -
extensions/Register_FluxBB/branches/2.3/include/functions.inc.php
r6815 r7983 1 1 <?php 2 2 3 include_once (PHPWG_ROOT_PATH.'/include/constants.php'); 4 include_once (REGFLUXBB_PATH.'include/constants.php'); 3 include_once (PHPWG_ROOT_PATH.'/include/constants.php'); 4 include_once (REGFLUXBB_PATH.'include/constants.php'); 5 6 7 function Register_FluxBB_admin_menu($menu) 8 { 9 array_push($menu, array( 10 'NAME' => 'Register FluxBB', 11 'URL' => get_admin_plugin_menu_link(REGFLUXBB_PATH.'admin/admin.php'))); 12 return $menu; 13 } 14 15 16 function Register_FluxBB_Adduser($register_user) 17 { 18 global $errors, $conf; 19 20 // Exclusion of Adult_Content users 21 if ($register_user['username'] != "16" and $register_user['username'] != "18") 22 { 23 // Warning : FluxBB uses Sha1 hash instead of md5 for Piwigo! 24 FluxBB_Adduser($register_user['id'], $register_user['username'], sha1($_POST['password']), $register_user['email']); 25 } 26 } 27 28 29 function Register_FluxBB_Deluser($user_id) 30 { 31 FluxBB_Deluser(FluxBB_Searchuser($user_id), true); 32 } 33 34 35 function Register_FluxBB_InitPage() 36 { 37 global $conf, $user; 38 39 if (isset($_POST['validate']) and !is_admin()) 40 { 41 if (!empty($_POST['use_new_pwd'])) 42 { 43 $query = ' 44 SELECT '.$conf['user_fields']['username'].' AS username 45 FROM '.USERS_TABLE.' 46 WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\' 47 ;'; 48 49 list($username) = pwg_db_fetch_row(pwg_query($query)); 50 51 FluxBB_Updateuser($user['id'], stripslashes($username), sha1($_POST['use_new_pwd']), $_POST['mail_address']); 52 } 53 } 54 } 55 56 57 function UAM_Bridge() 58 { 59 global $conf, $user; 60 61 $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); 62 63 // Check if UAM is installed and if bridge is set - Exception for admins and webmasters 64 $query =' 65 SELECT user_id, status 66 FROM '.USER_INFOS_TABLE.' 67 WHERE user_id = '.$user['id'].' 68 ;'; 69 $data = pwg_db_fetch_assoc(pwg_query($query)); 70 71 if ($data['status'] <> "admin" and $data['status'] <> "webmaster") 72 { 73 if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true') 74 { 75 $conf_UAM = unserialize($conf['UserAdvManager']); 76 77 // Getting unvalidated users group else Piwigo's default group 78 if (isset($conf_UAM[2]) and $conf_UAM[2] != '-1') 79 { 80 $Waitingroup = $conf_UAM[2]; 81 } 82 else 83 { 84 $query = ' 85 SELECT id 86 FROM '.GROUPS_TABLE.' 87 WHERE is_default = "true" 88 LIMIT 1 89 ;'; 90 $data = pwg_db_fetch_assoc(pwg_query($query)); 91 $Waitingroup = $data['id']; 92 } 93 94 // check if logged in user is in a Piwigo's validated or unvalidated users group 95 $query = ' 96 SELECT * 97 FROM '.USER_GROUP_TABLE.' 98 WHERE user_id = '.$user['id'].' 99 AND group_id = '.$Waitingroup.' 100 ;'; 101 $count = pwg_db_num_rows(pwg_query($query)); 102 103 // Check if logged in user is in a FluxBB's unvalidated group 104 $query = " 105 SELECT group_id 106 FROM ".FluxBB_USERS_TABLE." 107 WHERE id = ".FluxBB_Searchuser($user['id'])." 108 ;"; 109 110 $data = pwg_db_fetch_assoc(pwg_query($query)); 111 112 // Logged in user switch to the default FluxBB's group if he'is validated 113 if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB[7]) 114 { 115 $query = " 116 SELECT conf_value 117 FROM ".FluxBB_CONFIG_TABLE." 118 WHERE conf_name = 'o_default_user_group' 119 ;"; 120 121 $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query)); 122 123 $query = " 124 UPDATE ".FluxBB_USERS_TABLE." 125 SET group_id = ".$o_default_user_group['conf_value']." 126 WHERE id = ".FluxBB_Searchuser($user['id'])." 127 ;"; 128 pwg_query($query); 129 } 130 } 131 } 132 } 133 134 135 function Register_FluxBB_RegistrationCheck($err, $register_user) 136 { 137 global $errors, $conf; 138 139 //Because FluxBB is case insensitive on login name, we have to check if a similar login already exists in FluxBB's user table 140 // If "test" user already exists, "TEST" or "Test" (and so on...) can't register 141 $query = " 142 SELECT username 143 FROM ".FluxBB_USERS_TABLE." 144 WHERE LOWER(".stripslashes('username').") = '".strtolower($register_user['username'])."' 145 ;"; 146 147 $count = pwg_db_num_rows(pwg_query($query)); 148 149 if ($count > 0) 150 { 151 return l10n('this login is already used'); 152 } 153 } 154 5 155 6 156 function FluxBB_Linkuser($pwg_id, $bb_id) … … 52 202 function FluxBB_Adduser($pwg_id, $login, $password, $adresse_mail) 53 203 { 54 global $ conf;204 global $errors, $conf; 55 205 56 206 $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); … … 118 268 119 269 $o_default_style = pwg_db_fetch_assoc(pwg_query($query)); 120 121 $query = '122 INSERT INTO '.FluxBB_USERS_TABLE." (270 271 $query = " 272 INSERT INTO ".FluxBB_USERS_TABLE." ( 123 273 username, 124 274 ". ( isset($o_default_user_group['conf_value']) ? 'group_id' : '' ) .", … … 187 337 $data0 = pwg_db_fetch_assoc(pwg_query($query0)); 188 338 189 // Si égale à VRAI, suppression de tous les posts et topics339 // If True, delete related topics and posts 190 340 if ($SuppTopicsPosts and $conf_Register_FluxBB[3]) 191 341 { 192 // Suppression des posts de cet utilisateur342 // Delete posts and topics of this user 193 343 $subquery = " 194 344 DELETE FROM ".FluxBB_POSTS_TABLE." … … 198 348 $subresult = pwg_query($subquery); 199 349 200 // Suppression des topics de cet utilisateur350 // Delete topics of this user 201 351 $subquery = " 202 352 DELETE FROM ".FluxBB_TOPICS_TABLE." … … 207 357 } 208 358 209 // Suppression des abonnements de l'utilisateur359 // Delete user's subscriptions 210 360 $subquery = " 211 361 DELETE FROM ".FluxBB_SUBSCRIPTIONS_TABLE." … … 215 365 $subresult = pwg_query($subquery); 216 366 217 // Suppression du compte utilisateur367 // Delete user's account 218 368 $subquery = " 219 369 DELETE FROM ".FluxBB_USERS_TABLE." -
extensions/Register_FluxBB/branches/2.3/language/de_DE/plugin.lang.php
r6899 r7983 6 6 7 7 $lang['Title'] = 'Register FluxBB'; 8 $lang['Disclaimer'] = '9 *** Befolgen Sie bitte die folgenden zwei Schritte, um zu beginnen ***<br>10 Step 1 : Konfigurieren Sie den Plugin für den Zugriff auf FluxBB.<br>11 Step 2 : Migrieren Sie die Benutzerkonten von Piwigo nach FluxBB.<br><br>12 Wenn dies erfolgt ist arbeitet der Plugin voll funktionstüchtig und Sie müssen diese Seiten nicht mehr aufsuchen.<br><br>13 *** Für die Wartung bereits bestehender Verbindungen ***<br>14 Wartung: : Tabellensynchronisation (im Fall des Hinzufügens, Aktualisierens oder Löschens eines Users) erlaubt Ihnen, Passwörter und e-mail Adressen auf den neuesten Stand zu bringen und unerwünschte User zu erkennen (Dies sollten Sie jedoch im Normalfall nicht benötigen).<br><br>15 <div class="warning">Warnung !! Aus Sicherheitsgründen sollten Sie ein Backup Ihrer Datenbank anfertigen (Speziell die ###_user Tabellen).</div>';16 8 17 9 $lang['Config_Title'] = 'Pluginkonfiguration'; … … 162 154 /*TODO*/$lang['error_config_guest'] = 'ERROR : The name of the FluxBB\'s guest account is wrong!'; 163 155 // --------- End: New or revised $lang ---- from version 2.3.3 156 157 // --------- Starting below: New or revised $lang ---- from version 2.3.5 158 $lang['Disclaimer'] = ' 159 *** Befolgen Sie bitte die folgenden zwei Schritte, um zu beginnen ***<br> 160 Step 1 : Konfigurieren Sie den Plugin für den Zugriff auf FluxBB.<br> 161 Step 2 : Migrieren Sie die Benutzerkonten von Piwigo nach FluxBB.<br><br> 162 Wenn dies erfolgt ist arbeitet der Plugin voll funktionstüchtig und Sie müssen diese Seiten nicht mehr aufsuchen.<br><br> 163 *** Für die Wartung bereits bestehender Verbindungen ***<br> 164 Wartung: : Tabellensynchronisation (im Fall des Hinzufügens, Aktualisierens oder Löschens eines Users) erlaubt Ihnen, Passwörter und e-mail Adressen auf den neuesten Stand zu bringen und unerwünschte User zu erkennen (Dies sollten Sie jedoch im Normalfall nicht benötigen).<br><br> 165 <div class="warning">Warnung !! Aus Sicherheitsgründen sollten Sie ein Backup Ihrer Datenbank anfertigen (Speziell die ###_user Tabellen).</div> 166 <br><br> 167 <div class="warning">Wichtig zu wissen:<br> 168 Standardmäßig ist <b>FluxBB</b> Fall <u>unempfindlich</u> für Benutzernamen. Das heißt, wenn ein Benutzer namens "test" ist bereits registriert, andere Einträge wie "Test" oder "TEST" oder "TEst" (etc. ..) werden abgelehnt.<br><br> 169 Standardmäßig ist <b>Piwigo</b> arbeitet in umgekehrter und ist daher bei Fall <u>empfindlich</u> für Logins ("test" wird ein anderer Benutzer von "TEST" oder "TEst", etc. ...) werden<br> 170 Um Probleme zu vermeiden (auch wenn Piwigo Verhalten leicht verändert werden kann - siehe Konfigurationsmöglichkeiten), wird Register_FluxBB Verknüpfung der beiden Anwendungen als FluxBB: Fall <u>unempfindlich</u> für Logins.<br><br></div>'; 171 // --------- End: New or revised $lang ---- from version 2.3.5 164 172 ?> -
extensions/Register_FluxBB/branches/2.3/language/en_UK/plugin.lang.php
r6899 r7983 6 6 7 7 $lang['Title'] = 'Register FluxBB'; 8 $lang['Disclaimer'] = '9 *** To begin, follow this 2 steps ***<br>10 Step 1 : Set plugin with the parameters of FluxBB.<br>11 Step 2 : Migrate user accounts from Piwigo to FluxBB.<br><br>12 After these 2 main steps, the plugin is fully functional and you will not have to return to this pages.<br><br>13 *** For the maintenance of already active connections ***<br>14 Maintenance : Synchronize tables (in case an addition, an update or a user deletion mismatched) allows to update passwords and email addresses and see users intruder (But you should not need to use ).<br><br>15 <div class="warning">WARNING !! For safety, consider making a backup of your database, especially ###_user tables before any action.</div>';16 8 17 9 $lang['Config_Title'] = 'Plugin setup'; … … 136 128 <br>'; 137 129 $lang['About_Reg'] = 'About the registration of users on the forum FluxBB'; 138 $lang['Bridge_UAM'] = ' Validation d\'accès au forum via le plugin UserAdvManager (UAM): Activez ici le pont entre les deux plugins qui vous permettra d\'interdir l\'accès à votre forum FluxBB tant que l\'utilisateur n\'a pas validé son inscription à la galerie (la fonction correspondante doit être active sur UAM).Access validation to the forum via UserAdvManager (UAM) plugin: Turn the bridge on between the two plugins that will allow you to prohibit the access to your FluxBB forum until the user has not validated its registration in the gallery (the function must be active on UAM).';130 $lang['Bridge_UAM'] = 'Access validation to the forum via UserAdvManager (UAM) plugin: Turn the bridge on between the two plugins that will allow you to prohibit the access to your FluxBB forum until the user has not validated its registration in the gallery (the function must be active on UAM).'; 139 131 $lang['Bridge_UAM_true'] = ' --> Enable bridge Register_FluxBB / UAM'; 140 132 $lang['Bridge_UAM_false'] = ' --> Disable bridge Register_FluxBB / UAM (default)'; 141 $lang['FluxBB_Group'] = ' Précisez ici l\'ID du <b>groupe FluxBB</b> dans lequel les utilisateurs non validé doivent se trouver (à créer au préalable dans FluxBB). Pour être efficace, ce groupe ne doit avoir aucune permission sur le forum (voir à la fin de cette page pour les détails d\'utilisation de cette option).Specify the ID of <b>FluxBB\' group</b> in which non validated users must be (to be created in advance in FluxBB). To be effective, this group should have no permission on the forum (see the end of this page for details on using this option).';133 $lang['FluxBB_Group'] = 'Specify the ID of <b>FluxBB\' group</b> in which non validated users must be (to be created in advance in FluxBB). To be effective, this group should have no permission on the forum (see the end of this page for details on using this option).'; 142 134 $lang['About_Bridge'] = 'About Register_FluxBB / UAM bridge'; 143 $lang['UAM_Bridge_advice'] = 'The UserAdvManager plugin allows forcing new registrants to confirm their registration before allowing them to access the entire gallery. The joint use of this plugin with Register_FluxBB can do the same on the forum linked: Registrants can not post until they have validated their registration in the gallery. <br>135 $lang['UAM_Bridge_advice'] = 'The UserAdvManager plugin allows forcing new registrants to confirm their registration before allowing them to access the entire gallery. The joint use of this plugin with Register_FluxBB can do the same on the linked forum: Registrants can not post until they have validated their registration in the gallery. <br> 144 136 Here is the general procedure to apply: 145 137 <br> … … 162 154 $lang['error_config_guest'] = 'ERROR : The name of the FluxBB\'s guest account is wrong!'; 163 155 // --------- End: New or revised $lang ---- from version 2.3.3 156 157 // --------- Starting below: New or revised $lang ---- from version 2.3.5 158 $lang['Disclaimer'] = ' 159 *** To begin, follow this 2 steps ***<br> 160 Step 1 : Set plugin with the parameters of FluxBB.<br> 161 Step 2 : Migrate user accounts from Piwigo to FluxBB.<br><br> 162 After these 2 main steps, the plugin is fully functional and you will not have to return to this pages.<br><br> 163 *** For the maintenance of already active connections ***<br> 164 Maintenance : Synchronize tables (in case an addition, an update or a user deletion mismatched) allows to update passwords and email addresses and see users intruder (But you should not need to use ).<br><br> 165 <div class="warning">WARNING !! For safety, consider making a backup of your database, especially ###_user tables before any action.</div> 166 <br><br> 167 <div class="warning">Important to know:<br> 168 By default, <b>FluxBB</b> is case <u>insensitive</u> on usernames. That is, if a user called "test" is already registered, other entries like "Test" or "TEST" or "TEst" (etc. ..) will be rejected.<br><br> 169 By default, <b>Piwigo</b> works in reverse and is therefore case <u>sensitive</u> on logins ("test" will be a different user of "Test" or "TEST", etc. ...).<br> 170 To avoid problems (even if Piwigo\'s behavior can be easily changed - See configuration options), Register_FluxBB will link the two applications as FluxBB: Being case <u>insensitive</u> for logins.<br><br></div>'; 171 // --------- End: New or revised $lang ---- from version 2.3.5 164 172 ?> -
extensions/Register_FluxBB/branches/2.3/language/fr_FR/plugin.lang.php
r6899 r7983 6 6 7 7 $lang['Title'] = 'Register FluxBB'; 8 $lang['Disclaimer'] = '9 *** Pour débuter, 2 étapes à suivre ***<br>10 1ère étape : Configurer les paramètres du plugin avec les paramètres de FluxBB.<br>11 2ème étape : Migrer les comptes utilisateurs de Piwigo vers FluxBB.<br><br>12 A l\'issue des 2 étapes principales, le plugin sera pleinement fonctionnel et vous n\'aurez plus à revenir sur cette page.<br><br>13 *** Pour maintenir les liaisons déjà actives ***<br>14 Maintenance : Synchroniser les tables (dans le cas où un ajout, une mise à jour ou une suppression d\'utilisateur s\'est mal déroulée) permet de remettre à jour mots de passe et adresses email et voir les utilisateurs intrus (Mais vous ne devriez pas avoir à l\'utiliser).<br><br>15 <div class="warning">Pensez faire une sauvegarde de votre base et spécialement de vos tables ###_USERS avant toutes actions par mesure de sécurité.</div>';16 8 17 9 $lang['Config_Title'] = 'Configuration du plugin'; … … 163 155 $lang['error_config_guest'] = 'ERREUR : Le nom du compte visiteur (guest) de FluxBB est incorrect !'; 164 156 // --------- End: New or revised $lang ---- from version 2.3.3 157 158 // --------- Starting below: New or revised $lang ---- from version 2.3.5 159 $lang['Disclaimer'] = ' 160 *** Pour débuter, 2 étapes à suivre ***<br> 161 1ère étape : Configurer les paramètres du plugin avec les paramètres de FluxBB.<br> 162 2ème étape : Migrer les comptes utilisateurs de Piwigo vers FluxBB.<br><br> 163 A l\'issue des 2 étapes principales, le plugin sera pleinement fonctionnel et vous n\'aurez plus à revenir sur cette page.<br><br> 164 *** Pour maintenir les liaisons déjà actives ***<br> 165 Maintenance : Synchroniser les tables (dans le cas où un ajout, une mise à jour ou une suppression d\'utilisateur s\'est mal déroulée) permet de remettre à jour mots de passe et adresses email et voir les utilisateurs intrus (Mais vous ne devriez pas avoir à l\'utiliser).<br><br> 166 <div class="warning">Pensez faire une sauvegarde de votre base et spécialement de vos tables ###_USERS avant toutes actions par mesure de sécurité.</div> 167 <br><br> 168 <div class="warning">A savoir :<br> 169 Par défaut, <b>FluxBB</b> est <u>insensible</u> à la casse sur les noms d\'utilisateurs. C\'est à dire que si un utilisateur "test" est déjà inscrit, d\'autres inscriptions avec, par exemple, "Test" ou "TEST" ou "TEst" (etc...) seront refusées.<br><br> 170 Par défaut, <b>Piwigo</b> fonctionne de manière inverse et est donc <u>sensible</u> à la casse sur les logins ("test" sera un utilisateur différent de "Test" etc...).<br><br> 171 Afin d\'éviter des erreurs (même si le comportement de Piwigo peut-être facilement changé - Voir les options de configuration), Register_FluxBB fera le lien entre les deux applications à la manière de FluxBB : En étant <u>insensible</u> à la casse pour les logins.<br><br></div>'; 172 // --------- End: New or revised $lang ---- from version 2.3.5 165 173 ?> -
extensions/Register_FluxBB/branches/2.3/main.inc.php
r7002 r7983 2 2 /* 3 3 Plugin Name: Register FluxBB 4 Version: 2.3. 44 Version: 2.3.5 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 … … 66 66 67 67 2.3.4 - 22/09/10 - Compatibility with Plugin Adult_Content 68 69 2.3.5 - 02/12/10 - Bug 2047 fixed : Check case sensitivity for logins in FluxBB's user table 70 - Code refactory and optimization 68 71 -------------------------------------------------------------------------------- 69 72 */ … … 85 88 add_event_handler('get_admin_plugin_menu_links', 'Register_FluxBB_admin_menu'); 86 89 87 function Register_FluxBB_admin_menu($menu)88 {89 array_push($menu, array(90 'NAME' => 'Register FluxBB',91 'URL' => get_admin_plugin_menu_link(REGFLUXBB_PATH.'admin/admin.php')));92 return $menu;93 }94 95 90 96 91 /* user creation*/ 97 92 add_event_handler('register_user', 'Register_FluxBB_Adduser'); 98 93 99 function Register_FluxBB_Adduser($register_user)100 {101 global $conf;102 103 // Exclusion of Adult_Content users104 if ($register_user['username'] != "16" and $register_user['username'] != "18")105 {106 include_once (REGFLUXBB_PATH.'include/functions.inc.php');107 94 108 // Warning : FluxBB uses Sha1 hash instead of md5 for Piwigo! 109 FluxBB_Adduser($register_user['id'], $register_user['username'], sha1($_POST['password']), $register_user['email']); 110 } 111 } 95 // Check users registration 96 add_event_handler('register_user_check', 'Register_FluxBB_RegistrationCheck', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 112 97 113 98 114 99 /* user deletion */ 115 100 add_event_handler('delete_user', 'Register_FluxBB_Deluser'); 116 117 function Register_FluxBB_Deluser($user_id)118 {119 include_once (REGFLUXBB_PATH.'include/functions.inc.php');120 121 FluxBB_Deluser( FluxBB_Searchuser($user_id), true );122 }123 101 124 102 … … 127 105 { 128 106 add_event_handler('loc_begin_profile', 'Register_FluxBB_InitPage', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 129 130 function Register_FluxBB_InitPage()131 {132 global $conf, $user;133 include_once (REGFLUXBB_PATH.'include/functions.inc.php');134 135 if (isset($_POST['validate']) and !is_admin())136 {137 if (!empty($_POST['use_new_pwd']))138 {139 $query = '140 SELECT '.$conf['user_fields']['username'].' AS username141 FROM '.USERS_TABLE.'142 WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'143 ;';144 145 list($username) = pwg_db_fetch_row(pwg_query($query));146 147 FluxBB_Updateuser($user['id'], stripslashes($username), sha1($_POST['use_new_pwd']), $_POST['mail_address']);148 }149 }150 }151 107 } 152 108 … … 155 111 add_event_handler('login_success', 'UAM_Bridge', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 156 112 157 function UAM_Bridge()158 {159 global $conf, $user;160 161 $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();162 163 // Check if UAM is installed and if bridge is set - Exception for admins and webmasters164 $query ='165 SELECT user_id, status166 FROM '.USER_INFOS_TABLE.'167 WHERE user_id = '.$user['id'].'168 ;';169 $data = pwg_db_fetch_assoc(pwg_query($query));170 171 if ($data['status'] <> "admin" and $data['status'] <> "webmaster")172 {173 if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true')174 {175 $conf_UAM = unserialize($conf['UserAdvManager']);176 177 // Getting unvalidated users group else Piwigo's default group178 if (isset($conf_UAM[2]) and $conf_UAM[2] != '-1')179 {180 $Waitingroup = $conf_UAM[2];181 }182 else183 {184 $query = '185 SELECT id186 FROM '.GROUPS_TABLE.'187 WHERE is_default = "true"188 LIMIT 1189 ;';190 $data = pwg_db_fetch_assoc(pwg_query($query));191 $Waitingroup = $data['id'];192 }193 194 // check if logged in user is in a Piwigo's validated or unvalidated users group195 $query = '196 SELECT *197 FROM '.USER_GROUP_TABLE.'198 WHERE user_id = '.$user['id'].'199 AND group_id = '.$Waitingroup.'200 ;';201 $count = pwg_db_num_rows(pwg_query($query));202 203 // Check if logged in user is in a FluxBB's unvalidated group204 $query = "205 SELECT group_id206 FROM ".FluxBB_USERS_TABLE."207 WHERE id = ".FluxBB_Searchuser($user['id'])."208 ;";209 210 $data = pwg_db_fetch_assoc(pwg_query($query));211 212 // Logged in user switch to the default FluxBB's group if he'is validated213 if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB[7])214 {215 $query = "216 SELECT conf_value217 FROM ".FluxBB_CONFIG_TABLE."218 WHERE conf_name = 'o_default_user_group'219 ;";220 221 $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));222 223 $query = "224 UPDATE ".FluxBB_USERS_TABLE."225 SET group_id = ".$o_default_user_group['conf_value']."226 WHERE id = ".FluxBB_Searchuser($user['id'])."227 ;";228 pwg_query($query);229 }230 }231 }232 }233 113 ?>
Note: See TracChangeset
for help on using the changeset viewer.