Index: /extensions/Register_FluxBB/branches/2.3/admin/template/info.tpl
===================================================================
--- /extensions/Register_FluxBB/branches/2.3/admin/template/info.tpl	(revision 7982)
+++ /extensions/Register_FluxBB/branches/2.3/admin/template/info.tpl	(revision 7983)
@@ -5,3 +5,3 @@
 </div>
 
-<div align="left" style="margin-left: 1em; margin-right: 1em;">{'Disclaimer'|@translate}</div>
+<div style="text-align: left; margin-left: 1em; margin-right: 1em;">{'Disclaimer'|@translate}</div>
Index: /extensions/Register_FluxBB/branches/2.3/include/functions.inc.php
===================================================================
--- /extensions/Register_FluxBB/branches/2.3/include/functions.inc.php	(revision 7982)
+++ /extensions/Register_FluxBB/branches/2.3/include/functions.inc.php	(revision 7983)
@@ -1,6 +1,156 @@
 <?php
 
-  include_once (PHPWG_ROOT_PATH.'/include/constants.php');
-  include_once (REGFLUXBB_PATH.'include/constants.php');
+include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+include_once (REGFLUXBB_PATH.'include/constants.php');
+
+
+function Register_FluxBB_admin_menu($menu)
+{
+  array_push($menu, array(
+    'NAME' => 'Register FluxBB',
+    'URL'  => get_admin_plugin_menu_link(REGFLUXBB_PATH.'admin/admin.php')));
+  return $menu;
+}
+
+
+function Register_FluxBB_Adduser($register_user)
+{
+  global $errors, $conf;
+	
+  // Exclusion of Adult_Content users
+  if ($register_user['username'] != "16" and $register_user['username'] != "18")
+  {
+    // Warning : FluxBB uses Sha1 hash instead of md5 for Piwigo!
+    FluxBB_Adduser($register_user['id'], $register_user['username'], sha1($_POST['password']), $register_user['email']);
+  }
+}
+
+
+function Register_FluxBB_Deluser($user_id)
+{
+  FluxBB_Deluser(FluxBB_Searchuser($user_id), true);
+}
+
+
+function Register_FluxBB_InitPage()
+{
+  global $conf, $user;
+
+  if (isset($_POST['validate']) and !is_admin())
+  {
+    if (!empty($_POST['use_new_pwd']))
+    {
+      $query = '
+SELECT '.$conf['user_fields']['username'].' AS username
+FROM '.USERS_TABLE.'
+WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+;';
+
+      list($username) = pwg_db_fetch_row(pwg_query($query));
+
+      FluxBB_Updateuser($user['id'], stripslashes($username), sha1($_POST['use_new_pwd']), $_POST['mail_address']);
+    }
+  }
+}
+
+
+function UAM_Bridge()
+{
+  global $conf, $user;
+  
+  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+  
+  // Check if UAM is installed and if bridge is set - Exception for admins and webmasters
+  $query ='
+SELECT user_id, status
+FROM '.USER_INFOS_TABLE.'
+WHERE user_id = '.$user['id'].'
+;';
+  $data = pwg_db_fetch_assoc(pwg_query($query));
+  
+  if ($data['status'] <> "admin" and $data['status'] <> "webmaster")
+  {
+    if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true')
+    {
+      $conf_UAM = unserialize($conf['UserAdvManager']);
+    
+      // Getting unvalidated users group else Piwigo's default group
+      if (isset($conf_UAM[2]) and $conf_UAM[2] != '-1')
+      {
+        $Waitingroup = $conf_UAM[2];
+      }
+      else
+      {
+        $query = '
+SELECT id
+FROM '.GROUPS_TABLE.'
+WHERE is_default = "true"
+LIMIT 1
+;';
+        $data = pwg_db_fetch_assoc(pwg_query($query));
+        $Waitingroup = $data['id'];
+      }
+    
+      // check if logged in user is in a Piwigo's validated or unvalidated users group
+      $query = '
+SELECT *
+FROM '.USER_GROUP_TABLE.'
+WHERE user_id = '.$user['id'].'
+AND group_id = '.$Waitingroup.'
+;';
+      $count = pwg_db_num_rows(pwg_query($query));
+
+      // Check if logged in user is in a FluxBB's unvalidated group
+      $query = "
+SELECT group_id
+FROM ".FluxBB_USERS_TABLE."
+WHERE id = ".FluxBB_Searchuser($user['id'])."
+;";
+
+      $data = pwg_db_fetch_assoc(pwg_query($query));
+
+      // Logged in user switch to the default FluxBB's group if he'is validated
+      if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB[7])
+      {
+        $query = "
+SELECT conf_value
+FROM ".FluxBB_CONFIG_TABLE."
+WHERE conf_name = 'o_default_user_group'
+;";
+
+        $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));
+      
+        $query = "
+UPDATE ".FluxBB_USERS_TABLE."
+SET group_id = ".$o_default_user_group['conf_value']." 
+WHERE id = ".FluxBB_Searchuser($user['id'])."
+;";
+        pwg_query($query);
+      }
+    }
+  }
+}
+
+
+function Register_FluxBB_RegistrationCheck($err, $register_user)
+{
+  global $errors, $conf;
+  
+  //Because FluxBB is case insensitive on login name, we have to check if a similar login already exists in FluxBB's user table
+  // If "test" user already exists, "TEST" or "Test" (and so on...) can't register
+  $query = "
+SELECT username
+  FROM ".FluxBB_USERS_TABLE."
+WHERE LOWER(".stripslashes('username').") = '".strtolower($register_user['username'])."'
+;";
+
+    $count = pwg_db_num_rows(pwg_query($query));
+
+    if ($count > 0)
+    {
+      return l10n('this login is already used');
+    }
+}
+
 
 function FluxBB_Linkuser($pwg_id, $bb_id)
@@ -52,5 +202,5 @@
 function FluxBB_Adduser($pwg_id, $login, $password, $adresse_mail)
 {
-  global $conf;
+  global $errors, $conf;
 
   $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
@@ -118,7 +268,7 @@
 
   $o_default_style = pwg_db_fetch_assoc(pwg_query($query));
-  
-  $query = '
-INSERT INTO '.FluxBB_USERS_TABLE." (
+
+  $query = "
+INSERT INTO ".FluxBB_USERS_TABLE." (
   username, 
   ". ( isset($o_default_user_group['conf_value']) ? 'group_id' : '' ) .",
@@ -187,8 +337,8 @@
   $data0 = pwg_db_fetch_assoc(pwg_query($query0));
 
-  // Si égale à VRAI, suppression de tous les posts et topics
+  // If True, delete related topics and posts
   if ($SuppTopicsPosts and $conf_Register_FluxBB[3])
   {
-    // Suppression des posts de cet utilisateur
+    // Delete posts and topics of this user
     $subquery = "
 DELETE FROM ".FluxBB_POSTS_TABLE."
@@ -198,5 +348,5 @@
     $subresult = pwg_query($subquery);
 
-    // Suppression des topics de cet utilisateur
+    // Delete topics of this user
     $subquery = "
 DELETE FROM ".FluxBB_TOPICS_TABLE."
@@ -207,5 +357,5 @@
   }
 
-  // Suppression des abonnements de l'utilisateur
+  // Delete user's subscriptions
   $subquery = "
 DELETE FROM ".FluxBB_SUBSCRIPTIONS_TABLE."
@@ -215,5 +365,5 @@
   $subresult = pwg_query($subquery);
   
-  // Suppression du compte utilisateur
+  // Delete user's account
   $subquery = "
 DELETE FROM ".FluxBB_USERS_TABLE."
Index: /extensions/Register_FluxBB/branches/2.3/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/Register_FluxBB/branches/2.3/language/de_DE/plugin.lang.php	(revision 7982)
+++ /extensions/Register_FluxBB/branches/2.3/language/de_DE/plugin.lang.php	(revision 7983)
@@ -6,12 +6,4 @@
 
 $lang['Title'] = 'Register FluxBB';
-$lang['Disclaimer'] = '
-  *** Befolgen Sie bitte die folgenden zwei Schritte, um zu beginnen ***<br>
-  Step 1 : Konfigurieren Sie den Plugin für den Zugriff auf FluxBB.<br>
-  Step 2 : Migrieren Sie die Benutzerkonten von Piwigo nach FluxBB.<br><br>
-  Wenn dies erfolgt ist arbeitet der Plugin voll funktionstüchtig und Sie müssen diese Seiten nicht mehr aufsuchen.<br><br>
-  *** Für die Wartung bereits bestehender Verbindungen ***<br>
-  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>
-  <div class="warning">Warnung !! Aus Sicherheitsgründen sollten Sie ein Backup Ihrer Datenbank anfertigen (Speziell die ###_user Tabellen).</div>';
 
 $lang['Config_Title'] = 'Pluginkonfiguration';
@@ -162,3 +154,19 @@
 /*TODO*/$lang['error_config_guest'] = 'ERROR : The name of the FluxBB\'s guest account is wrong!';
 // --------- End: New or revised $lang ---- from version 2.3.3
+
+// --------- Starting below: New or revised $lang ---- from version 2.3.5
+$lang['Disclaimer'] = '
+  *** Befolgen Sie bitte die folgenden zwei Schritte, um zu beginnen ***<br>
+  Step 1 : Konfigurieren Sie den Plugin für den Zugriff auf FluxBB.<br>
+  Step 2 : Migrieren Sie die Benutzerkonten von Piwigo nach FluxBB.<br><br>
+  Wenn dies erfolgt ist arbeitet der Plugin voll funktionstüchtig und Sie müssen diese Seiten nicht mehr aufsuchen.<br><br>
+  *** Für die Wartung bereits bestehender Verbindungen ***<br>
+  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>
+  <div class="warning">Warnung !! Aus Sicherheitsgründen sollten Sie ein Backup Ihrer Datenbank anfertigen (Speziell die ###_user Tabellen).</div>
+<br><br>
+  <div class="warning">Wichtig zu wissen:<br>
+  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>
+  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>
+  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>';
+// --------- End: New or revised $lang ---- from version 2.3.5
 ?>
Index: /extensions/Register_FluxBB/branches/2.3/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Register_FluxBB/branches/2.3/language/en_UK/plugin.lang.php	(revision 7982)
+++ /extensions/Register_FluxBB/branches/2.3/language/en_UK/plugin.lang.php	(revision 7983)
@@ -6,12 +6,4 @@
 
 $lang['Title'] = 'Register FluxBB';
-$lang['Disclaimer'] = '
-  *** To begin, follow this 2 steps ***<br>
-  Step 1 : Set plugin with the parameters of FluxBB.<br>
-  Step 2 : Migrate user accounts from Piwigo to FluxBB.<br><br>
-  After these 2 main steps, the plugin is fully functional and you will not have to return to this pages.<br><br>
-  *** For the maintenance of already active connections ***<br>
-  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>
-  <div class="warning">WARNING !! For safety, consider making a backup of your database, especially ###_user tables before any action.</div>';
 
 $lang['Config_Title'] = 'Plugin setup';
@@ -136,10 +128,10 @@
   <br>';
 $lang['About_Reg'] = 'About the registration of users on the forum FluxBB';
-$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).';
+$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).';
 $lang['Bridge_UAM_true'] = ' --> Enable bridge Register_FluxBB / UAM';
 $lang['Bridge_UAM_false'] = ' --> Disable bridge Register_FluxBB / UAM (default)';
-$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).';
+$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).';
 $lang['About_Bridge'] = 'About Register_FluxBB / UAM bridge';
-$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>
+$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>
 Here is the general procedure to apply:
 <br>
@@ -162,3 +154,19 @@
 $lang['error_config_guest'] = 'ERROR : The name of the FluxBB\'s guest account is wrong!';
 // --------- End: New or revised $lang ---- from version 2.3.3
+
+// --------- Starting below: New or revised $lang ---- from version 2.3.5
+$lang['Disclaimer'] = '
+  *** To begin, follow this 2 steps ***<br>
+  Step 1 : Set plugin with the parameters of FluxBB.<br>
+  Step 2 : Migrate user accounts from Piwigo to FluxBB.<br><br>
+  After these 2 main steps, the plugin is fully functional and you will not have to return to this pages.<br><br>
+  *** For the maintenance of already active connections ***<br>
+  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>
+  <div class="warning">WARNING !! For safety, consider making a backup of your database, especially ###_user tables before any action.</div>
+<br><br>
+  <div class="warning">Important to know:<br>
+  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>
+  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>
+  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>';
+// --------- End: New or revised $lang ---- from version 2.3.5
 ?>
Index: /extensions/Register_FluxBB/branches/2.3/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Register_FluxBB/branches/2.3/language/fr_FR/plugin.lang.php	(revision 7982)
+++ /extensions/Register_FluxBB/branches/2.3/language/fr_FR/plugin.lang.php	(revision 7983)
@@ -6,12 +6,4 @@
 
 $lang['Title'] = 'Register FluxBB';
-$lang['Disclaimer'] = '
-  *** Pour débuter, 2 étapes à suivre ***<br>
-  1ère étape : Configurer les paramètres du plugin avec les paramètres de FluxBB.<br>
-  2ème étape : Migrer les comptes utilisateurs de Piwigo vers FluxBB.<br><br>
-  A l\'issue des 2 étapes principales, le plugin sera pleinement fonctionnel et vous n\'aurez plus à revenir sur cette page.<br><br>
-  *** Pour maintenir les liaisons déjà actives ***<br>
-  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>
-  <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>';
 
 $lang['Config_Title'] = 'Configuration du plugin';
@@ -163,3 +155,19 @@
 $lang['error_config_guest'] = 'ERREUR : Le nom du compte visiteur (guest) de FluxBB est incorrect !';
 // --------- End: New or revised $lang ---- from version 2.3.3
+
+// --------- Starting below: New or revised $lang ---- from version 2.3.5
+$lang['Disclaimer'] = '
+  *** Pour débuter, 2 étapes à suivre ***<br>
+  1ère étape : Configurer les paramètres du plugin avec les paramètres de FluxBB.<br>
+  2ème étape : Migrer les comptes utilisateurs de Piwigo vers FluxBB.<br><br>
+  A l\'issue des 2 étapes principales, le plugin sera pleinement fonctionnel et vous n\'aurez plus à revenir sur cette page.<br><br>
+  *** Pour maintenir les liaisons déjà actives ***<br>
+  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>
+  <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>
+<br><br>
+  <div class="warning">A savoir :<br>
+  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>
+  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>
+  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>';
+// --------- End: New or revised $lang ---- from version 2.3.5
 ?>
Index: /extensions/Register_FluxBB/branches/2.3/main.inc.php
===================================================================
--- /extensions/Register_FluxBB/branches/2.3/main.inc.php	(revision 7982)
+++ /extensions/Register_FluxBB/branches/2.3/main.inc.php	(revision 7983)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: Register FluxBB
-Version: 2.3.4
+Version: 2.3.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
 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=252
@@ -66,4 +66,7 @@
 
 2.3.4     - 22/09/10  - Compatibility with Plugin Adult_Content
+
+2.3.5     - 02/12/10  - Bug 2047 fixed : Check case sensitivity for logins in FluxBB's user table
+                      - Code refactory and optimization
 --------------------------------------------------------------------------------
 */
@@ -85,40 +88,15 @@
 add_event_handler('get_admin_plugin_menu_links', 'Register_FluxBB_admin_menu');
 
-function Register_FluxBB_admin_menu($menu)
-{
-  array_push($menu, array(
-    'NAME' => 'Register FluxBB',
-    'URL'  => get_admin_plugin_menu_link(REGFLUXBB_PATH.'admin/admin.php')));
-  return $menu;
-}
-
 
 /* user creation*/
 add_event_handler('register_user', 'Register_FluxBB_Adduser');
 
-function Register_FluxBB_Adduser($register_user)
-{
-  global $conf;
-	
-  // Exclusion of Adult_Content users
-  if ($register_user['username'] != "16" and $register_user['username'] != "18")
-  {
-    include_once (REGFLUXBB_PATH.'include/functions.inc.php');
 
-    // Warning : FluxBB uses Sha1 hash instead of md5 for Piwigo!
-    FluxBB_Adduser($register_user['id'], $register_user['username'], sha1($_POST['password']), $register_user['email']);
-  }
-}
+// Check users registration
+add_event_handler('register_user_check', 'Register_FluxBB_RegistrationCheck', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
 
 
 /* user deletion */
 add_event_handler('delete_user', 'Register_FluxBB_Deluser');
-
-function Register_FluxBB_Deluser($user_id)
-{
-  include_once (REGFLUXBB_PATH.'include/functions.inc.php');
-
-  FluxBB_Deluser( FluxBB_Searchuser($user_id), true );
-}
 
 
@@ -127,26 +105,4 @@
 {
   add_event_handler('loc_begin_profile', 'Register_FluxBB_InitPage', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
-
-  function Register_FluxBB_InitPage()
-  {
-    global $conf, $user;
-    include_once (REGFLUXBB_PATH.'include/functions.inc.php');
-    
-    if (isset($_POST['validate']) and !is_admin())
-    {
-    if (!empty($_POST['use_new_pwd']))
-      {
-      $query = '
-SELECT '.$conf['user_fields']['username'].' AS username
-FROM '.USERS_TABLE.'
-WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
-;';
-
-      list($username) = pwg_db_fetch_row(pwg_query($query));
-
-      FluxBB_Updateuser($user['id'], stripslashes($username), sha1($_POST['use_new_pwd']), $_POST['mail_address']);
-      }
-    }
-  }
 }
 
@@ -155,79 +111,3 @@
 add_event_handler('login_success', 'UAM_Bridge', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
 
-function UAM_Bridge()
-{
-  global $conf, $user;
-  
-  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
-  
-  // Check if UAM is installed and if bridge is set - Exception for admins and webmasters
-  $query ='
-SELECT user_id, status
-FROM '.USER_INFOS_TABLE.'
-WHERE user_id = '.$user['id'].'
-;';
-  $data = pwg_db_fetch_assoc(pwg_query($query));
-  
-  if ($data['status'] <> "admin" and $data['status'] <> "webmaster")
-  {
-    if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true')
-    {
-      $conf_UAM = unserialize($conf['UserAdvManager']);
-    
-      // Getting unvalidated users group else Piwigo's default group
-      if (isset($conf_UAM[2]) and $conf_UAM[2] != '-1')
-      {
-        $Waitingroup = $conf_UAM[2];
-      }
-      else
-      {
-        $query = '
-SELECT id
-FROM '.GROUPS_TABLE.'
-WHERE is_default = "true"
-LIMIT 1
-;';
-        $data = pwg_db_fetch_assoc(pwg_query($query));
-        $Waitingroup = $data['id'];
-      }
-    
-      // check if logged in user is in a Piwigo's validated or unvalidated users group
-      $query = '
-SELECT *
-FROM '.USER_GROUP_TABLE.'
-WHERE user_id = '.$user['id'].'
-AND group_id = '.$Waitingroup.'
-;';
-      $count = pwg_db_num_rows(pwg_query($query));
-
-      // Check if logged in user is in a FluxBB's unvalidated group
-      $query = "
-SELECT group_id
-FROM ".FluxBB_USERS_TABLE."
-WHERE id = ".FluxBB_Searchuser($user['id'])."
-;";
-
-      $data = pwg_db_fetch_assoc(pwg_query($query));
-
-      // Logged in user switch to the default FluxBB's group if he'is validated
-      if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB[7])
-      {
-        $query = "
-SELECT conf_value
-FROM ".FluxBB_CONFIG_TABLE."
-WHERE conf_name = 'o_default_user_group'
-;";
-
-        $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));
-      
-        $query = "
-UPDATE ".FluxBB_USERS_TABLE."
-SET group_id = ".$o_default_user_group['conf_value']." 
-WHERE id = ".FluxBB_Searchuser($user['id'])."
-;";
-        pwg_query($query);
-      }
-    }
-  }
-}
 ?>
