Index: /extensions/Register_FluxBB/admin/admin.php
===================================================================
--- /extensions/Register_FluxBB/admin/admin.php	(revision 21423)
+++ /extensions/Register_FluxBB/admin/admin.php	(revision 21424)
@@ -1,46 +1,21 @@
 <?php
 
-global $user, $lang, $conf, $template, $errors;
+global $page, $user, $lang, $conf, $template, $errors;
 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-if (!defined('REGFLUXBB_PATH')) define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
-
-ini_set('error_reporting', E_ALL);
-ini_set('display_errors', true);
+check_status(ACCESS_ADMINISTRATOR);
+
+if(!defined('REGFLUXBB_PATH'))
+{
+  define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+}
 
 include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
 include_once (PHPWG_ROOT_PATH.'/include/constants.php');
 
-$my_base_url = get_admin_plugin_menu_link(__FILE__);
 load_language('plugin.lang', REGFLUXBB_PATH);
 
-// +-----------------------------------------------------------------------+
-// |                            Tabssheet                                  |
-// +-----------------------------------------------------------------------+
-if (!isset($_GET['tab']))
-  $page['tab'] = 'info';
-else
-  $page['tab'] = $_GET['tab'];
-
-$tabsheet = new tabsheet();
-$tabsheet->add('info',
-            l10n('Tab_Info'),
-            $my_base_url.'&amp;tab=info');
-$tabsheet->add('manage',
-            l10n('Tab_Manage'),
-            $my_base_url.'&amp;tab=manage');
-$tabsheet->add('Migration',
-            l10n('Tab_Migration'),
-            $my_base_url.'&amp;tab=Migration');
-$tabsheet->add('Synchro',
-            l10n('Tab_Synchro'),
-            $my_base_url.'&amp;tab=Synchro');
-$tabsheet->select($page['tab']);
-$tabsheet->assign();
-
-
-$page['infos'] = array();
-$error = array();
+$conf_Register_FluxBB = unserialize($conf['Register_FluxBB']);
 
 // +-----------------------------------------------------------------------+
@@ -51,16 +26,283 @@
 
 // +-----------------------------------------------------------------------+
-// |                            Functions
+// |                            Actions process                            |
 // +-----------------------------------------------------------------------+
-function Audit_PWG_FluxBB()
-{
-  global $page, $conf, $errors;
-
-  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
-
+if (isset($_GET['action']) and ($_GET['action']=='link_dead'))
+{
+  $query = '
+DELETE FROM '.Register_FluxBB_ID_TABLE.'
+WHERE id_user_FluxBB NOT IN (
+  SELECT id
+  FROM '.FluxBB_USERS_TABLE.'
+  )
+OR id_user_pwg NOT IN (
+  SELECT id
+  FROM '.USERS_TABLE.'
+  )
+;';
+
+  $result = pwg_query($query);
+  
+  Audit_PWG_FluxBB();
+}
+else if (isset($_GET['action']) and ($_GET['action']=='link_del') and isset($_GET['pwg_id']) and isset($_GET['bb_id']))
+{
+  $query = '
+DELETE FROM '.Register_FluxBB_ID_TABLE.'
+WHERE id_user_pwg = '.$_GET['pwg_id'].'
+AND id_user_FluxBB = '.$_GET['bb_id'].'
+;';
+
+  $result = pwg_query($query);
+  
+  Audit_PWG_FluxBB();
+}
+else if (isset($_GET['action']) and ($_GET['action']=='new_link') and isset($_GET['pwg_id']) and isset($_GET['bb_id']))
+{
+  FluxBB_Linkuser($_GET['pwg_id'], $_GET['bb_id']);
+  
+  Audit_PWG_FluxBB();
+}
+else if (isset($_GET['action']) and ($_GET['action']=='sync_user') and isset($_GET['username']))
+{
+  $query = '
+SELECT id AS id_pwg, username, password, mail_address 
+FROM '.USERS_TABLE.'
+WHERE BINARY username = BINARY "'.pwg_db_real_escape_string($_GET['username']).'"
+AND username NOT IN ("18","16")
+LIMIT 1
+;';
+
+  $data = pwg_db_fetch_assoc(pwg_query($query));
+  
+  if (!empty($data))
+  {
+    FluxBB_Updateuser($data['id_pwg'], stripslashes($data['username']), $data['password'], $data['mail_address']);
+  }
+  
+  Audit_PWG_FluxBB();
+}
+else if (isset($_GET['action']) and ($_GET['action']=='add_user') and isset($_GET['username']))
+{
+  $query = '
+SELECT id, username, password, mail_address 
+FROM '.USERS_TABLE.'
+WHERE BINARY username = BINARY "'.pwg_db_real_escape_string($_GET['username']).'"
+AND username NOT IN ("18","16")
+LIMIT 1
+;';
+
+  $data = pwg_db_fetch_assoc(pwg_query($query));
+  
+  if (!empty($data))
+    FluxBB_Adduser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']);  
+  
+    Audit_PWG_FluxBB();
+}
+else if (isset($_GET['action']) and ($_GET['action']=='del_user') and isset($_GET['id']))
+{
+  FluxBB_Deluser( $_GET['id'], true );
+  
+  Audit_PWG_FluxBB();
+}
+
+
+// +------------------------------------------------------------------+
+// |                        Plugin settings                           |
+// +------------------------------------------------------------------+
+if (isset($_POST['submit']) and isset($_POST['FluxBB_prefix']) and isset($_POST['FluxBB_admin']) and isset($_POST['FluxBB_guest']) and isset($_POST['FluxBB_del_pt']) and isset($_POST['FluxBB_confirm']) and isset($_POST['FluxBB_details']))
+{
+  $_POST['FluxBB_admin'] = stripslashes($_POST['FluxBB_admin']);
+  $_POST['FluxBB_guest'] = stripslashes($_POST['FluxBB_guest']);
+
+/* Configuration controls */
+// Piwigo's admin username control
+  $query = '
+SELECT username, id
+FROM '.USERS_TABLE.'
+WHERE id = '.$conf['webmaster_id'].'
+;';
+
+  $pwgadmin = pwg_db_fetch_assoc(pwg_query($query));
+
+// FluxBB's admin username control
+  $query = '
+SELECT username, id
+FROM '.FluxBB_USERS_TABLE.'
+WHERE id = 2
+;';
+
+  $fbbadmin = pwg_db_fetch_assoc(pwg_query($query));
+
+// FluxBB's Guest username control
+  $query = '
+SELECT username, id
+FROM '.FluxBB_USERS_TABLE.'
+WHERE id = 1
+;';
+
+  $fbbguest = pwg_db_fetch_assoc(pwg_query($query));
+
+// Compute configuration errors
+  if (stripslashes($pwgadmin['username']) != $_POST['FluxBB_admin'])
+  {
+    array_push($page['errors'], l10n('error_config_admin1'));
+  }
+  if (stripslashes($pwgadmin['username']) != stripslashes($fbbadmin['username']))
+  {
+    array_push($page['errors'], l10n('error_config_admin2'));
+  }
+  if (stripslashes($fbbguest['username']) != stripslashes($_POST['FluxBB_guest']))
+  {
+    array_push($page['errors'], l10n('error_config_guest'));
+  }
+  elseif (count($page['errors']) == 0)
+  {
+    if (!function_exists('FindAvailableConfirmMailID'))
+    {
+      $_POST['FluxBB_UAM'] = 'false';
+      $_POST['FluxBB_group'] = '0';
+
+      $newconf_RegFluxBB['REGFLUXBB_VERSION'] = $version;
+      $newconf_RegFluxBB['FLUXBB_PREFIX'] = (isset($_POST['FluxBB_prefix']) ? $_POST['FluxBB_prefix'] : '');
+      $newconf_RegFluxBB['FLUXBB_ADMIN'] = (isset($_POST['FluxBB_admin']) ? $_POST['FluxBB_admin'] : '');
+      $newconf_RegFluxBB['FLUXBB_GUEST'] = (isset($_POST['FluxBB_guest']) ? $_POST['FluxBB_guest'] : '');
+      $newconf_RegFluxBB['FLUXBB_DEL_PT'] = (isset($_POST['FluxBB_del_pt']) ? $_POST['FluxBB_del_pt'] : 'false');
+      $newconf_RegFluxBB['FLUXBB_CONFIRM'] = (isset($_POST['FluxBB_confirm']) ? $_POST['FluxBB_confirm'] : 'false');
+      $newconf_RegFluxBB['FLUXBB_DETAIL'] = (isset($_POST['FluxBB_details']) ? $_POST['FluxBB_details'] : 'false');
+      $newconf_RegFluxBB['FLUXBB_UAM_LINK'] = (isset($_POST['FluxBB_UAM']) ? $_POST['FluxBB_UAM'] : 'false');
+      $newconf_RegFluxBB['FLUXBB_GROUP'] = (isset($_POST['FluxBB_group']) ? $_POST['FluxBB_group'] : '');
+    }
+    elseif (function_exists('FindAvailableConfirmMailID'))
+    {
+      $conf_UAM = unserialize($conf['UserAdvManager']);
+        
+      if (isset($conf_UAM['CONFIRM_MAIL']) and ($conf_UAM['CONFIRM_MAIL'] == 'true' or $conf_UAM['CONFIRM_MAIL'] == 'local') and isset($conf_UAM['NO_CONFIRM_GROUP']) and $conf_UAM['NO_CONFIRM_GROUP'] != '-1')
+      {
+        $newconf_RegFluxBB['REGFLUXBB_VERSION'] = $version;
+        $newconf_RegFluxBB['FLUXBB_PREFIX'] = (isset($_POST['FluxBB_prefix']) ? $_POST['FluxBB_prefix'] : '');
+        $newconf_RegFluxBB['FLUXBB_ADMIN'] = (isset($_POST['FluxBB_admin']) ? $_POST['FluxBB_admin'] : '');
+        $newconf_RegFluxBB['FLUXBB_GUEST'] = (isset($_POST['FluxBB_guest']) ? $_POST['FluxBB_guest'] : '');
+        $newconf_RegFluxBB['FLUXBB_DEL_PT'] = (isset($_POST['FluxBB_del_pt']) ? $_POST['FluxBB_del_pt'] : 'false');
+        $newconf_RegFluxBB['FLUXBB_CONFIRM'] = (isset($_POST['FluxBB_confirm']) ? $_POST['FluxBB_confirm'] : 'false');
+        $newconf_RegFluxBB['FLUXBB_DETAIL'] = (isset($_POST['FluxBB_details']) ? $_POST['FluxBB_details'] : 'false');
+        $newconf_RegFluxBB['FLUXBB_UAM_LINK'] = (isset($_POST['FluxBB_UAM']) ? $_POST['FluxBB_UAM'] : 'false');
+        $newconf_RegFluxBB['FLUXBB_GROUP'] = (isset($_POST['FluxBB_group']) ? $_POST['FluxBB_group'] : '');
+      }
+      else
+      {
+        $_POST['FluxBB_UAM'] = 'false';
+        $_POST['FluxBB_group'] = '0';
+
+        $newconf_RegFluxBB['REGFLUXBB_VERSION'] = $version;
+        $newconf_RegFluxBB['FLUXBB_PREFIX'] = (isset($_POST['FluxBB_prefix']) ? $_POST['FluxBB_prefix'] : '');
+        $newconf_RegFluxBB['FLUXBB_ADMIN'] = (isset($_POST['FluxBB_admin']) ? $_POST['FluxBB_admin'] : '');
+        $newconf_RegFluxBB['FLUXBB_GUEST'] = (isset($_POST['FluxBB_guest']) ? $_POST['FluxBB_guest'] : '');
+        $newconf_RegFluxBB['FLUXBB_DEL_PT'] = (isset($_POST['FluxBB_del_pt']) ? $_POST['FluxBB_del_pt'] : 'false');
+        $newconf_RegFluxBB['FLUXBB_CONFIRM'] = (isset($_POST['FluxBB_confirm']) ? $_POST['FluxBB_confirm'] : 'false');
+        $newconf_RegFluxBB['FLUXBB_DETAIL'] = (isset($_POST['FluxBB_details']) ? $_POST['FluxBB_details'] : 'false');
+        $newconf_RegFluxBB['FLUXBB_UAM_LINK'] = (isset($_POST['FluxBB_UAM']) ? $_POST['FluxBB_UAM'] : 'false');
+        $newconf_RegFluxBB['FLUXBB_GROUP'] = (isset($_POST['FluxBB_group']) ? $_POST['FluxBB_group'] : '');
+      }
+    }
+
+    $conf['Register_FluxBB'] = serialize($newconf_RegFluxBB);
+
+    conf_update_param('Register_FluxBB', pwg_db_real_escape_string($conf['Register_FluxBB']));
+
+    array_push($page['infos'], l10n('save_config'));
+  }
+}
+
+
+// +------------------------------------------------------------+
+// |                    Migration and Audit                     |
+// +------------------------------------------------------------+
+if (isset($_POST['Migration']))
+{
+  array_push($page['infos'], l10n('Mig_Start').'<br><br>');
+
+  array_push($page['infos'], l10n('Mig_Del_Link').'<br><br>');
+
+  $query = 'TRUNCATE '.Register_FluxBB_ID_TABLE.';';
+  $result = pwg_query($query);
+
+  $msg_Mig_Del_AllUsers = '';
+
+  $query = '
+SELECT username, id
+FROM '.FluxBB_USERS_TABLE.'
+;';
+
+  $result = pwg_query($query);
+
+  while ($row = pwg_db_fetch_assoc($result))
+  {
+    if((stripslashes($row['username']) != stripslashes($conf_Register_FluxBB['FLUXBB_GUEST'])) and (stripslashes($row['username']) != stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN'])))
+    {
+      $msg_Mig_Del_AllUsers .= '<br> - '.l10n('Mig_Del_User').stripslashes($row['username']);
+
+      FluxBB_Deluser($row['id'], false);
+    }
+  }
+
+  array_push($page['infos'], l10n('Mig_Del_AllUsers').$msg_Mig_Del_AllUsers.'<br><br>');
+
+  $query = '
+SELECT id, username, password, mail_address
+FROM '.USERS_TABLE.'
+WHERE username NOT IN ("18","16")
+;';
+
+  $result = pwg_query($query);
+
+  $registred = time();
+  $registred_ip = $_SERVER['REMOTE_ADDR'];
+
+  $msg_Mig_Add_AllUsers = '';
+
+  while ($row = pwg_db_fetch_assoc($result))
+  {
+    if((stripslashes($row['username']) != 'guest') and (stripslashes($row['username']) != stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN'])))
+    {
+      $msg_Mig_Add_AllUsers .= '<br> - '.l10n('Mig_Add_User').stripslashes($row['username']);
+
+      FluxBB_Adduser($row['id'], stripslashes($row['username']), $row['password'], $row['mail_address']);
+    }
+  }
+
+  array_push($page['infos'], l10n('Mig_Add_AllUsers').$msg_Mig_Add_AllUsers.'<br><br>');
+
+  $query = '
+SELECT id, username, password, mail_address
+FROM '.USERS_TABLE.'
+WHERE username = "'.$conf_Register_FluxBB['FLUXBB_ADMIN'].'"
+AND username NOT IN ("18","16")
+;';
+
+  $row = pwg_db_fetch_assoc(pwg_query($query));
+
+  if (!empty($row))
+  {
+    array_push($page['infos'], l10n('Sync_User').stripslashes($row['username']).'<br><br>');
+
+    FluxBB_Updateuser($row['id'], stripslashes($row['username']), $row['password'], $row['mail_address']);
+  }
+
+  array_push($page['infos'], l10n('Mig_End'));
+}
+else if (isset($_POST['Audit']))
+{
+  Audit_PWG_FluxBB();
+}
+
+
+// +--------------------------------------------------------+
+// |                    Synch and Audit                     |
+// +--------------------------------------------------------+
+if ( isset($_POST['Synchro']))
+{
   $page_Register_FluxBB_admin = get_admin_plugin_menu_link(__FILE__);
   
-
-
   $msg_error_PWG_Dup = '';
   $msg_error_FluxBB_Dup = '';
@@ -69,358 +311,295 @@
   $msg_error_Synchro = '';
   $msg_ok_Synchro = '';
+  $msg_error_FluxBB2PWG = '';
   $msg_error_PWG2FluxBB = '';
-  $msg_error_FluxBB2PWG = '';
-
-
-
-  $query = "
+
+
+  $query = '
 SELECT COUNT(*) AS nbr_dup, id, username
-FROM ".USERS_TABLE." 
+FROM '.USERS_TABLE.'
+WHERE username NOT IN ("18","16")
 GROUP BY BINARY username
 HAVING COUNT(*) > 1
-;";
+;';
+
   $result = pwg_query($query);
-  
+
   while($row = pwg_db_fetch_assoc($result))
     $msg_error_PWG_Dup .= '<br>'.l10n('Error_PWG_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']);
 
-  if ($msg_error_PWG_Dup == '')
-    array_push($page['infos'], l10n('Audit_PWG_Dup').'<br>'.l10n('Audit_OK'));
-  else
-    $msg_error_PWG_Dup = l10n('Audit_PWG_Dup').$msg_error_PWG_Dup.'<br>'.l10n('Advise_PWG_Dup');
-  
-
-
-  $query = "
+    if ($msg_error_PWG_Dup <> '')
+      $msg_error_PWG_Dup = l10n('Audit_PWG_Dup').$msg_error_PWG_Dup.'<br>'.l10n('Advise_PWG_Dup');
+
+  $query = '
 SELECT COUNT(*) AS nbr_dup, username
-FROM ".FluxBB_USERS_TABLE." 
+FROM '.FluxBB_USERS_TABLE.' 
 GROUP BY BINARY username
 HAVING COUNT(*) > 1
-;";
+;';
+
   $result = pwg_query($query);
-  
+
   while($row = pwg_db_fetch_assoc($result))
   {
     $msg_error_FluxBB_Dup .= '<br>'.l10n('Error_FluxBB_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']);
 
-    $subquery = "
+    $subquery = '
 SELECT id, username, email
-FROM ".FluxBB_USERS_TABLE." 
-WHERE BINARY username = BINARY '".$row['username']."'
-;";
+FROM '.FluxBB_USERS_TABLE.' 
+WHERE BINARY username = BINARY "'.$row['username'].'"
+;';
+
     $subresult = pwg_query($subquery);
-  
+
     while($subrow = pwg_db_fetch_assoc($subresult))
     {
       $msg_error_FluxBB_Dup .= '<br>id:'.$subrow['id'].'='.stripslashes($subrow['username']).' ('.$subrow['email'].')';
-  
+
       $msg_error_FluxBB_Dup .= ' <a href="';
-      
+
       $msg_error_FluxBB_Dup .= add_url_params($page_Register_FluxBB_admin, array(
         'action' => 'del_user',
         'id' => $subrow['id'],
       ));
-        
+
       $msg_error_FluxBB_Dup .= '" title="'.l10n('Del_User').stripslashes($subrow['username']).'"';
-        
-      $msg_error_FluxBB_Dup .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
-        
-      $msg_error_FluxBB_Dup .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').$subrow['username'].'" /></a>';
-    }
-  }
-
-  if ($msg_error_FluxBB_Dup == '')
-    array_push($page['infos'], l10n('Audit_FluxBB_Dup').'<br>'.l10n('Audit_OK'));
-  else
-    $msg_error_FluxBB_Dup = l10n('Audit_FluxBB_Dup').$msg_error_FluxBB_Dup.'<br>'.l10n('Advise_FluxBB_Dup');
-  
-
-
-  $query = "
+
+      $msg_error_FluxBB_Dup .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+      $msg_error_FluxBB_Dup .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($subrow['username']).'" /></a>';
+    }
+  }
+
+  if ($msg_error_FluxBB_Dup <> '')
+    $msg_error_FluxBB_Dup = l10n('Sync_Check_Dup').$msg_error_FluxBB_Dup.'<br>'.l10n('Advise_FluxBB_Dup');
+
+  if ($msg_error_FluxBB_Dup == '' and $msg_error_PWG_Dup == '')
+  {
+    $query = '
 SELECT pwg.id as pwg_id, bb.id as bb_id, pwg.username as pwg_user, pwg.mail_address as pwg_mail
-FROM ".FluxBB_USERS_TABLE." AS bb, ".USERS_TABLE." as pwg
+FROM '.FluxBB_USERS_TABLE.' AS bb, '.USERS_TABLE.' as pwg
 WHERE bb.id NOT in (
   SELECT id_user_FluxBB
-  FROM ".Register_FluxBB_ID_TABLE."
+  FROM '.Register_FluxBB_ID_TABLE.'
   )
 AND pwg.id NOT in (
   SELECT id_user_pwg
-  FROM ".Register_FluxBB_ID_TABLE."
+  FROM '.Register_FluxBB_ID_TABLE.'
   )
 AND pwg.username = bb.username
+AND pwg.username NOT IN ("18","16")
 AND pwg.mail_address = bb.email
-;";
-
-  $result = pwg_query($query);
-  
-  while($row = pwg_db_fetch_assoc($result))
-  {
-    $msg_error_Link_Break .= '<br>'.l10n('Error_Link_Break').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')';
-
-    $msg_error_Link_Break .= ' <a href="';
-  
-    $msg_error_Link_Break .= add_url_params($page_Register_FluxBB_admin, array(
-      'action'   => 'new_link',
-      'pwg_id' => $row['pwg_id'],
-      'bb_id' => $row['bb_id'],
-    ));
-
-    $msg_error_Link_Break .= '" title="'.l10n('New_Link').stripslashes($row['pwg_user']).'"';
-
-    $msg_error_Link_Break .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
-
-    $msg_error_Link_Break .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_break.png" alt="'.l10n('New_Link').stripslashes($row['pwg_user']).'" /></a>';
-  }
-
-  if ($msg_error_Link_Break == '')
-    array_push($page['infos'], l10n('Audit_Link_Break').'<br>'.l10n('Audit_OK'));
-  else
-    $msg_error_Link_Break = l10n('Audit_Link_Break').$msg_error_Link_Break;
-    
-
-  
-  $query = "
+;';
+
+    $result = pwg_query($query);
+
+    while($row = pwg_db_fetch_assoc($result))
+    {
+      $msg_error_Link_Break .= '<br>'.l10n('New_Link').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')';
+      FluxBB_Linkuser($row['pwg_id'], $row['bb_id']);
+    }
+
+    if ($msg_error_Link_Break == '')
+      array_push($page['infos'], l10n('Sync_Link_Break').'<br>'.l10n('Sync_OK'));
+    else
+      $msg_error_Link_Break = l10n('Sync_Link_Break').$msg_error_Link_Break;
+
+    $query = '
 SELECT pwg.username as pwg_user, pwg.id as pwg_id, pwg.mail_address as pwg_mail, bb.id as bb_id, bb.username as bb_user, bb.email as bb_mail
-FROM ".FluxBB_USERS_TABLE." AS bb 
-INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = bb.id
-INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
-WHERE pwg.username <> bb.username
-;";
-
-  $result = pwg_query($query);
-  
-  while($row = pwg_db_fetch_assoc($result))
-  {
-    $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')';
-
-    $msg_error_Link_Bad .= ' <a href="';
-  
-    $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array(
-      'action'   => 'link_del',
-      'pwg_id' => $row['pwg_id'],
-      'bb_id'  => $row['bb_id'],
-    ));
-
-    $msg_error_Link_Bad .= '" title="'.l10n('Link_Del').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'"';
-
-    $msg_error_Link_Bad .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
-
-    $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_delete.png" alt="'.l10n('Link_Del').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'" /></a>';
-
-    $msg_error_Link_Bad .= ' -- <a href="';
-
-    $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array(
-      'action' => 'sync_user',
-      'username' => stripslashes($row['pwg_user']),
-    ));
-
-    $msg_error_Link_Bad .= '" title="'.l10n('Sync_User').stripslashes($row['pwg_user']).' --> '.stripslashes($row['bb_user']).'"';
-
-    $msg_error_Link_Bad .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
-
-    $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/arrow_switch.png" alt="'.l10n('Sync_User').stripslashes($row['pwg_user']).' --> '.stripslashes($row['bb_user']).'" /></a>';
-  }
-
-
-  $query = "
+FROM '.FluxBB_USERS_TABLE.' AS bb 
+INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = bb.id
+INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id
+WHERE BINARY pwg.username <> BINARY bb.username
+AND pwg.username NOT IN ("18","16")
+;';
+
+    $result = pwg_query($query);
+
+    while($row = pwg_db_fetch_assoc($result))
+    {
+      $msg_error_Link_Bad .= '<br>'.l10n('Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')';
+
+      $subquery = '
+DELETE FROM '.Register_FluxBB_ID_TABLE.'
+WHERE id_user_pwg = '.$row['pwg_id'].'
+AND id_user_FluxBB = '.$row['bb_id'].'
+;';
+
+      $subresult = pwg_query($subquery);
+    }
+
+    $query = '
 SELECT COUNT(*) as nbr_dead
-FROM ".Register_FluxBB_ID_TABLE." AS Link
+FROM '.Register_FluxBB_ID_TABLE.' AS Link
 WHERE id_user_FluxBB NOT IN (
   SELECT id
-  FROM ".FluxBB_USERS_TABLE."
+  FROM '.FluxBB_USERS_TABLE.'
   )
 OR id_user_pwg NOT IN (
   SELECT id
-  FROM ".USERS_TABLE."
-  )
-;";
-
-  $Compteur = pwg_db_fetch_assoc(pwg_query($query));
-
-  if (!empty($Compteur) and $Compteur['nbr_dead'] > 0)
-  { 
-    $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Dead').$Compteur['nbr_dead'];
-
-    $msg_error_Link_Bad .= ' <a href="';
-
-    $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array(
-      'action'   => 'link_dead',
-    ));
-
-    $msg_error_Link_Bad .= '" title="'.l10n('Link_Dead').$Compteur['nbr_dead'].'"';
-
-    $msg_error_Link_Bad .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
-
-    $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_delete.png" alt="'.l10n('Link_Dead').$Compteur['nbr_dead'].'" /></a>';
-  }
-
-  $query = "
+  FROM '.USERS_TABLE.'
+  )
+;';
+
+    $Compteur = pwg_db_fetch_assoc(pwg_query($query));
+
+    if (!empty($Compteur) and $Compteur['nbr_dead'] > 0)
+    { 
+      $msg_error_Link_Bad .= '<br>'.l10n('Link_Dead').$Compteur['nbr_dead'];
+
+      $query = '
+DELETE FROM '.Register_FluxBB_ID_TABLE.'
+WHERE id_user_FluxBB NOT IN (
+  SELECT id
+  FROM '.FluxBB_USERS_TABLE.'
+  )
+OR id_user_pwg NOT IN (
+  SELECT id
+  FROM '.USERS_TABLE.'
+  )
+;';
+
+      $result = pwg_query($query);
+    }
+
+    $query = '
 SELECT COUNT(*) AS nbr_dup, pwg.id AS pwg_id, pwg.username AS pwg_user, bb.username AS bb_user, bb.id AS bb_id
-FROM ".FluxBB_USERS_TABLE." AS bb 
-INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = bb.id
-INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
+FROM '.FluxBB_USERS_TABLE.' AS bb 
+INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = bb.id
+INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id
+WHERE pwg.username NOT IN ("18","16")
 GROUP BY link.id_user_pwg, link.id_user_FluxBB
 HAVING COUNT(*) > 1
-;";
-
-  $result = pwg_query($query);
-  
-  while($row = pwg_db_fetch_assoc($result))
-  {
-    $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Dup').$row['nbr_dup'].' = '.stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).')';
-
-    $msg_error_Link_Bad .= ' <a href="';
-
-    $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array(
-      'action'   => 'new_link',
-      'pwg_id' => $row['pwg_id'],
-      'bb_id' => $row['bb_id'],
-    ));
-
-    $msg_error_Link_Bad .= '" title="'.l10n('Link_Dup').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'"';
-
-    $msg_error_Link_Bad .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
-
-    $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_error.png" alt="'.l10n('Link_Dup').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'" /></a>';
-  }
-
-  if ($msg_error_Link_Bad == '')
-    array_push($page['infos'], l10n('Audit_Link_Bad').'<br>'.l10n('Audit_OK'));
-  else
-    $msg_error_Link_Bad = l10n('Audit_Link_Bad').$msg_error_Link_Bad;
+;';
+
+    $result = pwg_query($query);
     
-
-  
-  $query = "
-SELECT pwg.username as username, pwg.password as pwg_pwd, pwg.mail_address as pwg_eml, FluxBB.password as bb_pwd, FluxBB.email as bb_eml
-FROM ".FluxBB_USERS_TABLE." AS FluxBB 
-INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = FluxBB.id
-INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
+    while($row = pwg_db_fetch_assoc($result))
+    {
+      $msg_error_Link_Bad .= '<br>'.l10n('Link_Dup').$row['nbr_dup'].' = '.stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).')';
+  
+      FluxBB_Linkuser($row['pwg_id'], $row['bb_id']);
+    }
+
+    if ($msg_error_Link_Bad == '')
+      array_push($page['infos'], l10n('Sync_Link_Bad').'<br>'.l10n('Sync_OK'));
+    else
+      $msg_error_Link_Bad = l10n('Sync_Link_Bad').$msg_error_Link_Bad;
+
+    $query = '
+SELECT pwg.id as pwg_id, pwg.username as username, pwg.password as pwg_pwd, pwg.mail_address as pwg_eml, FluxBB.id as bb_id, FluxBB.password as bb_pwd, FluxBB.email as bb_eml
+FROM '.FluxBB_USERS_TABLE.' AS FluxBB 
+INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = FluxBB.id
+INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id
 AND BINARY pwg.username = BINARY FluxBB.username
 ORDER BY LOWER(pwg.username)
-;";
-
-  $result = pwg_query($query);
-  
-  while($row = pwg_db_fetch_assoc($result))
-  {
-    if ( ($row['pwg_pwd'] != $row['bb_pwd']) or ($row['pwg_eml'] != $row['bb_eml']) )
-    {
-      $msg_error_Synchro .= '<br>'.l10n('Error_Synchro').stripslashes($row['username']);
-
-      $msg_error_Synchro .= ' <a href="';
-
-      $msg_error_Synchro .= add_url_params($page_Register_FluxBB_admin, array(
-        'action' => 'sync_user',
-        'username' => stripslashes($row['username']),
+;';
+
+    $result = pwg_query($query);
+
+    while($row = pwg_db_fetch_assoc($result))
+    {
+      if ( ($row['pwg_pwd'] != $row['bb_pwd']) or ($row['pwg_eml'] != $row['bb_eml']) )
+      {
+        $msg_error_Synchro .= '<br>'.l10n('Sync_User').stripslashes($row['username']);
+
+        $query = '
+SELECT id, username, password, mail_address 
+FROM '.USERS_TABLE.'
+WHERE BINARY id = "'.$row['pwg_id'].'"
+AND "'.$row['username'].'" NOT IN ("18","16")
+;';
+
+        $data = pwg_db_fetch_assoc(pwg_query($query));
+
+        if (!empty($data))
+          FluxBB_Updateuser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']);
+      }
+    }
+
+    if ($msg_error_Synchro == '')
+      array_push($page['infos'], l10n('Sync_DataUser').'<br>'.l10n('Sync_OK'));
+    else
+      $msg_error_Synchro = l10n('Sync_DataUser').$msg_error_Synchro;
+
+    $query = '
+SELECT username, mail_address FROM '.USERS_TABLE.'
+WHERE BINARY username <> BINARY "guest"
+AND username NOT IN ("18","16")
+AND id not in (
+  SELECT id_user_pwg FROM '.Register_FluxBB_ID_TABLE.'
+  )
+AND BINARY username not in (
+  SELECT username FROM '.FluxBB_USERS_TABLE.'
+  )
+ORDER BY LOWER(username)
+;';
+
+    $result = pwg_query($query);
+
+    while($row = pwg_db_fetch_assoc($result))
+    {
+      $msg_error_PWG2FluxBB .= '<br>'.l10n('Add_User').stripslashes($row['username']).' ('.$row['mail_address'].')';
+
+      $query = '
+SELECT id, username, password, mail_address 
+FROM '.USERS_TABLE.'
+WHERE BINARY username = BINARY "'.$row['username'].'"
+AND username NOT IN ("18","16")
+LIMIT 1
+;';
+
+      $data = pwg_db_fetch_assoc(pwg_query($query));
+
+      if (!empty($data))
+        FluxBB_Adduser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']);  
+    }
+
+    if ($msg_error_PWG2FluxBB == '')
+      array_push($page['infos'], l10n('Sync_PWG2FluxBB').'<br>'.l10n('Sync_OK'));
+    else
+      $msg_error_PWG2FluxBB = l10n('Sync_PWG2FluxBB').$msg_error_PWG2FluxBB;
+  
+    $query = '
+SELECT id, username, email FROM '.FluxBB_USERS_TABLE.'
+WHERE BINARY username <> BINARY "'.$conf_Register_FluxBB['FLUXBB_GUEST'].'"
+AND id not in (
+  SELECT id_user_FluxBB FROM '.Register_FluxBB_ID_TABLE.'
+  )
+AND BINARY username not in (
+  SELECT username FROM '.USERS_TABLE.'
+  )
+ORDER BY LOWER(username)
+;';
+
+    $result = pwg_query($query);
+
+    while($row = pwg_db_fetch_assoc($result))
+    {
+      $msg_error_FluxBB2PWG .= '<br>'.l10n('Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')';
+      $msg_error_FluxBB2PWG .= ' <a href="';
+      $msg_error_FluxBB2PWG .= add_url_params($page_Register_FluxBB_admin, array(
+          'action' => 'del_user',
+          'id' => $row['id'],
       ));
 
-      $msg_error_Synchro .= '" title="'.l10n('Sync_User').stripslashes($row['username']).'"';
-
-      $msg_error_Synchro .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
-
-      $msg_error_Synchro .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_refresh.png" alt="'.l10n('Sync_User').stripslashes($row['username']).'" /></a>';
-
-      if ($row['pwg_pwd'] != $row['bb_pwd'])
-        $msg_error_Synchro .= '<br>'.l10n('Error_Synchro_Pswd');
-
-      if ($row['pwg_eml'] != $row['bb_eml'])
-        $msg_error_Synchro .= '<br>'.l10n('Error_Synchro_Mail').'<br>-- PWG = '.$row['pwg_eml'].'<br>-- FluxBB = '.$row['bb_eml'];
-    }
-    else if ($conf_Register_FluxBB[5] == 'true')
-      $msg_ok_Synchro .= '<br> - '.stripslashes($row['username']).' ('.$row['pwg_eml'].')'.l10n('Audit_Synchro_OK');
-  }
-
-  if ($msg_error_Synchro <> '')
-    $msg_error_Synchro = l10n('Audit_Synchro').$msg_error_Synchro;
-    
-  if ($msg_ok_Synchro <> '')
-    if ($msg_error_Synchro <> '')
-      array_push($page['infos'], l10n('Audit_Synchro').$msg_ok_Synchro.'<br><br>');
+      $msg_error_FluxBB2PWG .= '" title="'.l10n('Del_User').stripslashes($row['username']).'"';
+
+      $msg_error_FluxBB2PWG .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+      $msg_error_FluxBB2PWG .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($row['username']).'" /></a>';
+    }
+
+    if ($msg_error_FluxBB2PWG == '')
+      array_push($page['infos'], l10n('Sync_FluxBB2PWG').'<br>'.l10n('Sync_OK'));
     else
-      array_push($page['infos'], l10n('Audit_Synchro').$msg_ok_Synchro.'<br><br>'.l10n('Audit_OK'));
-
-
-  $query = "
-SELECT username, mail_address FROM ".USERS_TABLE."
-WHERE BINARY username <> BINARY 'guest'
-AND id not in (
-  SELECT id_user_pwg FROM ".Register_FluxBB_ID_TABLE."
-  )
-AND BINARY username not in (
-  SELECT username FROM ".FluxBB_USERS_TABLE."
-  )
-ORDER BY LOWER(username)
-;";
-
-  $result = pwg_query($query);
-
-  while($row = pwg_db_fetch_assoc($result))
-  {
-    $msg_error_PWG2FluxBB .= '<br>'.l10n('Error_PWG2FluxBB').stripslashes($row['username']).' ('.$row['mail_address'].')';
-
-    $msg_error_PWG2FluxBB .= ' <a href="';
-
-    $msg_error_PWG2FluxBB .= add_url_params($page_Register_FluxBB_admin, array(
-      'action' => 'add_user',
-      'username' => stripslashes($row['username']),
-    ));
-
-    $msg_error_PWG2FluxBB .= '" title="'.l10n('Add_User').stripslashes($row['username']).'" ';
-
-    $msg_error_PWG2FluxBB .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
-
-    $msg_error_PWG2FluxBB .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_add.png" alt="'.l10n('Add_User').stripslashes($row['username']).'" /></a>';
-  }
-
-  if ($msg_error_PWG2FluxBB == '')
-    array_push($page['infos'], l10n('Audit_PWG2FluxBB').'<br>'.l10n('Audit_OK'));
+      $msg_error_FluxBB2PWG = l10n('Sync_FluxBB2PWG').$msg_error_FluxBB2PWG;
+  }
   else
-    $msg_error_PWG2FluxBB = l10n('Audit_PWG2FluxBB').$msg_error_PWG2FluxBB;
-
-  
-
-  $query = "
-SELECT id, username, email FROM ".FluxBB_USERS_TABLE."
-WHERE BINARY username <> BINARY '".$conf_Register_FluxBB[2]."'
-AND id not in (
-  SELECT id_user_FluxBB FROM ".Register_FluxBB_ID_TABLE."
-  )
-AND BINARY username not in (
-  SELECT username FROM ".USERS_TABLE."
-  )
-ORDER BY LOWER(username)
-;";
-
-  $result = pwg_query($query);
-
-  while($row = pwg_db_fetch_assoc($result))
-  {
-    $msg_error_FluxBB2PWG .= '<br>'.l10n('Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')';
-
-    $msg_error_FluxBB2PWG .= ' <a href="';
-
-    $msg_error_FluxBB2PWG .= add_url_params($page_Register_FluxBB_admin, array(
-      'action' => 'del_user',
-      'id' => $row['id'],
-    ));
-
-    $msg_error_FluxBB2PWG .= '" title="'.l10n('Del_User').stripslashes($row['username']).'"';
-
-    $msg_error_FluxBB2PWG .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
-
-    $msg_error_FluxBB2PWG .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($row['username']).'" /></a>';
-  }
-
-  if ($msg_error_FluxBB2PWG == '')
-    array_push($page['infos'], l10n('Audit_FluxBB2PWG').'<br>'.l10n('Audit_OK'));
-  else
-    $msg_error_FluxBB2PWG = l10n('Audit_FluxBB2PWG').$msg_error_FluxBB2PWG;
-
-
+    $errors[] = l10n('Advise_Check_Dup');
 
   if ($msg_error_PWG_Dup <> '')
     $errors[] = $msg_error_PWG_Dup . ( ($msg_error_FluxBB_Dup == '' and $msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
-  
+
   if ($msg_error_FluxBB_Dup <> '')
     $errors[] = $msg_error_FluxBB_Dup . ( ($msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
@@ -441,666 +620,60 @@
     $errors[] = $msg_error_FluxBB2PWG;
 }
-
-
-
-
-// +-----------------------------------------------------------------------+
-// |                            Actions process
-// +-----------------------------------------------------------------------+
-
-if (isset($_GET['action']) and ($_GET['action']=='link_dead'))
-{
-  $query = "
-DELETE FROM ".Register_FluxBB_ID_TABLE."
-WHERE id_user_FluxBB NOT IN (
-  SELECT id
-  FROM ".FluxBB_USERS_TABLE."
-  )
-OR id_user_pwg NOT IN (
-  SELECT id
-  FROM ".USERS_TABLE."
-  )
-;";
-
-  $result = pwg_query($query);
-  
+else if ( isset($_POST['Audit']))
+{
   Audit_PWG_FluxBB();
 }
-else if (isset($_GET['action']) and ($_GET['action']=='link_del') and isset($_GET['pwg_id']) and isset($_GET['bb_id']))
-{
-  $query = "
-DELETE FROM ".Register_FluxBB_ID_TABLE."
-WHERE id_user_pwg = ".$_GET['pwg_id']."
-AND id_user_FluxBB = ".$_GET['bb_id']."
-;";
-
-  $result = pwg_query($query);
-  
-  Audit_PWG_FluxBB();
-}
-else if (isset($_GET['action']) and ($_GET['action']=='new_link') and isset($_GET['pwg_id']) and isset($_GET['bb_id']))
-{
-  FluxBB_Linkuser($_GET['pwg_id'], $_GET['bb_id']);
-  
-  Audit_PWG_FluxBB();
-}
-else if (isset($_GET['action']) and ($_GET['action']=='sync_user') and isset($_GET['username']))
-{
-  $query = "
-SELECT id AS id_pwg, username, password, mail_address 
-FROM ".USERS_TABLE."
-WHERE BINARY username = BINARY '".pwg_db_real_escape_string($_GET['username'])."'
-LIMIT 1
-;";
-
-  $data = pwg_db_fetch_assoc(pwg_query($query));
-  
-  if (!empty($data))
-  {
-    FluxBB_Updateuser($data['id_pwg'], stripslashes($data['username']), $data['password'], $data['mail_address']);
-  }
-  
-  Audit_PWG_FluxBB();
-}
-else if (isset($_GET['action']) and ($_GET['action']=='add_user') and isset($_GET['username']))
-{
-  $query = "
-SELECT id, username, password, mail_address 
-FROM ".USERS_TABLE."
-WHERE BINARY username = BINARY '".pwg_db_real_escape_string($_GET['username'])."'
-LIMIT 1
-;";
-
-  $data = pwg_db_fetch_assoc(pwg_query($query));
-  
-  if (!empty($data))
-    FluxBB_Adduser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']);  
-  
-    Audit_PWG_FluxBB();
-}
-else if (isset($_GET['action']) and ($_GET['action']=='del_user') and isset($_GET['id']))
-{
-  FluxBB_Deluser( $_GET['id'], true );
-  
-  Audit_PWG_FluxBB();
-}
-
-
-// +-----------------------------------------------------------------------+
-// |                            Tabssheet select                           |
-// +-----------------------------------------------------------------------+
-
-switch ($page['tab'])
-{
-  case 'info':
-
-  $template->assign(
-    array(
-      'REGFLUXBB_PATH'    => REGFLUXBB_PATH,
-      'REGFLUXBB_VERSION' => $version,
-    )
-  );
-  
-  $template->set_filename('plugin_admin_content', dirname(__FILE__).'/template/info.tpl');
-  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
-
-	break;
-
-	case 'manage':
-  
-  if (isset($_POST['submit']) and isset($_POST['FluxBB_prefix']) and isset($_POST['FluxBB_admin']) and isset($_POST['FluxBB_guest']) and isset($_POST['FluxBB_del_pt']) and isset($_POST['FluxBB_confirm']) and isset($_POST['FluxBB_details']))
-  {
-
-/* Configuration controls */
-// Piwigo's admin username control
-    $query1 = "
-SELECT username, id
-FROM ".USERS_TABLE."
-WHERE id = ".$conf['webmaster_id']."
-;";
-
-    $pwgadmin = pwg_db_fetch_assoc(pwg_query($query1));
-
-// FluxBB's admin username control
-    $query2 = "
-SELECT username, id
-FROM ".FluxBB_USERS_TABLE."
-WHERE id = 2
-;";
-
-    $fbbadmin = pwg_db_fetch_assoc(pwg_query($query2));
-
-// FluxBB's Guest username control
-    $query3 = "
-SELECT username, id
-FROM ".FluxBB_USERS_TABLE."
-WHERE id = 1
-;";
-
-    $fbbguest = pwg_db_fetch_assoc(pwg_query($query3));
-
-// Compute configuration errors
-    if (stripslashes($pwgadmin['username']) != stripslashes($_POST['FluxBB_admin']))
-    {
-      array_push($page['errors'], l10n('error_config_admin1'));
-    }
-    if (stripslashes($pwgadmin['username']) != stripslashes($fbbadmin['username']))
-    {
-      array_push($page['errors'], l10n('error_config_admin2'));
-    }
-    if (stripslashes($fbbguest['username']) != stripslashes($_POST['FluxBB_guest']))
-    {
-      array_push($page['errors'], l10n('error_config_guest'));
-    }
-    elseif (count($page['errors']) == 0)
-    {
-      if (!function_exists('FindAvailableConfirmMailID'))
-      {
-      $conf['Register_FluxBB'] = $_POST['FluxBB_prefix'].';'.pwg_db_real_escape_string($_POST['FluxBB_admin']).';'.pwg_db_real_escape_string($_POST['FluxBB_guest']).';'.$_POST['FluxBB_del_pt'].';'.$_POST['FluxBB_confirm'].';'.$_POST['FluxBB_details'].';false;0';
-      }
-      elseif (function_exists('FindAvailableConfirmMailID'))
-      {
-        $conf_UAM = unserialize($conf['UserAdvManager']);
-        
-        if (isset($conf_UAM[1]) and ($conf_UAM[1] == 'true' or $conf_UAM[1] == 'local') and isset($conf_UAM[2]) and $conf_UAM[2] != '-1')
-        {
-          $conf['Register_FluxBB'] = $_POST['FluxBB_prefix'].';'.pwg_db_real_escape_string($_POST['FluxBB_admin']).';'.pwg_db_real_escape_string($_POST['FluxBB_guest']).';'.$_POST['FluxBB_del_pt'].';'.$_POST['FluxBB_confirm'].';'.$_POST['FluxBB_details'].';'.$_POST['FluxBB_UAM'].';'.$_POST['FluxBB_group'];
-        }
-        else
-        {
-          $conf['Register_FluxBB'] = $_POST['FluxBB_prefix'].';'.pwg_db_real_escape_string($_POST['FluxBB_admin']).';'.pwg_db_real_escape_string($_POST['FluxBB_guest']).';'.$_POST['FluxBB_del_pt'].';'.$_POST['FluxBB_confirm'].';'.$_POST['FluxBB_details'].';false;0';
-        }
-      }
-
-      conf_update_param('Register_FluxBB', $conf['Register_FluxBB']);
-      
-      array_push($page['infos'], l10n('save_config'));
-    }
-  }
-
-  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+
+
+// +---------------------------------------------------------------+
+// |                       Template init                           |
+// +---------------------------------------------------------------+
+$conf_Register_FluxBB = unserialize($conf['Register_FluxBB']);
 
 // If UAM exists and if UAM ConfirmMail is set, we can set this feature
-  if (function_exists('FindAvailableConfirmMailID'))
-  {
-    $conf_UAM = unserialize($conf['UserAdvManager']);
-
-    if (isset($conf_UAM[1]) and ($conf_UAM[1] == 'true' or $conf_UAM[1] == 'local') and (isset($conf_UAM[2]) and $conf_UAM[2] <> '-1'))
-    {
-      $UAM_bridge = true;
-    }
-    else $UAM_bridge = false;
-  }
-
-  $template->assign(
-    array
-    (
-      'REGFLUXBB_PATH'       => REGFLUXBB_PATH,
-      'REGFLUXBB_VERSION'    => $version,
-      'FluxBB_PREFIX'        => $conf_Register_FluxBB[0],
-      'FluxBB_ADMIN'         => stripslashes($conf_Register_FluxBB[1]),
-      'FluxBB_GUEST'         => stripslashes($conf_Register_FluxBB[2]),
-      'FluxBB_DEL_PT_TRUE'   => (isset($conf_Register_FluxBB[3]) and $conf_Register_FluxBB[3] == 'true') ? 'checked="checked"' : '',
-      'FluxBB_DEL_PT_FALSE'  => (isset($conf_Register_FluxBB[3]) and $conf_Register_FluxBB[3] == 'false') ? 'checked="checked"' : '',
-      'FluxBB_CONFIRM_TRUE'  => (isset($conf_Register_FluxBB[4]) and $conf_Register_FluxBB[4] == 'true') ? 'checked="checked"' : '',
-      'FluxBB_CONFIRM_FALSE' => (isset($conf_Register_FluxBB[4]) and $conf_Register_FluxBB[4] == 'false') ? 'checked="checked"' : '',
-      'FluxBB_DETAILS_TRUE'  => (isset($conf_Register_FluxBB[5]) and $conf_Register_FluxBB[5] == 'true') ? 'checked="checked"' : '',
-      'FluxBB_DETAILS_FALSE' => (isset($conf_Register_FluxBB[5]) and $conf_Register_FluxBB[5] == 'false') ? 'checked="checked"' : '',
-      'UAM_BRIDGE'           => $UAM_bridge,
-      'FluxBB_UAM_LINK_TRUE' => (isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true') ? 'checked="checked"' : '',
-      'FluxBB_UAM_LINK_FALSE'=> (isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'false') ? 'checked="checked"' : '',
-      'FluxBB_GROUP'         => $conf_Register_FluxBB[7],
-    )
-  );
-
-  $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/manage.tpl');
-  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
-
-	break;
-
-	case 'Migration':
-  
-  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
-	
-  if (isset($_POST['Migration']))
-  {
-    array_push($page['infos'], l10n('Mig_Start').'<br><br>');
-  
-    array_push($page['infos'], l10n('Mig_Del_Link').'<br><br>');
-
-    $query = "TRUNCATE ".Register_FluxBB_ID_TABLE.";";
-    $result = pwg_query($query);
-  
-  
-    $msg_Mig_Del_AllUsers = '';
-
-    $query = "
-SELECT username, id
-FROM ".FluxBB_USERS_TABLE."
-;";
-
-    $result = pwg_query($query);
-       
-    while ($row = pwg_db_fetch_assoc($result))
-    {
-      if((stripslashes($row['username']) != stripslashes($conf_Register_FluxBB[2])) and (stripslashes($row['username']) != stripslashes($conf_Register_FluxBB[1])))
-      {
-        $msg_Mig_Del_AllUsers .= '<br> - '.l10n('Mig_Del_User').stripslashes($row['username']);
-        
-        FluxBB_Deluser($row['id'], false);
-      }
-    }
-
-    array_push($page['infos'], l10n('Mig_Del_AllUsers').$msg_Mig_Del_AllUsers.'<br><br>');
-
-
-    $query = "
-SELECT id, username, password, mail_address
-FROM ".USERS_TABLE."
-;";
-
-    $result = pwg_query($query);
-  
-    $registred = time();
-    $registred_ip = $_SERVER['REMOTE_ADDR'];
-  
-    $msg_Mig_Add_AllUsers = '';
-  
-    while ($row = pwg_db_fetch_assoc($result))
-    {
-      if((stripslashes($row['username']) != 'guest') and (stripslashes($row['username']) != stripslashes($conf_Register_FluxBB[1])))
-      {
-        $msg_Mig_Add_AllUsers .= '<br> - '.l10n('Mig_Add_User').stripslashes($row['username']);
-
-        FluxBB_Adduser($row['id'], stripslashes($row['username']), $row['password'], $row['mail_address']);
-      }
-    }
-
-    array_push($page['infos'], l10n('Mig_Add_AllUsers').$msg_Mig_Add_AllUsers.'<br><br>');
-
-
-    $query = "
-SELECT id, username, password, mail_address
-FROM ".USERS_TABLE."
-WHERE username = '".$conf_Register_FluxBB[1]."'
-;";
-
-    $row = pwg_db_fetch_assoc(pwg_query($query));
-
-    if (!empty($row))
-    {
-      array_push($page['infos'], l10n('Sync_User').stripslashes($row['username']).'<br><br>');
-      
-      FluxBB_Updateuser($row['id'], stripslashes($row['username']), $row['password'], $row['mail_address']);
-    }
-
-    array_push($page['infos'], l10n('Mig_End'));
-  }
-  else if ( isset($_POST['Audit']))
-  {
-    Audit_PWG_FluxBB();
-  }
-
-  $template->assign(
-    array
-    (
-      'REGFLUXBB_PATH'    => REGFLUXBB_PATH,
-      'REGFLUXBB_VERSION' => $version,
-    )
-  );
-
-  $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/migration.tpl');
-  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
-
-	break;
-  
-	case 'Synchro':
-  
-  if ( isset($_POST['Synchro']))
-  {
-    global $page,$conf, $errors;
-
-    $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
-
-    $page_Register_FluxBB_admin = get_admin_plugin_menu_link(__FILE__);
-  
-
-    $msg_error_PWG_Dup = '';
-    $msg_error_FluxBB_Dup = '';
-    $msg_error_Link_Break = '';
-    $msg_error_Link_Bad = '';
-    $msg_error_Synchro = '';
-    $msg_ok_Synchro = '';
-    $msg_error_FluxBB2PWG = '';
-    $msg_error_PWG2FluxBB = '';
-
-
-    $query = "
-SELECT COUNT(*) AS nbr_dup, id, username
-FROM ".USERS_TABLE." 
-GROUP BY BINARY username
-HAVING COUNT(*) > 1
-;";
-
-    $result = pwg_query($query);
-  
-    while($row = pwg_db_fetch_assoc($result))
-      $msg_error_PWG_Dup .= '<br>'.l10n('Error_PWG_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']);
-
-      if ($msg_error_PWG_Dup <> '')
-        $msg_error_PWG_Dup = l10n('Audit_PWG_Dup').$msg_error_PWG_Dup.'<br>'.l10n('Advise_PWG_Dup');
-  
-
-    $query = "
-SELECT COUNT(*) AS nbr_dup, username
-FROM ".FluxBB_USERS_TABLE." 
-GROUP BY BINARY username
-HAVING COUNT(*) > 1
-;";
-
-    $result = pwg_query($query);
-  
-    while($row = pwg_db_fetch_assoc($result))
-    {
-      $msg_error_FluxBB_Dup .= '<br>'.l10n('Error_FluxBB_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']);
-
-      $subquery = "
-SELECT id, username, email
-FROM ".FluxBB_USERS_TABLE." 
-WHERE BINARY username = BINARY '".$row['username']."'
-;";
-
-      $subresult = pwg_query($subquery);
-  
-      while($subrow = pwg_db_fetch_assoc($subresult))
-      {
-        $msg_error_FluxBB_Dup .= '<br>id:'.$subrow['id'].'='.stripslashes($subrow['username']).' ('.$subrow['email'].')';
-  
-        $msg_error_FluxBB_Dup .= ' <a href="';
-      
-        $msg_error_FluxBB_Dup .= add_url_params($page_Register_FluxBB_admin, array(
-          'action' => 'del_user',
-          'id' => $subrow['id'],
-        ));
-
-        $msg_error_FluxBB_Dup .= '" title="'.l10n('Del_User').stripslashes($subrow['username']).'"';
-
-        $msg_error_FluxBB_Dup .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
-
-        $msg_error_FluxBB_Dup .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($subrow['username']).'" /></a>';
-      }
-    }
-
-    if ($msg_error_FluxBB_Dup <> '')
-      $msg_error_FluxBB_Dup = l10n('Sync_Check_Dup').$msg_error_FluxBB_Dup.'<br>'.l10n('Advise_FluxBB_Dup');
-  
-
-    if ($msg_error_FluxBB_Dup == '' and $msg_error_PWG_Dup == '')
-    {
-      $query = "
-SELECT pwg.id as pwg_id, bb.id as bb_id, pwg.username as pwg_user, pwg.mail_address as pwg_mail
-FROM ".FluxBB_USERS_TABLE." AS bb, ".USERS_TABLE." as pwg
-WHERE bb.id NOT in (
-  SELECT id_user_FluxBB
-  FROM ".Register_FluxBB_ID_TABLE."
-  )
-AND pwg.id NOT in (
-  SELECT id_user_pwg
-  FROM ".Register_FluxBB_ID_TABLE."
-  )
-AND pwg.username = bb.username
-AND pwg.mail_address = bb.email
-;";
-
-      $result = pwg_query($query);
-    
-      while($row = pwg_db_fetch_assoc($result))
-      {
-        $msg_error_Link_Break .= '<br>'.l10n('New_Link').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')';
-  
-        FluxBB_Linkuser($row['pwg_id'], $row['bb_id']);
-      }
-  
-      if ($msg_error_Link_Break == '')
-        array_push($page['infos'], l10n('Sync_Link_Break').'<br>'.l10n('Sync_OK'));
-      else
-        $msg_error_Link_Break = l10n('Sync_Link_Break').$msg_error_Link_Break;
-  
-    
-      $query = "
-SELECT pwg.username as pwg_user, pwg.id as pwg_id, pwg.mail_address as pwg_mail, bb.id as bb_id, bb.username as bb_user, bb.email as bb_mail
-FROM ".FluxBB_USERS_TABLE." AS bb 
-INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = bb.id
-INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
-WHERE BINARY pwg.username <> BINARY bb.username
-;";
-
-      $result = pwg_query($query);
-    
-      while($row = pwg_db_fetch_assoc($result))
-      {
-        $msg_error_Link_Bad .= '<br>'.l10n('Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')';
-
-        $subquery = "
-DELETE FROM ".Register_FluxBB_ID_TABLE."
-WHERE id_user_pwg = ".$row['pwg_id']."
-AND id_user_FluxBB = ".$row['bb_id']."
-;";
-
-        $subresult = pwg_query($subquery);
-      }
-
-
-      $query = "
-SELECT COUNT(*) as nbr_dead
-FROM ".Register_FluxBB_ID_TABLE." AS Link
-WHERE id_user_FluxBB NOT IN (
-  SELECT id
-  FROM ".FluxBB_USERS_TABLE."
-  )
-OR id_user_pwg NOT IN (
-  SELECT id
-  FROM ".USERS_TABLE."
-  )
-;";
-
-      $Compteur = pwg_db_fetch_assoc(pwg_query($query));
-    
-      if ( !empty($Compteur) and $Compteur['nbr_dead'] > 0)
-      { 
-        $msg_error_Link_Bad .= '<br>'.l10n('Link_Dead').$Compteur['nbr_dead'];
-    
-        $query = "
-DELETE FROM ".Register_FluxBB_ID_TABLE."
-WHERE id_user_FluxBB NOT IN (
-  SELECT id
-  FROM ".FluxBB_USERS_TABLE."
-  )
-OR id_user_pwg NOT IN (
-  SELECT id
-  FROM ".USERS_TABLE."
-  )
-;";
-
-        $result = pwg_query($query);
-      }
-    
-      
-      $query = "
-SELECT COUNT(*) AS nbr_dup, pwg.id AS pwg_id, pwg.username AS pwg_user, bb.username AS bb_user, bb.id AS bb_id
-FROM ".FluxBB_USERS_TABLE." AS bb 
-INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = bb.id
-INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
-GROUP BY link.id_user_pwg, link.id_user_FluxBB
-HAVING COUNT(*) > 1
-;";
-
-      $result = pwg_query($query);
-    
-      while($row = pwg_db_fetch_assoc($result))
-      {
-        $msg_error_Link_Bad .= '<br>'.l10n('Link_Dup').$row['nbr_dup'].' = '.stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).')';
-  
-        FluxBB_Linkuser($row['pwg_id'], $row['bb_id']);
-      }
-
-      if ($msg_error_Link_Bad == '')
-        array_push($page['infos'], l10n('Sync_Link_Bad').'<br>'.l10n('Sync_OK'));
-      else
-        $msg_error_Link_Bad = l10n('Sync_Link_Bad').$msg_error_Link_Bad;
-  
-    
-      $query = "
-SELECT pwg.id as pwg_id, pwg.username as username, pwg.password as pwg_pwd, pwg.mail_address as pwg_eml, FluxBB.id as bb_id, FluxBB.password as bb_pwd, FluxBB.email as bb_eml
-FROM ".FluxBB_USERS_TABLE." AS FluxBB 
-INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = FluxBB.id
-INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
-AND BINARY pwg.username = BINARY FluxBB.username
-ORDER BY LOWER(pwg.username)
-;";
-
-      $result = pwg_query($query);
-    
-      while($row = pwg_db_fetch_assoc($result))
-      {
-        if ( ($row['pwg_pwd'] != $row['bb_pwd']) or ($row['pwg_eml'] != $row['bb_eml']) )
-        {
-          $msg_error_Synchro .= '<br>'.l10n('Sync_User').stripslashes($row['username']);
-  
-          $query = "
-SELECT id, username, password, mail_address 
-FROM ".USERS_TABLE."
-WHERE BINARY id = '".$row['pwg_id']."'
-;";
-
-          $data = pwg_db_fetch_assoc(pwg_query($query));
-        
-          if (!empty($data))
-            FluxBB_Updateuser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']);
-        }
-      }
-  
-      if ($msg_error_Synchro == '')
-        array_push($page['infos'], l10n('Sync_DataUser').'<br>'.l10n('Sync_OK'));
-      else
-        $msg_error_Synchro = l10n('Sync_DataUser').$msg_error_Synchro;
-
-  
-      $query = "
-SELECT username, mail_address FROM ".USERS_TABLE."
-WHERE BINARY username <> BINARY 'guest'
-AND id not in (
-  SELECT id_user_pwg FROM ".Register_FluxBB_ID_TABLE."
-  )
-AND BINARY username not in (
-  SELECT username FROM ".FluxBB_USERS_TABLE."
-  )
-ORDER BY LOWER(username)
-;";
-
-      $result = pwg_query($query);
-  
-      while($row = pwg_db_fetch_assoc($result))
-      {
-        $msg_error_PWG2FluxBB .= '<br>'.l10n('Add_User').stripslashes($row['username']).' ('.$row['mail_address'].')';
-
-        $query = "
-SELECT id, username, password, mail_address 
-FROM ".USERS_TABLE."
-WHERE BINARY username = BINARY '".$row['username']."'
-LIMIT 1
-;";
-
-        $data = pwg_db_fetch_assoc(pwg_query($query));
-      
-        if (!empty($data))
-          FluxBB_Adduser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']);  
-      }
-  
-      if ($msg_error_PWG2FluxBB == '')
-        array_push($page['infos'], l10n('Sync_PWG2FluxBB').'<br>'.l10n('Sync_OK'));
-      else
-        $msg_error_PWG2FluxBB = l10n('Sync_PWG2FluxBB').$msg_error_PWG2FluxBB;
-    
-  
-      $query = "
-SELECT id, username, email FROM ".FluxBB_USERS_TABLE."
-WHERE BINARY username <> BINARY '".$conf_Register_FluxBB[2]."'
-AND id not in (
-  SELECT id_user_FluxBB FROM ".Register_FluxBB_ID_TABLE."
-  )
-AND BINARY username not in (
-  SELECT username FROM ".USERS_TABLE."
-  )
-ORDER BY LOWER(username)
-;";
-
-      $result = pwg_query($query);
-  
-      while($row = pwg_db_fetch_assoc($result))
-      {
-        $msg_error_FluxBB2PWG .= '<br>'.l10n('Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')';
-  
-        $msg_error_FluxBB2PWG .= ' <a href="';
-      
-        $msg_error_FluxBB2PWG .= add_url_params($page_Register_FluxBB_admin, array(
-          'action' => 'del_user',
-          'id' => $row['id'],
-        ));
-
-        $msg_error_FluxBB2PWG .= '" title="'.l10n('Del_User').stripslashes($row['username']).'"';
-
-        $msg_error_FluxBB2PWG .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
-
-        $msg_error_FluxBB2PWG .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($row['username']).'" /></a>';
-      }
-  
-      if ($msg_error_FluxBB2PWG == '')
-        array_push($page['infos'], l10n('Sync_FluxBB2PWG').'<br>'.l10n('Sync_OK'));
-      else
-        $msg_error_FluxBB2PWG = l10n('Sync_FluxBB2PWG').$msg_error_FluxBB2PWG;
-    }
-    else
-      $errors[] = l10n('Advise_Check_Dup');
-
-
-    if ($msg_error_PWG_Dup <> '')
-      $errors[] = $msg_error_PWG_Dup . ( ($msg_error_FluxBB_Dup == '' and $msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
-  
-    if ($msg_error_FluxBB_Dup <> '')
-      $errors[] = $msg_error_FluxBB_Dup . ( ($msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
-
-    if ($msg_error_Link_Break <> '')
-      $errors[] = $msg_error_Link_Break . ( ($msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
-
-    if ($msg_error_Link_Bad <> '')
-      $errors[] = $msg_error_Link_Bad . ( ($msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
-
-    if ($msg_error_Synchro <> '')
-      $errors[] = $msg_error_Synchro . ( ($msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
-
-    if ($msg_error_PWG2FluxBB <> '')
-      $errors[] = $msg_error_PWG2FluxBB . ( ($msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
-
-    if ($msg_error_FluxBB2PWG <> '')
-      $errors[] = $msg_error_FluxBB2PWG;
-  }
-  else if ( isset($_POST['Audit']))
-  {
-    Audit_PWG_FluxBB();
-  }
-
-  $template->assign(
-    array
-    (
-      'REGFLUXBB_PATH'    => REGFLUXBB_PATH,
-      'REGFLUXBB_VERSION' => $version,
-    )
-  );
-
-  $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/synchro.tpl');
-  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');	
-
-	break;
-}
+if (function_exists('FindAvailableConfirmMailID'))
+{
+  $conf_UAM = unserialize($conf['UserAdvManager']);
+
+  if (isset($conf_UAM['CONFIRM_MAIL']) and ($conf_UAM['CONFIRM_MAIL'] == 'true' or $conf_UAM['CONFIRM_MAIL'] == 'local') and (isset($conf_UAM['NO_CONFIRM_GROUP']) and $conf_UAM['NO_CONFIRM_GROUP'] <> '-1'))
+  {
+    $UAM_bridge = true;
+  }
+  else $UAM_bridge = false;
+}
+
+// Save last opened paragraph in configuration tab
+// -----------------------------------------------
+$nb_para=(isset($_POST["nb_para"])) ? $_POST["nb_para"]:"";
+$nb_para2=(isset($_POST["nb_para2"])) ? $_POST["nb_para2"]:"";
+
+$themeconf=$template->get_template_vars('themeconf');
+$RFBB_theme=$themeconf['id'];
+
+$template->assign(
+  array
+  (
+    'nb_para'              => $nb_para,
+    'nb_para2'             => $nb_para2,
+    'REGFLUXBB_THEME'      => $RFBB_theme,
+    'REGFLUXBB_PATH'       => REGFLUXBB_PATH,
+    'REGFLUXBB_VERSION'    => $conf_Register_FluxBB['REGFLUXBB_VERSION'],
+    'FluxBB_PREFIX'        => $conf_Register_FluxBB['FLUXBB_PREFIX'],
+    'FluxBB_ADMIN'         => stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']),
+    'FluxBB_GUEST'         => stripslashes($conf_Register_FluxBB['FLUXBB_GUEST']),
+    'FluxBB_DEL_PT_TRUE'   => $conf_Register_FluxBB['FLUXBB_DEL_PT'] == 'true' ? 'checked="checked"' : '',
+    'FluxBB_DEL_PT_FALSE'  => $conf_Register_FluxBB['FLUXBB_DEL_PT'] == 'false' ? 'checked="checked"' : '',
+    'FluxBB_CONFIRM_TRUE'  => $conf_Register_FluxBB['FLUXBB_CONFIRM'] == 'true' ? 'checked="checked"' : '',
+    'FluxBB_CONFIRM_FALSE' => $conf_Register_FluxBB['FLUXBB_CONFIRM'] == 'false' ? 'checked="checked"' : '',
+    'FluxBB_DETAILS_TRUE'  => $conf_Register_FluxBB['FLUXBB_DETAIL'] == 'true' ? 'checked="checked"' : '',
+    'FluxBB_DETAILS_FALSE' => $conf_Register_FluxBB['FLUXBB_DETAIL'] == 'false' ? 'checked="checked"' : '',
+    'UAM_BRIDGE'           => $UAM_bridge,
+    'FluxBB_UAM_LINK_TRUE' => $conf_Register_FluxBB['FLUXBB_UAM_LINK'] == 'true' ? 'checked="checked"' : '',
+    'FluxBB_UAM_LINK_FALSE'=> $conf_Register_FluxBB['FLUXBB_UAM_LINK'] == 'false' ? 'checked="checked"' : '',
+    'FluxBB_GROUP'         => $conf_Register_FluxBB['FLUXBB_GROUP'],
+  )
+);
+
+$template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/admin.tpl');
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
 ?>
Index: /extensions/Register_FluxBB/admin/template/admin.tpl
===================================================================
--- /extensions/Register_FluxBB/admin/template/admin.tpl	(revision 21424)
+++ /extensions/Register_FluxBB/admin/template/admin.tpl	(revision 21424)
@@ -0,0 +1,218 @@
+{combine_script id='jquery' path='themes/default/js/jquery.min.js'}
+{combine_script id='jquery.cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'}
+
+{combine_css path= $REGFLUXBB_PATH|@cat:'admin/template/register_fluxbb.css'}
+{if $REGFLUXBB_THEME=='clear'}{combine_css path= $REGFLUXBB_PATH|@cat:'admin/template/themes/clear/theme.css'}{/if}
+{if $REGFLUXBB_THEME=='roma'}{combine_css path= $REGFLUXBB_PATH|@cat:'admin/template/themes/roma/theme.css'}{/if}
+{if $REGFLUXBB_THEME=='default'}{combine_css path= $REGFLUXBB_PATH|@cat:'admin/template/themes/default/theme.css'}{/if}
+
+{footer_script}{literal}
+jQuery().ready(function()
+{
+  jQuery('.cluetip').cluetip(
+  {
+    width: 550,
+    splitTitle: '|'
+  });
+});
+
+function blockToggleDisplay(headerId, contentId)
+{
+  var revHeader = document.getElementById(headerId);
+  var revContent = document.getElementById(contentId);
+
+  if (revContent.style.display == 'none')
+  {
+    revContent.style.display = 'block';
+    revHeader.className = 'instructionBlockHeaderExpanded';
+  }
+  else
+  {
+    revContent.style.display = 'none';
+    revHeader.className = 'instructionBlockHeaderCollapsed';
+  }
+}
+
+function rfbb_blockToggleDisplay( headerId, contentId )
+{
+  if (typeof(headerId)=='string')
+  {
+   if (headerId.length > 1)
+       blockToggleDisplay(headerId, contentId) ;
+      document.getElementById("nb_para").value =headerId ;
+      document.getElementById("nb_para2").value =contentId;
+  }
+}
+{/literal}{/footer_script}
+
+<div class="titrePage">
+  <h2>{'Title'|@translate} {$REGFLUXBB_VERSION}</h2>
+</div>
+
+<div id="instructionTips" class="instructionBlock" >
+  <div id="Instruction_header" class="instructionBlockHeaderCollapsed" onclick="rfbb_blockToggleDisplay('Instruction_header', 'Instructions')">
+    <span class="cluetip" title="{'Instruction_Title'|translate}|{'Instruction_Title_d'|translate}">
+      {'Instruction_Title'|@translate}
+    </span>
+  </div>
+  <div id="Instructions" class="instructionBlockContent" style="display:none">
+    <div style="text-align: left; margin-left: 1em; margin-right: 1em;">{'Disclaimer'|@translate}</div>
+
+    <div id="instructionConfig1" class="instructionBlock" >
+      <div id="config1_header" class="instructionBlockHeaderCollapsed" onclick="rfbb_blockToggleDisplay('config1_header', 'Config1')">
+      <span class="cluetip" title="{'About_Reg_Title'|translate}|{'About_Reg_Title_d'|translate}">
+        {'About_Reg_Title'|@translate}
+      </span>
+    </div>
+  
+    <div id="Config1" class="instructionBlockContent" style="display:none">
+      {'No_Reg_advise'|@translate}
+    </div>
+  </div>
+
+  <div id="instructionConfig2" class="instructionBlock" >
+    <div id="config2_header" class="instructionBlockHeaderCollapsed" onclick="rfbb_blockToggleDisplay('config2_header', 'Config2')">
+    <span class="cluetip" title="{'About_Bridge_Title'|translate}|{'About_Bridge_Title_d'|translate}">
+        {'About_Bridge_Title'|@translate}
+      </span>
+    </div>
+  
+    <div id="Config2" class="instructionBlockContent" style="display:none">
+      {'UAM_Bridge_advice'|@translate}
+    </div>
+  </div>
+  </div>
+</div>
+
+<form method="post" action="" class="general">
+<div id="instructionConfig" class="instructionBlock" >
+
+  <div id="config_header" class="instructionBlockHeaderCollapsed" onclick="rfbb_blockToggleDisplay('config_header', 'Config')">
+    <span class="cluetip" title="{'Config_Title'|translate}|{'Config_Title_d'|translate}">
+      {'Config_Title'|@translate}
+    </span>
+  </div>
+
+  <div id="Config" class="instructionBlockContent" style="display:none">
+
+  <p>
+    <input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}/>
+    <input name="nb_para" id="nb_para" type="text" value="{$nb_para}" style="display:none"/> 
+    <input name="nb_para2" id="nb_para2" type="text" value="{$nb_para2}" style="display:none"/> 
+  </p>
+
+  <fieldset>
+  	<legend>{'Config_Title'|@translate}</legend>
+    {'Config_Disclaimer'|@translate}
+    <br/><br/>
+    <fieldset>
+    <legend>{'Config_Title1'|@translate}</legend>
+    <ul>
+    	<li><label>{'Prefix'|@translate}</label><br/>
+    		<input type="text" name="FluxBB_prefix" value="{$FluxBB_PREFIX}" size="20" style="text-align: center;"/><br/>
+      <br/>
+    	</li>
+    	<li><label>{'Admin'|@translate}</label><br/>
+    		<input type="text" name="FluxBB_admin" value="{$FluxBB_ADMIN}" size="20" style="text-align: center;"/><br/>
+      <br/>
+    	</li>
+    	<li><label>{'Guest'|@translate}</label><br/>
+    		<input type="text" name="FluxBB_guest" value="{$FluxBB_GUEST}" size="20" style="text-align: center;"/><br/>
+      <br/>
+    	</li>
+    	<li><label>{'Del_Pt'|@translate}</label><br/>
+        <input type="radio" value="true" {$FluxBB_DEL_PT_TRUE} name="FluxBB_del_pt"/>{'Del_Pt_true'|@translate}<br/>
+        <input type="radio" value="false" {$FluxBB_DEL_PT_FALSE} name="FluxBB_del_pt"/>{'Del_Pt_false'|@translate}<br/>
+      <br/>
+    	</li>
+      {if $UAM_BRIDGE}
+    	<li><label>{'Bridge_UAM'|@translate}</label><br/>
+        <input type="radio" value="true" {$FluxBB_UAM_LINK_TRUE} name="FluxBB_UAM"/>{'Bridge_UAM_true'|@translate}<br/>
+        <input type="radio" value="false" {$FluxBB_UAM_LINK_FALSE} name="FluxBB_UAM"/>{'Bridge_UAM_false'|@translate}<br/>
+      <br/>
+      </li>
+    	<li><label>{'FluxBB_Group'|@translate}</label><br/>
+    		<input type="text" name="FluxBB_group" value="{$FluxBB_GROUP}" size="6" style="text-align: center;"/><br/>
+    	</li>
+      {/if}
+    </ul>
+    <br/>
+  </fieldset>
+  <fieldset>
+  <legend>{'Config_Title2'|@translate}</legend>
+  <ul>
+    <li><label>{'Details'|@translate}</label><br/>
+      <input type="radio" value="true" {$FluxBB_DETAILS_TRUE} name="FluxBB_details"/>{'Details_true'|@translate}<br/>
+      <input type="radio" value="false" {$FluxBB_DETAILS_FALSE} name="FluxBB_details"/>{'Details_false'|@translate}<br/>
+    <br/>
+    </li>
+    <li><label>{'Confirm'|@translate}</label><br/>
+      <input type="radio" value="true" {$FluxBB_CONFIRM_TRUE} name="FluxBB_confirm"/>{'Confirm_true'|@translate}<br/>
+      <input type="radio" value="false" {$FluxBB_CONFIRM_FALSE} name="FluxBB_confirm"/>{'Confirm_false'|@translate}<br/>
+    <br/>
+    </li>
+  </ul>
+  </fieldset>
+  <p>
+    <input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}/>
+  </p>
+
+  </div>
+</div>
+</form>
+
+
+<form method="post" action="" class="general">
+<div id="instructionMigrate" class="instructionBlock" >
+
+  <div id="migrate_header" class="instructionBlockHeaderCollapsed" onclick="rfbb_blockToggleDisplay('migrate_header', 'Migrate')">
+    <span class="cluetip" title="{'Mig_Title'|translate}|{'Mig_Title_d'|translate}">
+      {'Mig_Title'|@translate}
+    </span>
+  </div>
+
+  <div id="Migrate" class="instructionBlockContent" style="display:none">
+  <fieldset>
+  	{'Mig_Text'|@translate}
+    <br/>
+  	<p>
+      <input class="submit" type="submit" value="{'Audit_Btn'|@translate}" name="Audit"/>&nbsp;
+      <input onclick="return confirm('{'Are you sure?'|@translate}');" class="submit" type="submit" value="{'Mig_Btn'|@translate}" name="Migration" {$TAG_INPUT_ENABLED}/>
+      <input name="nb_para" id="nb_para" type="text" value="{$nb_para}" style="display:none"/>
+      <input name="nb_para2" id="nb_para2" type="text" value="{$nb_para2}" style="display:none"/>
+    </p>
+  </fieldset>
+  </div>
+</div>
+</form>
+
+
+<form method="post" action="" class="general">
+<div id="instructionSynch" class="instructionBlock" >
+  <div id="synch_header" class="instructionBlockHeaderCollapsed" onclick="rfbb_blockToggleDisplay('synch_header', 'Synch')">
+    <span class="cluetip" title="{'Sync_Title'|translate}|{'Sync_Title_d'|translate}">
+      {'Sync_Title'|@translate}
+    </span>
+  </div>
+
+  <div id="Synch" class="instructionBlockContent" style="display:none">
+  <fieldset>
+  	{'Sync_Text'|@translate}
+    <br/>
+  	<p>
+      <input class="submit" type="submit" value="{'Audit_Btn'|@translate}" name="Audit"/>&nbsp;
+      <input onclick="return confirm('{'Are you sure?'|@translate}');" class="submit" type="submit" value="{'Sync_Btn'|@translate}" name="Synchro" {$TAG_INPUT_ENABLED}/>
+      <input name="nb_para" id="nb_para" type="text" value="{$nb_para}" style="display:none"/>
+      <input name="nb_para2" id="nb_para2" type="text" value="{$nb_para2}" style="display:none"/>
+    </p>
+  </fieldset>
+  </div>
+</div>
+</form>
+
+
+{footer_script}{literal}
+  var n1=document.getElementById("nb_para").value;
+  var n2=document.getElementById("nb_para2").value;
+   rfbb_blockToggleDisplay(n1,n2);
+{/literal}{/footer_script}
Index: tensions/Register_FluxBB/admin/template/info.tpl
===================================================================
--- /extensions/Register_FluxBB/admin/template/info.tpl	(revision 21423)
+++ 	(revision )
@@ -1,7 +1,0 @@
-{combine_css path= $REGFLUXBB_PATH|@cat:'admin/template/register_fluxbb.css'}
-
-<div class="titrePage">
-  <h2>{'Title_Tab'|@translate} {$REGFLUXBB_VERSION}<br>{'Tab_Info'|@translate}</h2>
-</div>
-
-<div style="text-align: left; margin-left: 1em; margin-right: 1em;">{'Disclaimer'|@translate}</div>
Index: tensions/Register_FluxBB/admin/template/manage.tpl
===================================================================
--- /extensions/Register_FluxBB/admin/template/manage.tpl	(revision 21423)
+++ 	(revision )
@@ -1,105 +1,0 @@
-{combine_css path= $REGFLUXBB_PATH|@cat:'admin/template/register_fluxbb.css'}
-
-<script type="text/javascript">
-function blockToggleDisplay(headerId, contentId)
-{ldelim}
-  var revHeader = document.getElementById(headerId);
-  var revContent = document.getElementById(contentId);
-
-  if (revContent.style.display == 'none')
-  {ldelim}
-    revContent.style.display = 'block';
-    revHeader.className = 'instructionBlockHeaderExpanded';
-  {rdelim}
-  else
-  {ldelim}
-    revContent.style.display = 'none';
-    revHeader.className = 'instructionBlockHeaderCollapsed';
-  {rdelim}
-{rdelim}
-
-function rfbb_blockToggleDisplay( headerId, contentId )
-{ldelim}
-  if (typeof(headerId)=='string')
-  {ldelim}
-   if ( headerId.length>  1)
-       blockToggleDisplay(headerId, contentId) ;
-      document.getElementById("nb_para").value =headerId ;
-      document.getElementById("nb_para2").value =contentId;
-  {rdelim}
-{rdelim}
-</script>
-
-<div class="titrePage">
-  <h2>{'Title_Tab'|@translate} {$REGFLUXBB_VERSION}<br>{'Tab_Manage'|@translate}</h2>
-</div>
-
-<form method="post" action="">
-  <fieldset>
-  	<legend>{'Config_Title'|@translate}</legend>
-    {'Config_Disclaimer'|@translate}
-    <br><br>
-    <ul>
-    	<li><label>{'Prefix'|@translate}</label><br>
-    		<input type="text" name="FluxBB_prefix" value={$FluxBB_PREFIX} size="20" style="text-align: center;"><br>
-      <br>
-    	</li>
-    	<li><label>{'Admin'|@translate}</label><br>
-    		<input type="text" name="FluxBB_admin" value={$FluxBB_ADMIN} size="20" style="text-align: center;"><br>
-      <br>
-    	</li>
-    	<li><label>{'Guest'|@translate}</label><br>
-    		<input type="text" name="FluxBB_guest" value={$FluxBB_GUEST} size="20" style="text-align: center;"><br>
-      <br>
-    	</li>
-    	<li><label>{'Del_Pt'|@translate}</label><br>
-        <input type="radio" value="true" {$FluxBB_DEL_PT_TRUE} name="FluxBB_del_pt">{'Del_Pt_true'|@translate}<br>
-        <input type="radio" value="false" {$FluxBB_DEL_PT_FALSE} name="FluxBB_del_pt">{'Del_Pt_false'|@translate}<br>
-      <br>
-    	</li>
-    	<li><label>{'Confirm'|@translate}</label><br>
-        <input type="radio" value="true" {$FluxBB_CONFIRM_TRUE} name="FluxBB_confirm">{'Confirm_true'|@translate}<br>
-        <input type="radio" value="false" {$FluxBB_CONFIRM_FALSE} name="FluxBB_confirm">{'Confirm_false'|@translate}<br>
-      <br>
-    	</li>
-    	<li><label>{'Details'|@translate}</label><br>
-        <input type="radio" value="true" {$FluxBB_DETAILS_TRUE} name="FluxBB_details">{'Details_true'|@translate}<br>
-        <input type="radio" value="false" {$FluxBB_DETAILS_FALSE} name="FluxBB_details">{'Details_false'|@translate}<br>
-      <br>
-    	</li>
-      {if $UAM_BRIDGE}
-    	<li><label>{'Bridge_UAM'|@translate}</label><br>
-        <input type="radio" value="true" {$FluxBB_UAM_LINK_TRUE} name="FluxBB_UAM">{'Bridge_UAM_true'|@translate}<br>
-        <input type="radio" value="false" {$FluxBB_UAM_LINK_FALSE} name="FluxBB_UAM">{'Bridge_UAM_false'|@translate}<br>
-      <br>
-      </li>
-    	<li><label>{'FluxBB_Group'|@translate}</label><br>
-    		<input type="text" name="FluxBB_group" value={$FluxBB_GROUP} size="6" style="text-align: center;"><br>
-    	</li>
-      {/if}
-    </ul>
-    <br>
-  	<div align="center"><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}></div>
-  </fieldset>
-
-  <div id="instructionConfig1" class="instructionBlock" >
-    <div id="config1_header" class="instructionBlockHeaderCollapsed" onclick="rfbb_blockToggleDisplay('config1_header', 'Config1')">
-        {'About_Reg'|@translate}
-      </span>
-    </div>
-  
-    <div id="Config1" class="instructionBlockContent" style="display:none">
-      {'No_Reg_advise'|@translate}
-    </div>
-  </div>
-  <div id="instructionConfig2" class="instructionBlock" >
-    <div id="config2_header" class="instructionBlockHeaderCollapsed" onclick="rfbb_blockToggleDisplay('config2_header', 'Config2')">
-        {'About_Bridge'|@translate}
-      </span>
-    </div>
-  
-    <div id="Config2" class="instructionBlockContent" style="display:none">
-      {'UAM_Bridge_advice'|@translate}
-    </div>
-  </div>
-</form>
Index: tensions/Register_FluxBB/admin/template/migration.tpl
===================================================================
--- /extensions/Register_FluxBB/admin/template/migration.tpl	(revision 21423)
+++ 	(revision )
@@ -1,16 +1,0 @@
-{combine_css path= $REGFLUXBB_PATH|@cat:'admin/template/register_fluxbb.css'}
-
-<div class="titrePage">
-  <h2>{'Title_Tab'|@translate} {$REGFLUXBB_VERSION}<br>{'Tab_Migration'|@translate}</h2>
-</div>
-
-<form method="post" action="">
-  <fieldset>
-  	<legend>{'Mig_Title'|@translate}</legend>
-  	{'Mig_Text'|@translate}
-    <br>
-  	<p><input onclick="return confirm('{'Are you sure?'|@translate}');" class="submit" type="submit" value="{'Mig_Btn'|@translate}" name="Migration" {$TAG_INPUT_ENABLED}></p>
-    <br>
-  	{'Mig_Disclaimer'|@translate}
-  </fieldset>
-</form>
Index: tensions/Register_FluxBB/admin/template/synchro.tpl
===================================================================
--- /extensions/Register_FluxBB/admin/template/synchro.tpl	(revision 21423)
+++ 	(revision )
@@ -1,14 +1,0 @@
-{combine_css path= $REGFLUXBB_PATH|@cat:'admin/template/register_fluxbb.css'}
-
-<div class="titrePage">
-  <h2>{'Title_Tab'|@translate} {$REGFLUXBB_VERSION}<br>{'Tab_Synchro'|@translate}</h2>
-</div>
-
-<form method="post" action="">
-  <fieldset>
-  	<legend>{'Sync_Title'|@translate}</legend>
-  	{'Sync_Text'|@translate}
-    <br>
-  	<p><input {$FluxBB_CONFIRM_ENABLE} class="submit" type="submit" value="{'Audit_Btn'|@translate}" name="Audit"> <input onclick="return confirm('{'Are you sure?'|@translate}');" {$FluxBB_CONFIRM_ENABLE} class="submit" type="submit" value="{'Sync_Btn'|@translate}" name="Synchro" {$TAG_INPUT_ENABLED}></p>
-  </fieldset>
-</form>
Index: /extensions/Register_FluxBB/admin/template/themes/clear/theme.css
===================================================================
--- /extensions/Register_FluxBB/admin/template/themes/clear/theme.css	(revision 21424)
+++ /extensions/Register_FluxBB/admin/template/themes/clear/theme.css	(revision 21424)
@@ -0,0 +1,40 @@
+/* Bloc expand-collapse instructions */
+.instructionBlock
+{
+  border: 1px solid #999;
+  margin: 5px;
+  overflow: hidden;
+}
+
+.instructionBlockHeaderCollapsed, .instructionBlockHeaderExpanded
+{
+  background-color: #eee;
+  background-position: 15px center;
+  background-repeat: no-repeat;
+  color: #999;
+  cursor: pointer;
+  font-size: 110%;
+  overflow: hidden;
+  padding: 8px 41px;
+  text-align: left;
+}
+
+.instructionBlockHeaderCollapsed span, .instructionBlockHeaderExpanded span
+{
+  border-bottom: none;
+}
+
+.instructionBlockHeaderCollapsed
+{
+  background-image: url(expand.gif);
+}
+
+.instructionBlockHeaderExpanded
+{
+  background-image: url(collapse.gif);
+}
+
+.instructionBlockContent
+{
+  padding: 0 15px 15px;
+}
Index: /extensions/Register_FluxBB/admin/template/themes/default/theme.css
===================================================================
--- /extensions/Register_FluxBB/admin/template/themes/default/theme.css	(revision 21424)
+++ /extensions/Register_FluxBB/admin/template/themes/default/theme.css	(revision 21424)
@@ -0,0 +1,40 @@
+﻿/* Bloc expand-collapse instructions */
+.instructionBlock
+{
+  border: 1px solid #666;
+  margin: 5px;
+  overflow: hidden;
+}
+
+.instructionBlockHeaderCollapsed, .instructionBlockHeaderExpanded
+{
+  background-color: #111;
+  background-position: 15px center;
+  background-repeat: no-repeat;
+  color: #ff3363;
+  cursor: pointer;
+  font-size: 110%;
+  overflow: hidden;
+  padding: 8px 41px;
+  text-align: left;
+}
+
+.instructionBlockHeaderCollapsed span, .instructionBlockHeaderExpanded span
+{
+  border-bottom: none;
+}
+
+.instructionBlockHeaderCollapsed
+{
+  background-image: url(expand.gif);
+}
+
+.instructionBlockHeaderExpanded
+{
+  background-image: url(collapse.gif);
+}
+
+.instructionBlockContent
+{
+  padding: 0 15px 15px;
+}
Index: /extensions/Register_FluxBB/admin/template/themes/roma/theme.css
===================================================================
--- /extensions/Register_FluxBB/admin/template/themes/roma/theme.css	(revision 21424)
+++ /extensions/Register_FluxBB/admin/template/themes/roma/theme.css	(revision 21424)
@@ -0,0 +1,40 @@
+﻿/* Bloc expand-collapse instructions */
+.instructionBlock
+{
+  border: 1px solid #666;
+  margin: 5px;
+  overflow: hidden;
+}
+
+.instructionBlockHeaderCollapsed, .instructionBlockHeaderExpanded
+{
+  background-color: #111;
+  background-position: 15px center;
+  background-repeat: no-repeat;
+  color: #ff3363;
+  cursor: pointer;
+  font-size: 110%;
+  overflow: hidden;
+  padding: 8px 41px;
+  text-align: left;
+}
+
+.instructionBlockHeaderCollapsed span, .instructionBlockHeaderExpanded span
+{
+  border-bottom: none;
+}
+
+.instructionBlockHeaderCollapsed
+{
+  background-image: url(expand.gif);
+}
+
+.instructionBlockHeaderExpanded
+{
+  background-image: url(collapse.gif);
+}
+
+.instructionBlockContent
+{
+  padding: 0 15px 15px;
+}
Index: /extensions/Register_FluxBB/include/constants.php
===================================================================
--- /extensions/Register_FluxBB/include/constants.php	(revision 21423)
+++ /extensions/Register_FluxBB/include/constants.php	(revision 21424)
@@ -3,15 +3,12 @@
 global $prefixeTable, $conf;
 
-$conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+$conf_Register_FluxBB = unserialize($conf['Register_FluxBB']);
 
 define('Register_FluxBB_ID_TABLE', $prefixeTable.'Register_FluxBB_id');
+define('FluxBB_CONFIG_TABLE', $conf_Register_FluxBB['FLUXBB_PREFIX'].'config');
+define('FluxBB_USERS_TABLE', $conf_Register_FluxBB['FLUXBB_PREFIX'].'users');
+define('FluxBB_POSTS_TABLE', $conf_Register_FluxBB['FLUXBB_PREFIX'].'posts');
+define('FluxBB_TOPICS_TABLE', $conf_Register_FluxBB['FLUXBB_PREFIX'].'topics');
+define('FluxBB_SUBSCRIPTIONS_TABLE', $conf_Register_FluxBB['FLUXBB_PREFIX'].'topic_subscriptions');
 
-if (isset($conf_Register_FluxBB[0]))
-{
-  define('FluxBB_CONFIG_TABLE', $conf_Register_FluxBB[0].'config');
-  define('FluxBB_USERS_TABLE', $conf_Register_FluxBB[0].'users');
-  define('FluxBB_POSTS_TABLE', $conf_Register_FluxBB[0].'posts');
-  define('FluxBB_TOPICS_TABLE', $conf_Register_FluxBB[0].'topics');
-  define('FluxBB_SUBSCRIPTIONS_TABLE', $conf_Register_FluxBB[0].'topic_subscriptions');
-}
 ?>
Index: /extensions/Register_FluxBB/include/functions.inc.php
===================================================================
--- /extensions/Register_FluxBB/include/functions.inc.php	(revision 21423)
+++ /extensions/Register_FluxBB/include/functions.inc.php	(revision 21424)
@@ -3,4 +3,396 @@
 include_once (PHPWG_ROOT_PATH.'/include/constants.php');
 include_once (REGFLUXBB_PATH.'include/constants.php');
+
+
+function Audit_PWG_FluxBB()
+{
+  global $page, $conf, $errors;
+
+  $page_Register_FluxBB_admin = get_admin_plugin_menu_link(__FILE__);
+
+  $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']);
+
+  $msg_error_PWG_Dup = '';
+  $msg_error_FluxBB_Dup = '';
+  $msg_error_Link_Break = '';
+  $msg_error_Link_Bad = '';
+  $msg_error_Synchro = '';
+  $msg_ok_Synchro = '';
+  $msg_error_PWG2FluxBB = '';
+  $msg_error_FluxBB2PWG = '';
+
+  $query = '
+SELECT COUNT(*) AS nbr_dup, id, username
+FROM '.USERS_TABLE.'
+WHERE username NOT IN ("18","16")
+GROUP BY BINARY username
+HAVING COUNT(*) > 1
+;';
+  $result = pwg_query($query);
+  
+  while($row = pwg_db_fetch_assoc($result))
+    $msg_error_PWG_Dup .= '<br>'.l10n('Error_PWG_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']);
+
+  if ($msg_error_PWG_Dup == '')
+    array_push($page['infos'], l10n('Audit_PWG_Dup').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_PWG_Dup = l10n('Audit_PWG_Dup').$msg_error_PWG_Dup.'<br>'.l10n('Advise_PWG_Dup');
+  
+
+
+  $query = '
+SELECT COUNT(*) AS nbr_dup, username
+FROM '.FluxBB_USERS_TABLE.' 
+GROUP BY BINARY username
+HAVING COUNT(*) > 1
+;';
+  $result = pwg_query($query);
+  
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    $msg_error_FluxBB_Dup .= '<br>'.l10n('Error_FluxBB_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']);
+
+    $subquery = '
+SELECT id, username, email
+FROM '.FluxBB_USERS_TABLE.' 
+WHERE BINARY username = BINARY "'.$row['username'].'"
+;';
+    $subresult = pwg_query($subquery);
+  
+    while($subrow = pwg_db_fetch_assoc($subresult))
+    {
+      $msg_error_FluxBB_Dup .= '<br>id:'.$subrow['id'].'='.stripslashes($subrow['username']).' ('.$subrow['email'].')';
+  
+      $msg_error_FluxBB_Dup .= ' <a href="';
+      
+      $msg_error_FluxBB_Dup .= add_url_params($page_Register_FluxBB_admin, array(
+        'action' => 'del_user',
+        'id' => $subrow['id'],
+      ));
+        
+      $msg_error_FluxBB_Dup .= '" title="'.l10n('Del_User').stripslashes($subrow['username']).'"';
+        
+      $msg_error_FluxBB_Dup .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+        
+      $msg_error_FluxBB_Dup .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').$subrow['username'].'" /></a>';
+    }
+  }
+
+  if ($msg_error_FluxBB_Dup == '')
+    array_push($page['infos'], l10n('Audit_FluxBB_Dup').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_FluxBB_Dup = l10n('Audit_FluxBB_Dup').$msg_error_FluxBB_Dup.'<br>'.l10n('Advise_FluxBB_Dup');
+  
+
+
+  $query = '
+SELECT pwg.id as pwg_id, bb.id as bb_id, pwg.username as pwg_user, pwg.mail_address as pwg_mail
+FROM '.FluxBB_USERS_TABLE.' AS bb, '.USERS_TABLE.' as pwg
+WHERE bb.id NOT in (
+  SELECT id_user_FluxBB
+  FROM '.Register_FluxBB_ID_TABLE.'
+  )
+AND pwg.id NOT in (
+  SELECT id_user_pwg
+  FROM '.Register_FluxBB_ID_TABLE.'
+  )
+AND pwg.username = bb.username
+AND pwg.username NOT IN ("18","16")
+AND pwg.mail_address = bb.email
+;';
+
+  $result = pwg_query($query);
+  
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    $msg_error_Link_Break .= '<br>'.l10n('Error_Link_Break').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')';
+
+    $msg_error_Link_Break .= ' <a href="';
+  
+    $msg_error_Link_Break .= add_url_params($page_Register_FluxBB_admin, array(
+      'action'   => 'new_link',
+      'pwg_id' => $row['pwg_id'],
+      'bb_id' => $row['bb_id'],
+    ));
+
+    $msg_error_Link_Break .= '" title="'.l10n('New_Link').stripslashes($row['pwg_user']).'"';
+
+    $msg_error_Link_Break .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+    $msg_error_Link_Break .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_break.png" alt="'.l10n('New_Link').stripslashes($row['pwg_user']).'" /></a>';
+  }
+
+  if ($msg_error_Link_Break == '')
+    array_push($page['infos'], l10n('Audit_Link_Break').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_Link_Break = l10n('Audit_Link_Break').$msg_error_Link_Break;
+    
+
+  
+  $query = '
+SELECT pwg.username as pwg_user, pwg.id as pwg_id, pwg.mail_address as pwg_mail, bb.id as bb_id, bb.username as bb_user, bb.email as bb_mail
+FROM '.FluxBB_USERS_TABLE.' AS bb 
+INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = bb.id
+INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id
+WHERE pwg.username <> bb.username
+AND pwg.username NOT IN ("18","16")
+;';
+
+  $result = pwg_query($query);
+  
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')';
+
+    $msg_error_Link_Bad .= ' <a href="';
+  
+    $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array(
+      'action'   => 'link_del',
+      'pwg_id' => $row['pwg_id'],
+      'bb_id'  => $row['bb_id'],
+    ));
+
+    $msg_error_Link_Bad .= '" title="'.l10n('Link_Del').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'"';
+
+    $msg_error_Link_Bad .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+    $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_delete.png" alt="'.l10n('Link_Del').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'" /></a>';
+
+    $msg_error_Link_Bad .= ' -- <a href="';
+
+    $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array(
+      'action' => 'sync_user',
+      'username' => stripslashes($row['pwg_user']),
+    ));
+
+    $msg_error_Link_Bad .= '" title="'.l10n('Sync_User').stripslashes($row['pwg_user']).' --> '.stripslashes($row['bb_user']).'"';
+
+    $msg_error_Link_Bad .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+    $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/arrow_switch.png" alt="'.l10n('Sync_User').stripslashes($row['pwg_user']).' --> '.stripslashes($row['bb_user']).'" /></a>';
+  }
+
+
+  $query = '
+SELECT COUNT(*) as nbr_dead
+FROM '.Register_FluxBB_ID_TABLE.' AS Link
+WHERE id_user_FluxBB NOT IN (
+  SELECT id
+  FROM '.FluxBB_USERS_TABLE.'
+  )
+OR id_user_pwg NOT IN (
+  SELECT id
+  FROM '.USERS_TABLE.'
+  )
+;';
+
+  $Compteur = pwg_db_fetch_assoc(pwg_query($query));
+
+  if (!empty($Compteur) and $Compteur['nbr_dead'] > 0)
+  { 
+    $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Dead').$Compteur['nbr_dead'];
+
+    $msg_error_Link_Bad .= ' <a href="';
+
+    $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array(
+      'action'   => 'link_dead',
+    ));
+
+    $msg_error_Link_Bad .= '" title="'.l10n('Link_Dead').$Compteur['nbr_dead'].'"';
+
+    $msg_error_Link_Bad .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+    $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_delete.png" alt="'.l10n('Link_Dead').$Compteur['nbr_dead'].'" /></a>';
+  }
+
+  $query = '
+SELECT COUNT(*) AS nbr_dup, pwg.id AS pwg_id, pwg.username AS pwg_user, bb.username AS bb_user, bb.id AS bb_id
+FROM '.FluxBB_USERS_TABLE.' AS bb 
+INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = bb.id
+INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id
+WHERE pwg.username NOT IN ("18","16")
+GROUP BY link.id_user_pwg, link.id_user_FluxBB
+HAVING COUNT(*) > 1
+;';
+
+  $result = pwg_query($query);
+  
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Dup').$row['nbr_dup'].' = '.stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).')';
+
+    $msg_error_Link_Bad .= ' <a href="';
+
+    $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array(
+      'action'   => 'new_link',
+      'pwg_id' => $row['pwg_id'],
+      'bb_id' => $row['bb_id'],
+    ));
+
+    $msg_error_Link_Bad .= '" title="'.l10n('Link_Dup').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'"';
+
+    $msg_error_Link_Bad .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+    $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_error.png" alt="'.l10n('Link_Dup').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'" /></a>';
+  }
+
+  if ($msg_error_Link_Bad == '')
+    array_push($page['infos'], l10n('Audit_Link_Bad').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_Link_Bad = l10n('Audit_Link_Bad').$msg_error_Link_Bad;
+    
+
+  
+  $query = '
+SELECT pwg.username as username, pwg.password as pwg_pwd, pwg.mail_address as pwg_eml, FluxBB.password as bb_pwd, FluxBB.email as bb_eml
+FROM '.FluxBB_USERS_TABLE.' AS FluxBB 
+INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = FluxBB.id
+INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id
+WHERE BINARY pwg.username = BINARY FluxBB.username
+AND pwg.username NOT IN ("18","16")
+ORDER BY LOWER(pwg.username)
+;';
+
+  $result = pwg_query($query);
+  
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    if ( ($row['pwg_pwd'] != $row['bb_pwd']) or ($row['pwg_eml'] != $row['bb_eml']) )
+    {
+      $msg_error_Synchro .= '<br>'.l10n('Error_Synchro').stripslashes($row['username']);
+
+      $msg_error_Synchro .= ' <a href="';
+
+      $msg_error_Synchro .= add_url_params($page_Register_FluxBB_admin, array(
+        'action' => 'sync_user',
+        'username' => stripslashes($row['username']),
+      ));
+
+      $msg_error_Synchro .= '" title="'.l10n('Sync_User').stripslashes($row['username']).'"';
+
+      $msg_error_Synchro .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+      $msg_error_Synchro .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_refresh.png" alt="'.l10n('Sync_User').stripslashes($row['username']).'" /></a>';
+
+      if ($row['pwg_pwd'] != $row['bb_pwd'])
+        $msg_error_Synchro .= '<br>'.l10n('Error_Synchro_Pswd');
+
+      if ($row['pwg_eml'] != $row['bb_eml'])
+        $msg_error_Synchro .= '<br>'.l10n('Error_Synchro_Mail').'<br>-- PWG = '.$row['pwg_eml'].'<br>-- FluxBB = '.$row['bb_eml'];
+    }
+    else if ($conf_Register_FluxBB['FLUXBB_DETAIL'] == 'true')
+      $msg_ok_Synchro .= '<br> - '.stripslashes($row['username']).' ('.$row['pwg_eml'].')'.l10n('Audit_Synchro_OK');
+  }
+
+  if ($msg_error_Synchro <> '')
+    $msg_error_Synchro = l10n('Audit_Synchro').$msg_error_Synchro;
+    
+  if ($msg_ok_Synchro <> '')
+    if ($msg_error_Synchro <> '')
+      array_push($page['infos'], l10n('Audit_Synchro').$msg_ok_Synchro.'<br><br>');
+    else
+      array_push($page['infos'], l10n('Audit_Synchro').$msg_ok_Synchro.'<br><br>'.l10n('Audit_OK'));
+
+
+  $query = '
+SELECT username, mail_address FROM '.USERS_TABLE.'
+WHERE BINARY username <> BINARY "guest"
+AND username NOT IN ("18","16")
+AND id not in (
+  SELECT id_user_pwg FROM '.Register_FluxBB_ID_TABLE.'
+  )
+AND BINARY username not in (
+  SELECT username FROM '.FluxBB_USERS_TABLE.'
+  )
+ORDER BY LOWER(username)
+;';
+
+  $result = pwg_query($query);
+
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    $msg_error_PWG2FluxBB .= '<br>'.l10n('Error_PWG2FluxBB').stripslashes($row['username']).' ('.$row['mail_address'].')';
+
+    $msg_error_PWG2FluxBB .= ' <a href="';
+
+    $msg_error_PWG2FluxBB .= add_url_params($page_Register_FluxBB_admin, array(
+      'action' => 'add_user',
+      'username' => stripslashes($row['username']),
+    ));
+
+    $msg_error_PWG2FluxBB .= '" title="'.l10n('Add_User').stripslashes($row['username']).'" ';
+
+    $msg_error_PWG2FluxBB .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+    $msg_error_PWG2FluxBB .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_add.png" alt="'.l10n('Add_User').stripslashes($row['username']).'" /></a>';
+  }
+
+  if ($msg_error_PWG2FluxBB == '')
+    array_push($page['infos'], l10n('Audit_PWG2FluxBB').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_PWG2FluxBB = l10n('Audit_PWG2FluxBB').$msg_error_PWG2FluxBB;
+
+  
+
+  $query = '
+SELECT id, username, email FROM '.FluxBB_USERS_TABLE.'
+WHERE BINARY username <> BINARY "'.$conf_Register_FluxBB['FLUXBB_GUEST'].'"
+AND id not in (
+  SELECT id_user_FluxBB FROM '.Register_FluxBB_ID_TABLE.'
+  )
+AND BINARY username not in (
+  SELECT username FROM '.USERS_TABLE.'
+  )
+ORDER BY LOWER(username)
+;';
+
+  $result = pwg_query($query);
+
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    $msg_error_FluxBB2PWG .= '<br>'.l10n('Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')';
+
+    $msg_error_FluxBB2PWG .= ' <a href="';
+
+    $msg_error_FluxBB2PWG .= add_url_params($page_Register_FluxBB_admin, array(
+      'action' => 'del_user',
+      'id' => $row['id'],
+    ));
+
+    $msg_error_FluxBB2PWG .= '" title="'.l10n('Del_User').stripslashes($row['username']).'"';
+
+    $msg_error_FluxBB2PWG .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+    $msg_error_FluxBB2PWG .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($row['username']).'" /></a>';
+  }
+
+  if ($msg_error_FluxBB2PWG == '')
+    array_push($page['infos'], l10n('Audit_FluxBB2PWG').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_FluxBB2PWG = l10n('Audit_FluxBB2PWG').$msg_error_FluxBB2PWG;
+
+
+
+  if ($msg_error_PWG_Dup <> '')
+    $errors[] = $msg_error_PWG_Dup . ( ($msg_error_FluxBB_Dup == '' and $msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
+  
+  if ($msg_error_FluxBB_Dup <> '')
+    $errors[] = $msg_error_FluxBB_Dup . ( ($msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
+
+  if ($msg_error_Link_Break <> '')
+    $errors[] = $msg_error_Link_Break . ( ($msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
+
+  if ($msg_error_Link_Bad <> '')
+    $errors[] = $msg_error_Link_Bad . ( ($msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
+
+  if ($msg_error_Synchro <> '')
+    $errors[] = $msg_error_Synchro . ( ($msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
+
+  if ($msg_error_PWG2FluxBB <> '')
+    $errors[] = $msg_error_PWG2FluxBB . ( ($msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
+
+  if ($msg_error_FluxBB2PWG <> '')
+    $errors[] = $msg_error_FluxBB2PWG;
+}
 
 
@@ -47,4 +439,5 @@
 FROM '.USERS_TABLE.'
 WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+AND '.$conf['user_fields']['username'].' NOT IN ("18","16")
 ;';
 
@@ -61,5 +454,5 @@
   global $conf, $user;
   
-  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+  $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']);
   
   // Check if UAM is installed and if bridge is set - Exception for admins and webmasters
@@ -73,12 +466,12 @@
   if ($data['status'] <> "admin" and $data['status'] <> "webmaster")
   {
-    if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true')
+    if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB['FLUXBB_UAM_LINK']) and $conf_Register_FluxBB['FLUXBB_UAM_LINK'] == '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')
+      if (isset($conf_UAM['NO_CONFIRM_GROUP']) and $conf_UAM['NO_CONFIRM_GROUP'] != '-1')
       {
-        $Waitingroup = $conf_UAM[2];
+        $Waitingroup = $conf_UAM['NO_CONFIRM_GROUP'];
       }
       else
@@ -104,28 +497,28 @@
 
       // Check if logged in user is in a FluxBB's unvalidated group
-      $query = "
+      $query = '
 SELECT group_id
-FROM ".FluxBB_USERS_TABLE."
-WHERE id = ".FluxBB_Searchuser($user['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])
+      // Logged in user switch to the default FluxBB's group if he is validated
+      if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB['FLUXBB_GROUP'])
       {
-        $query = "
+        $query = '
 SELECT conf_value
-FROM ".FluxBB_CONFIG_TABLE."
-WHERE conf_name = 'o_default_user_group'
-;";
+FROM '.FluxBB_CONFIG_TABLE.'
+WHERE conf_name = "o_default_user_group"
+;';
 
         $o_user_group = pwg_db_fetch_assoc(pwg_query($query));
       
-        $query = "
-UPDATE ".FluxBB_USERS_TABLE."
-SET group_id = ".$o_user_group['conf_value']." 
-WHERE id = ".FluxBB_Searchuser($user['id'])."
-;";
+        $query = '
+UPDATE '.FluxBB_USERS_TABLE.'
+SET group_id = '.$o_user_group['conf_value'].' 
+WHERE id = '.FluxBB_Searchuser($user['id']).'
+;';
         pwg_query($query);
       }
@@ -139,11 +532,11 @@
   global $conf;
   
-  //Because FluxBB is case insensitive on login name, we have to check if a similar login already exists in FluxBB's user table
+  // 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 = "
+  $query = '
 SELECT username
-  FROM ".FluxBB_USERS_TABLE."
-WHERE LOWER(".stripslashes('username').") = '".strtolower($user['username'])."'
-;";
+  FROM '.FluxBB_USERS_TABLE.'
+WHERE LOWER('.stripslashes('username').') = "'.strtolower($user['username']).'"
+;';
 
   $count = pwg_db_num_rows(pwg_query($query));
@@ -159,11 +552,12 @@
 function FluxBB_Linkuser($pwg_id, $bb_id)
 {
-  $query = "
+  $query = '
 SELECT pwg.id as pwg_id, bb.id as bb_id
-FROM ".USERS_TABLE." pwg, ".FluxBB_USERS_TABLE." bb
-WHERE pwg.id = ".$pwg_id."
-AND bb.id = ".$bb_id."
-AND pwg.username = bb.username
-;";
+FROM '.USERS_TABLE.' pwg, '.FluxBB_USERS_TABLE.' bb
+WHERE pwg.id = '.$pwg_id.'
+  AND bb.id = '.$bb_id.'
+  AND pwg.username = bb.username
+  AND pwg.username NOT IN ("18","16")
+;';
   
   $data = pwg_db_fetch_row(pwg_query($query));
@@ -171,17 +565,17 @@
   if (!empty($data))
   {
-    $subquery = "
-DELETE FROM ".Register_FluxBB_ID_TABLE."
-WHERE id_user_pwg = '".$pwg_id."'
-OR id_user_FluxBB = '".$bb_id."'
-;";
+    $subquery = '
+DELETE FROM '.Register_FluxBB_ID_TABLE.'
+WHERE id_user_pwg = "'.$pwg_id.'"
+OR id_user_FluxBB = "'.$bb_id.'"
+;';
 
     $subresult = pwg_query($subquery);
 
-    $subquery = "
-INSERT INTO ".Register_FluxBB_ID_TABLE."
+    $subquery = '
+INSERT INTO '.Register_FluxBB_ID_TABLE.'
   (id_user_pwg, id_user_FluxBB)
-VALUES (".$pwg_id.", ".$bb_id.")
-;";
+VALUES ('.$pwg_id.', '.$bb_id.')
+;';
 
     $subresult = pwg_query($subquery);
@@ -193,8 +587,8 @@
 function FluxBB_Unlinkuser($bb_id)
 {
-  $query = "
-DELETE FROM ".Register_FluxBB_ID_TABLE."
-WHERE id_user_FluxBB = ".$bb_id."
-;";
+  $query = '
+DELETE FROM '.Register_FluxBB_ID_TABLE.'
+WHERE id_user_FluxBB = '.$bb_id.'
+;';
 
   $result = pwg_query($query);
@@ -207,5 +601,5 @@
   global $errors, $conf;
 
-  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+  $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']);
 
   $registred = time();
@@ -213,74 +607,107 @@
   
   // Check if UAM is installed and if bridge is set - Exception for admins and webmasters
-  if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true')
-  {
-    $o_default_user_group = $conf_Register_FluxBB[7];
+  if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB['FLUXBB_UAM_LINK']) and $conf_Register_FluxBB['FLUXBB_UAM_LINK'] == 'true')
+  {
+    $o_default_user_group1 = $conf_Register_FluxBB['FLUXBB_GROUP'];
   }
   else
   {
+    $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));
+  }
+
+// Check for FluxBB version 1.4.x or higher and get the correct value
+  $query1 = '
+SELECT conf_value
+FROM '.FluxBB_CONFIG_TABLE.'
+WHERE conf_name = "o_default_timezone"
+;';
+
+  $count1 = pwg_db_num_rows(pwg_query($query1));
+
+// Check for FluxBB version 1.2.x and get the correct value
+  $query2 = '
+SELECT conf_value
+FROM '.FluxBB_CONFIG_TABLE.'
+WHERE conf_name = "o_server_timezone"
+;';
+
+  $count2 = pwg_db_num_rows(pwg_query($query2));
+  
+  if ($count1 == 1 and $count2 == 0)
+  {
+    $o_default_timezone = pwg_db_fetch_assoc(pwg_query($query1));
+  }
+  else if ($count1 == 0 and $count2 == 1)
+  {
+    $o_default_timezone = pwg_db_fetch_assoc(pwg_query($query2));
+  }
+  
+  
+  $query = '
+SELECT conf_value
+FROM '.FluxBB_CONFIG_TABLE.'
+WHERE conf_name = "o_default_lang"
+;';
+
+  $o_default_lang = pwg_db_fetch_assoc(pwg_query($query));
+  
+  $query = '
+SELECT conf_value
+FROM '.FluxBB_CONFIG_TABLE.'
+WHERE conf_name = "o_default_style"
+;';
+
+  $o_default_style = pwg_db_fetch_assoc(pwg_query($query));
+
+  // Check if UAM is installed and if bridge is set - Exception for admins and webmasters
+  if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB['FLUXBB_UAM_LINK']) and $conf_Register_FluxBB['FLUXBB_UAM_LINK'] == 'true')
+  {
     $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));
-  }
-
-// Check for FluxBB version 1.4.x and get the correct value
-  $query1 = "
-SELECT conf_value
-FROM ".FluxBB_CONFIG_TABLE."
-WHERE conf_name = 'o_default_timezone'
-;";
-
-  $count1 = pwg_db_num_rows(pwg_query($query1));
-
-// Check for FluxBB version 1.2.x and get the correct value
-  $query2 = "
-SELECT conf_value
-FROM ".FluxBB_CONFIG_TABLE."
-WHERE conf_name = 'o_server_timezone'
-;";
-
-  $count2 = pwg_db_num_rows(pwg_query($query2));
-  
-  if ($count1 == 1 and $count2 == 0)
-  {
-    $o_default_timezone = pwg_db_fetch_assoc(pwg_query($query1));
-  }
-  else if ($count1 == 0 and $count2 == 1)
-  {
-    $o_default_timezone = pwg_db_fetch_assoc(pwg_query($query2));
-  }
-  
-  
-  $query = "
-SELECT conf_value
-FROM ".FluxBB_CONFIG_TABLE."
-WHERE conf_name = 'o_default_lang'
-;";
-
-  $o_default_lang = pwg_db_fetch_assoc(pwg_query($query));
-  
-  $query = "
-SELECT conf_value
-FROM ".FluxBB_CONFIG_TABLE."
-WHERE conf_name = 'o_default_style'
-;";
-
-  $o_default_style = pwg_db_fetch_assoc(pwg_query($query));
-
-  $query = "
 INSERT INTO ".FluxBB_USERS_TABLE." (
-  username, 
-  ". ( isset($o_default_user_group['conf_value']) ? 'group_id' : '' ) .",
-  password, 
-  email, 
+  username,
+  ". ( isset($o_default_user_group1) ? 'group_id' : '' ) .",
+  password,
+  email,
   ". ( isset($o_default_timezone['conf_value']) ? 'timezone' : '' ) .",
   ". ( isset($o_default_lang['conf_value']) ? 'language' : '' ) .",
   ". ( isset($o_default_style['conf_value']) ? 'style' : '' ) .",
-  registered, 
-  registration_ip, 
+  registered,
+  registration_ip,
+  last_visit
+  )
+VALUES(
+  '".pwg_db_real_escape_string($login)."',
+  ". ( isset($o_default_user_group1) ? "'".$o_default_user_group1."'" : '' ) .",
+  '".$password."', 
+	'".$adresse_mail."',
+  ". ( isset($o_default_timezone['conf_value']) ? "'".$o_default_timezone['conf_value']."'" : '' ) .",
+  ". ( isset($o_default_lang['conf_value']) ? "'".$o_default_lang['conf_value']."'" : '' ) .",
+  ". ( isset($o_default_style['conf_value']) ? "'".$o_default_style['conf_value']."'" : '' ) .",
+  '".$registred."',
+  '".$registred_ip."',
+  '".$registred."'
+  );";
+  
+    $result = pwg_query($query);
+  }
+  else
+  {
+    $query = "
+INSERT INTO ".FluxBB_USERS_TABLE." (
+  username,
+  ". ( isset($o_default_user_group['conf_value']) ? 'group_id' : '' ) .",
+  password,
+  email,
+  ". ( isset($o_default_timezone['conf_value']) ? 'timezone' : '' ) .",
+  ". ( isset($o_default_lang['conf_value']) ? 'language' : '' ) .",
+  ". ( isset($o_default_style['conf_value']) ? 'style' : '' ) .",
+  registered,
+  registration_ip,
   last_visit
   )
@@ -298,6 +725,6 @@
   )
 ;";
-
-  $result = pwg_query($query);
+    $result = pwg_query($query);
+  }
 
   $bb_id = pwg_db_insert_id();
@@ -310,10 +737,10 @@
 function FluxBB_Searchuser($id_user_pwg)
 {
-  $query = "
+  $query = '
 SELECT id_user_FluxBB, id_user_pwg
-FROM ".Register_FluxBB_ID_TABLE."
-WHERE id_user_pwg = ".$id_user_pwg."
+FROM '.Register_FluxBB_ID_TABLE.'
+WHERE id_user_pwg = '.$id_user_pwg.'
 LIMIT 1
-;";
+;';
 
   $data = pwg_db_fetch_assoc(pwg_query($query));
@@ -331,30 +758,31 @@
   global $conf;
 
-  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
-
-  $query0 = "
-SELECT username, id FROM ".FluxBB_USERS_TABLE."
-WHERE id = ".$id_user_FluxBB."
+  $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']);
+
+  $query0 = '
+SELECT username, id
+FROM '.FluxBB_USERS_TABLE.'
+WHERE id = '.$id_user_FluxBB.'
 LIMIT 1
-;";
+;';
 
   $data0 = pwg_db_fetch_assoc(pwg_query($query0));
 
   // If True, delete related topics and posts
-  if ($SuppTopicsPosts and $conf_Register_FluxBB[3])
+  if ($SuppTopicsPosts and $conf_Register_FluxBB['FLUXBB_DEL_PT'])
   {
     // Delete posts and topics of this user
-    $subquery = "
-DELETE FROM ".FluxBB_POSTS_TABLE."
-WHERE poster_id = ".$id_user_FluxBB."
-;";
+    $subquery = '
+DELETE FROM '.FluxBB_POSTS_TABLE.'
+WHERE poster_id = '.$id_user_FluxBB.'
+;';
 
     $subresult = pwg_query($subquery);
 
     // Delete topics of this user
-    $subquery = "
-DELETE FROM ".FluxBB_TOPICS_TABLE."
-WHERE BINARY poster = BINARY '".pwg_db_real_escape_string($data0['username'])."'
-;";
+    $subquery = '
+DELETE FROM '.FluxBB_TOPICS_TABLE.'
+WHERE BINARY poster = BINARY "'.pwg_db_real_escape_string($data0['username']).'"
+;';
 
     $subresult = pwg_query($subquery);
@@ -362,16 +790,16 @@
 
   // Delete user's subscriptions
-  $subquery = "
-DELETE FROM ".FluxBB_SUBSCRIPTIONS_TABLE."
-WHERE user_id = ".$id_user_FluxBB."
-;";
+  $subquery = '
+DELETE FROM '.FluxBB_SUBSCRIPTIONS_TABLE.'
+WHERE user_id = '.$id_user_FluxBB.'
+;';
 
   $subresult = pwg_query($subquery);
   
   // Delete user's account
-  $subquery = "
-DELETE FROM ".FluxBB_USERS_TABLE."
-WHERE id = ".$id_user_FluxBB."
-;";
+  $subquery = '
+DELETE FROM '.FluxBB_USERS_TABLE.'
+WHERE id = '.$id_user_FluxBB.'
+;';
 
   $subresult = pwg_query($subquery);
@@ -386,9 +814,9 @@
   include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
 
-  $query = "
+  $query = '
 SELECT id_user_FluxBB as FluxBB_id
-FROM ".Register_FluxBB_ID_TABLE."
-WHERE id_user_pwg = ".$pwg_id."
-;";
+FROM '.Register_FluxBB_ID_TABLE.'
+WHERE id_user_pwg = '.$pwg_id.'
+;';
 
   $row = pwg_db_fetch_assoc(pwg_query($query));
@@ -396,9 +824,10 @@
   if (!empty($row))
   {
-    $query = "
-UPDATE ".FluxBB_USERS_TABLE."
-SET username = '".pwg_db_real_escape_string($username)."', email = '".$adresse_mail."', password = '".$password."' 
-WHERE id = ".$row['FluxBB_id']."
-;";
+    $query = '
+UPDATE '.FluxBB_USERS_TABLE.'
+SET username = "'.pwg_db_real_escape_string($username).'", email = "'.$adresse_mail.'", password = "'.$password.'" 
+WHERE id = '.$row['FluxBB_id'].'
+AND "'.pwg_db_real_escape_string($username).'" NOT IN ("18","16")
+;';
    
     $result = pwg_query($query);
@@ -408,9 +837,9 @@
   else
   {
-    $query = "
+    $query = '
 SELECT id as FluxBB_id
-FROM ".FluxBB_USERS_TABLE."
-WHERE BINARY username = BINARY '".pwg_db_real_escape_string($username)."'
-;";
+FROM '.FluxBB_USERS_TABLE.'
+WHERE BINARY username = BINARY "'.pwg_db_real_escape_string($username).'"
+;';
 
     $row = pwg_db_fetch_assoc(pwg_query($query));
@@ -418,9 +847,10 @@
     if (!empty($row))
     {
-      $query = "
-UPDATE ".FluxBB_USERS_TABLE."
-SET username = '".pwg_db_real_escape_string($username)."', email = '".$adresse_mail."', password = '".$password."' 
-WHERE id = ".$row['FluxBB_id']."
-;";
+      $query = '
+UPDATE '.FluxBB_USERS_TABLE.'
+SET username = "'.pwg_db_real_escape_string($username).'", email = "'.$adresse_mail.'", password = "'.$password.'" 
+WHERE id = '.$row['FluxBB_id'].'
+AND "'.pwg_db_real_escape_string($username).'" NOT IN ("18","16")
+;';
      
       $result = pwg_query($query);
@@ -475,4 +905,5 @@
   return $plugin ;
 }
+
 
 function regfluxbb_obsolete_files()
@@ -493,3 +924,80 @@
   }
 }
+
+
+/**
+ * Function to update plugin version number in config table
+ * Used everytime a new version is updated even if no database
+ * upgrade is needed
+ */
+function RegFluxBB_version_update()
+{
+  global $conf;
+
+  // Get current plugin version
+  // --------------------------
+  $plugin =  PHInfos(REGFLUXBB_PATH);
+  $version = $plugin['version'];
+
+  // Upgrading options
+  // -----------------
+  $query = '
+SELECT value
+FROM '.CONFIG_TABLE.'
+WHERE param = "Register_FluxBB"
+;';
+
+  $result = pwg_query($query);
+  $Conf_RegFluxBB = pwg_db_fetch_assoc($result);
+
+  $Newconf_RegFluxBB = unserialize($Conf_RegFluxBB['value']);
+
+  $Newconf_RegFluxBB['REGFLUXBB_VERSION'] = $version;
+
+  $update_conf = serialize($Newconf_RegFluxBB);
+
+  conf_update_param('Register_FluxBB', pwg_db_real_escape_string($update_conf));
+
+
+// Check #_plugin table consistency
+// Only useful if a previous version upgrade has not worked correctly (rare case)
+// ------------------------------------------------------------------------------
+  $query = '
+SELECT version
+  FROM '.PLUGINS_TABLE.'
+WHERE id = "Register_FluxBB"
+;';
+  
+  $data = pwg_db_fetch_assoc(pwg_query($query));
+  
+  if (empty($data['version']) or $data['version'] <> $version)
+  {
+    $query = '
+UPDATE '.PLUGINS_TABLE.'
+SET version="'.$version.'"
+WHERE id = "Register_FluxBB"
+LIMIT 1
+;';
+
+    pwg_query($query);
+  }
+}
+
+
+/**
+ * Useful for debugging - 4 vars can be set
+ * Output result to log.txt file
+ *
+ */
+function RegFluxBBLog($var1, $var2, $var3, $var4)
+{
+   $fo=fopen (REGFLUXBB_PATH.'log.txt','a') ;
+   fwrite($fo,"======================\n") ;
+   fwrite($fo,'le ' . date('D, d M Y H:i:s') . "\r\n");
+   fwrite($fo,$var1 ."\r\n") ;
+   fwrite($fo,$var2 ."\r\n") ;
+   fwrite($fo,$var3 ."\r\n") ;
+   fwrite($fo,$var4 ."\r\n") ;
+   fclose($fo) ;
+}
 ?>
Index: /extensions/Register_FluxBB/include/upgradedb.inc.php
===================================================================
--- /extensions/Register_FluxBB/include/upgradedb.inc.php	(revision 21424)
+++ /extensions/Register_FluxBB/include/upgradedb.inc.php	(revision 21424)
@@ -0,0 +1,65 @@
+<?php
+/**
+ * @author Eric@piwigo.org
+ *  
+ * Upgrade processes for old plugin version
+ * Called from maintain.inc.php on plugin activation
+ * 
+ */
+
+if(!defined('REGFLUXBB_PATH'))
+{
+  define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+}
+
+include_once (REGFLUXBB_PATH.'include/functions.inc.php');
+
+// +----------------------------------------------------------+
+// |       Upgrading database from old plugin versions        |
+// +----------------------------------------------------------+
+
+/* upgrade from 2.4.x to 2.5.0 */
+/* *************************** */
+function upgrade_240_250()
+{
+  global $conf;
+
+  load_language('plugin.lang', REGFLUXBB_PATH);
+
+  $plugin =  RegFluxBB_Infos(REGFLUXBB_PATH);
+  $version = $plugin['version'];
+
+  // Upgrading options - Changing config variables to assoc array
+  // ------------------------------------------------------------
+
+  $conf_RegFluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+
+  $Newconf_RegFluxBB = array(
+    'REGFLUXBB_VERSION' => $version,
+    'FLUXBB_PREFIX'     => $conf_RegFluxBB[0],
+    'FLUXBB_ADMIN'      => $conf_RegFluxBB[1],
+    'FLUXBB_GUEST'      => $conf_RegFluxBB[2],
+    'FLUXBB_DEL_PT'     => $conf_RegFluxBB[3],
+    'FLUXBB_CONFIRM'    => $conf_RegFluxBB[4],
+    'FLUXBB_DETAIL'     => $conf_RegFluxBB[5],
+    'FLUXBB_UAM_LINK'   => $conf_RegFluxBB[6],
+    'FLUXBB_GROUP'      => $conf_RegFluxBB[7]
+  );
+
+  $update_conf = serialize($Newconf_RegFluxBB);
+
+  $q = '
+DELETE FROM '.CONFIG_TABLE.'
+WHERE param="Register_FluxBB" LIMIT 1
+;';
+
+  pwg_query($q);
+
+  $q = '
+INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
+VALUES ("Register_FluxBB","'.pwg_db_real_escape_string($update_conf).'","Register_FluxBB parameters")
+  ;';
+
+  pwg_query($q);
+}
+?>
Index: /extensions/Register_FluxBB/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Register_FluxBB/language/en_UK/plugin.lang.php	(revision 21423)
+++ /extensions/Register_FluxBB/language/en_UK/plugin.lang.php	(revision 21424)
@@ -1,60 +1,158 @@
 <?php
-$lang['Tab_Info'] = 'Instructions';
-$lang['Tab_Manage'] = 'Step 1 : Plugin configuration';
-$lang['Tab_Migration'] = 'Step 2 : Accounts migration';
-$lang['Tab_Synchro'] = 'Maintenance : Accounts re-synchronization';
+$lang['Title'] = 'Register_FluxBB - Version: ';
+$lang['save_config'] ='Settings saved';
 
-$lang['Title'] = 'Register FluxBB';
+$lang['Instruction_Title'] = 'Instructions (important to read first!)';
+$lang['Instruction_Title_d'] = 'Instructions and important information';
+$lang['Disclaimer'] = '
+  *** To begin, follow this 2 steps ***<br/>
+  Step 1 : Configure the plugin parameters related to FluxBB parameters<br/>
+  Step 2 : Migrate users accounts from Piwigo to FluxBB<br/><br/>
+  After these 2 main steps, the plugin is fully functional.<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 shows intruders (But you should not have to use it regularly).<br/><br/>
+  <div class="warning">WARNING !! For safety, be sure to make a backup of your database and especially your ###_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 usernames ("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 using FluxBB behavior: Being case <u>insensitive</u> for usernames.<br/><br/></div>';
+
+
+$lang['About_Reg_Title'] = 'About the registration of users on FluxBB forum';
+$lang['About_Reg_Title_d'] = 'Useful instructions for better integration';
+$lang['No_Reg_advise'] = '
+  For better integration, it is advisable to make the following changes to your FluxBB forum (<b>Warning: These changes will disappear when updating the forum script</b>):
+<br/><br/>
+  <b>* In FluxBB\'s administration panel, change "Allow new registrations" to NO (see: Options - Registration)</b>
+<br/><br/>
+  <b>* Modify the file</b> : [FluxBBRoot]/lang/English/register.php by replacing the following line:
+  <div class="mod">\'No new regs\'				=>	\'This forum is not accepting new users.\'</div>
+  <b>with :</b>
+  <div class="info">\'No new regs\'				=>	\'&lt;a href=&quot;http://[YourPiwigoRoot]/register.php&quot; &gt; Go here to register &lt;/a&gt;&lt;br/&gt;&lt;br/&gt;\'</div>
+  <br/>
+  Of course you should also make the same change for other languages of your FluxBB forum.
+<br/><br/>
+  <b>* Modify the file</b> : [FluxBBRoot]/login.php by replacing around line 64:
+  <div class="mod">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;login.php?action=forget&quot;&gt;</div>
+  <b>with :</b>
+  <div class="info">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;../[YourPiwigoRoot]/password.php&quot;&gt;</div>
+<br/>
+  and around line 295:
+  <div class="mod">&lt;a href=&quot;login.php?action=forget&quot; tabindex=&quot;5&quot;&gt;&lt;?php echo $lang_login[\'Forgotten pass\']&lt;/a&gt;</div>
+  <b>with :</b>
+  <div class="info">&lt;a href=&quot;../[YourPiwigoRoot]/password.php&quot; tabindex=&quot;5&quot;&gt;&lt;?php echo $lang_login[\'Forgotten pass\'] ?&gt;&lt;/a&gt;</div>
+  <br/>';
+
+
+$lang['About_Bridge_Title'] = 'About Register_FluxBB / UAM bridge';
+$lang['About_Bridge_Title_d'] = 'Instruction about bridge between Register_FluxBB and UserAdvManager plugins';
+$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/>
+- In the administration panel of your FluxBB forum, set at least 2 groups of users (for example: "validated" and "no_validated").<br/>
+- Give the first group ("validated") access permissions you want on your forum and set it as the default group.<br/>
+- Remove for the second group ("no_validated") all permissions on your forum (the members of this group can only read public posts).<br/>
+- Locate the ID of the second group "no_validated".<br/>
+- Enter this ID in Register_FluxBB plugin, activate the bridge and save the settings.
+<br/>
+<b class="mod"><u>Important notes:</u></b>
+<br/>
+If you already used an earlier version of Register_FluxBB, Piwigo\'s accounts linked between your gallery and your FluxBB forum will not be impacted by the effects of the bridge. Only new registers will be impacted after activation of the bridge.<b><u>Accounts resynchronization function will be void.</u></b><br/>
+Similarly, if you\'ve never used Register_FluxBB, the Piwigo\'s accounts migration process from your gallery to your FluxBB forum will disregard the state validated or not for the accounts at the launch of the migration.';
+
 
 $lang['Config_Title'] = 'Plugin setup';
+$lang['Config_Title_d'] = 'Plugin setup';
+$lang['Config_Title1'] = 'Settings of bridge between  FluxBB and Piwigo';
+$lang['Config_Title2'] = 'Plugin\'s advanced settings';
+
 $lang['Config_Disclaimer'] = '
-  Check the settings of your FluxBB installation and correct them if necessary. <br>
-  Change, if any, the behavior of the plugin at your convenience.';
-$lang['Prefix'] = 'FluxBB Prefix tables :';
-$lang['Guest'] = 'Username of the FluxBB Guest user.';
-$lang['Details'] = 'Level of detail in reports of operations.';
-$lang['Details_true'] = ' --&gt; View all details of the results of operations.';
-$lang['Details_false'] = ' --&gt; Shows that most of the results of operations';
-$lang['Del_Pt'] = 'Removal of topics and posts when the user is deleted.';
+  Check the settings of your FluxBB installation and fix them if necessary.<br/>
+  Change, if necessary, the behavior of the plugin as you want.';
+
+$lang['Details'] = 'Level of detail to display in the reports of operations (synchronization and migration)';
+$lang['Details_true'] = ' --&gt; Maximum level - Displays all details of the results of synchronization and migration operations';
+$lang['Details_false'] = ' --&gt; Minimum Level - Displays only the main results of the synchronization and migration operations';
+
+$lang['Confirm'] = 'Confirmation of corrective actions in audit';
+$lang['Confirm_true'] = ' --&gt; Do not ask for confirmation';
+$lang['Confirm_false'] = ' --&gt; Confirmation required before any action in audit';
+
+$lang['Prefix'] = 'FluxBB prefix tables :';
+
+$lang['Admin'] = 'Username of Piwigo\'s "Webmaster" account. <b style="color: red">The FluxBB\'s "Administrator" username account must match!</b>';
+$lang['error_config_admin1'] = 'ERROR : Piwigo\'s "Webmaster" username is wrong!';
+$lang['error_config_admin2'] = 'ERROR : The username of the FluxBB\'s "Administrator" account is different of Piwigo\'s ! Check the configuration of your FluxBB forum and rename the "Administrator" account username in the same way as Piwigo\'s';
+
+$lang['Guest'] = 'FluxBB\'s guest username';
+$lang['error_config_guest'] = 'ERROR : The username of the FluxBB\'s "Guest" account is wrong!';
+
+$lang['Del_Pt'] = 'Deleting user\'s topics and messages from forum when he is deleted from Piwigo';
 $lang['Del_Pt_true'] = ' --&gt; Delete all';
-$lang['Del_Pt_false'] = ' --&gt; Don\'t delete topics and posts';
-$lang['Confirm'] = 'Delete confirmation on the administration actions in the audit.';
-$lang['Confirm_true'] = ' --&gt; Delete confirmation';
-$lang['Confirm_false'] = ' --&gt; Confirmation mandatory before actions in audit';
+$lang['Del_Pt_false'] = ' --&gt; Don\'t delete topics and posts from forum';
 
-$lang['save_config'] ='Settings saved';
+$lang['Bridge_UAM'] = 'Validation of access to the forum using UserAdvManager plugin (UAM): Activate here the bridge between the two plugins that allow you to restrict access to your FluxBB forum as the user has not validated its registration in the gallery (the related UAM function must be active)';
+$lang['Bridge_UAM_true'] = ' --> Enable bridge Register_FluxBB / UAM';
+$lang['Bridge_UAM_false'] = ' --> Disable bridge Register_FluxBB / UAM (default)';
+
+$lang['FluxBB_Group'] = 'Specify here the ID (format: integer) of <b>a FluxBB\'s users group</b> in which unvalidated users must be located if they have not validated their registration to the gallery. This users group have to be created first in FluxBB. To be effective, this group should not have any permission on the forum (see the section "Instructions" for detailed information)';
+
+
+$lang['Mig_Title'] = 'Migration of accounts from Piwigo to FluxBB';
+$lang['Mig_Title_d'] = 'USE ONLY IF you have never used the plugin before';
+$lang['Mig_Text'] = '
+  <div class="warning"> USE MIGRATION ONLY IF you never used the plugin to link Piwigo to FluxBB before <u>AND IF</u> your forum is empty of users !!!</b></div><br/>
+  		--> In this case, your [PrefixFluxBB]_user table of FluxBB must be empty of any account except the 2 "Guest" and "Administrator" accounts.<br/><br/>
+  - The migration will first remove the links between accounts of Piwigo and FluxBB if any.<br/>
+  - Then <b>ALL FluxBB ACCOUNTS WILL BE DELETE</b> except the 2 "Guest" and "Administrator" accounts.<br/>
+  <br/>
+  <div class="warning">WARNING - IF YOU HAVE ANY SPECIAL USERS ACCOUNTS IN FluxBB == DO NOT USE THIS FUNCTION !!!</div><br/>
+  - Finally, the migration process will create all Piwigo\'s users accounts in FluxBB, except the "Guest".<br/>
+  <br/>
+  If errors occur during operation, a message will warn you and inform you about the problem. Fix the cause of the problem and retry a migration (at the time only you can renew a migration).<br/>
+  You can also run an audit to verify the status of a migration.<br/>
+  <div class="warning"> NEVER PERFORM MIGRATION FOR UPDATING !!!</div><br/>';
+$lang['Mig_Start'] = '<b>Migration of accounts from Piwigo to FluxBB</b>';
+$lang['Mig_Del_Link'] = '<b>Deleting links between Piwigo and FluxBB accounts</b>';
+$lang['Mig_Del_AllUsers'] = '<b>Deleting FluxBB accounts</b>';
+$lang['Mig_Del_User'] = '<b>Account deletion:</b> ';
+$lang['Mig_Add_AllUsers'] = '<b>Transferring Piwigo accounts</b>';
+$lang['Mig_Add_User'] = '<b>Transferring account:</b> ';
+$lang['Mig_End'] = '<b>Migration done !</b>';
+$lang['Mig_Btn'] = 'Migration';
+
+
+$lang['Sync_Title'] = 'Synchronize accounts from Piwigo to FluxBB';
+$lang['Sync_Title_d'] = 'Use to resynchronize accounts';
+$lang['Sync_Text'] = '
+  <div class="warning">Use this if you are already using this plugin, you have temporarily disabled it and new users registered on the gallery in the meantime</div>
+  <br/> -> This means that your forum already owns users.<br/><br/>
+  - Synchronization compares the usernames, their password (encrypted) and their email address in both tables [PrefixPWG] _users and [PrefixFluxBB] _users<br/>
+  - Then it will update a mapping table as well as the password and email address for each account from Piwigo to FluxBB except the Piwigo\'s "Guest" user and FluxBB\'s "Anonymous" user.<br/>
+  - Finally it will show orphaned accounts errors (which only exist in one of two ###_USERS tables) and will propose a fix.<br/>
+  <br/>
+  At the end of the synchronization, you can perform an AUDIT to check for possible duplicates users in FluxBB. If so, delete the oldest ones (sorting FluxBB users according to their date of registration).<br/>';
+$lang['Sync_Check_Dup'] = '<b>Analysis of user tables for duplicates control</b>';
+$lang['Advise_Check_Dup'] = '<b>IMPOSSIBLE to continue synchronizing if you have duplicate user accounts in Piwigo or FluxBB. Please correct and try again.</b><br/><br/>';
+$lang['Sync_Link_Break'] = '<b>Analysis of repairable links between accounts in Piwigo and FluxBB</b>';
+$lang['Sync_Link_Bad'] = '<b>Analysis of bad relationships between Piwigo and FluxBB accounts</b>';
+$lang['Sync_DataUser'] = '<b>Analysis of passwords and email addresses between Piwigo and FluxBB accounts</b>';
+$lang['Sync_PWG2FluxBB'] = '<b>Analysis of existing accounts in Piwigo but missing in FluxBB</b>';
+$lang['Sync_FluxBB2PWG'] = '<b>Analysis of existing accounts in FluxBB but missing in Piwigo</b>';
+$lang['Sync_OK'] = 'Synchronization OK<br/><br/>';
+$lang['Sync_Btn'] = 'Synchronization';
+
 
 $lang['Audit_Btn'] = 'Audit';
-$lang['Sync_Btn'] = 'Synchronization';
-$lang['Sync_Title'] = 'Synchronize accounts from Piwigo to FluxBB';
-$lang['Sync_Text'] = '
-  <div class="warning">You\'ve already used the plugin to link your Piwigo (plugin update) and / or your FluxBB forum is not empty of users!</div>
-  <br> -> This means that your forum owns users.<br><br>
-  - Synchronization detect the data by comparing the usernames, passwords (encrypted) and their email address in both tables [PrefixPWG]_user and [PrefixFluxBB]_user.<br>
-  - Then update the table of correspondence as well as password and email address for each account from Piwigo to FluxBB except Piwigo Guest and FluxBB Anonymous.<br>
-  - Finally indicate mislead orphaned accounts that exist only in one of the 2 ###_user tables.<br>
-  <br>
-  At the end of the operation, launch an audit and check for possible duplicates users in FluxBB. If so, delete the oldest (sorting FluxBB users according to their date of registration).<br>';
-$lang['Sync_Check_Dup'] = '<b>Analyzing tables of user accounts of Piwigo and FluxBB to control duplicates</b>';
-$lang['Advise_Check_Dup'] = '<b>Impossible to continue the synchronization if you have duplicates in the User Account of Piwigo or FluxBB.</b><br><br>';
-$lang['Sync_Link_Break'] = '<b>Analysis of repairable links between accounts in Piwigo and FluxBB</b>';
-$lang['Sync_Link_Bad'] = '<b>Analysis of bad relationships between accounts in Piwigo and FluxBB</b>';
-$lang['Sync_DataUser'] = '<b>Analysis of passwords and email addresses between accounts in Piwigo and FluxBB</b>';
-$lang['Sync_PWG2FluxBB'] = '<b>Analysis of existing accounts in Piwigo and missing in FluxBB</b>';
-$lang['Sync_FluxBB2PWG'] = '<b>Analysis of existing accounts in FluxBB and missing in Piwigo</b>';
-$lang['Sync_OK'] = 'Synchronization OK<br><br>';
-
 $lang['Audit_PWG_Dup'] = '<b>Audit of Piwigo\'s accounts table</b>';
 $lang['Error_PWG_Dup'] = '<b>Error in Piwigo\'s accounts table, there are duplicates:</b> ';
-$lang['Advise_PWG_Dup'] = '<b>WARNING! You must make these corrections in Piwigo before continuing<br>use Piwigo\'s user manager to resolve the problem.</b>';
-
+$lang['Advise_PWG_Dup'] = '<b>WARNING! You must make these corrections in Piwigo before continuing<br/>Use Piwigo\'s user manager to resolve the problem.</b>';
 $lang['Audit_FluxBB_Dup'] = '<b>Audit of FluxBB\'s accounts table</b>';
 $lang['Error_FluxBB_Dup'] = '<b>Error in FluxBB\'s accounts table, there are duplicates:</b> ';
-$lang['Advise_FluxBB_Dup'] = '<b>WARNING! You must make these corrections in FluxBB before continuing<br>use the icons to delete users from FluxBB and resolve the problem.</b>';
-
+$lang['Advise_FluxBB_Dup'] = '<b>WARNING! You must make these corrections in FluxBB before continuing<br/>Use the icons to delete users from FluxBB and resolve the problem.</b>';
 $lang['Audit_Link_Break'] = '<b>Audit of repairable links between Piwigo and FluxBB accounts</b>';
 $lang['Error_Link_Break'] = '<b>Broken link between Piwigo and FluxBB accounts:</b> ';
 $lang['New_Link'] = 'Account linked: ';
-
 $lang['Audit_Link_Bad'] = '<b>Audit of bad links between Piwigo and FluxBB accounts</b>';
 $lang['Error_Link_Del'] = '<b>Error in the link table between 2 users:</b> ';
@@ -64,5 +162,4 @@
 $lang['Error_Link_Dup'] = '<b>Error in the link table, there are duplicates:</b> ';
 $lang['Link_Dup'] = 'Remove of duplicates ';
-
 $lang['Audit_Synchro'] = '<b>Audit of the synchronization of passwords and email addresses between Piwigo and FluxBB accounts</b>';
 $lang['Error_Synchro'] = '<b>Bad synchronization of account:</b> ';
@@ -71,96 +168,11 @@
 $lang['Audit_Synchro_OK'] = ' <b>: Data synchronization OK</b>';
 $lang['Sync_User'] = 'Account synchronization : ';
-
 $lang['Audit_PWG2FluxBB'] = '<b>Audit of the existing accounts in Piwigo and missing in FluxBB</b>';
 $lang['Error_PWG2FluxBB'] = '<b>The Piwigo account not in FluxBB:</b> ';
 $lang['Add_User'] = 'Adding in FluxBB of account: ';
-
 $lang['Audit_FluxBB2PWG'] = '<b>Audit of the existing accounts in FluxBB and missing in Piwigo</b>';
 $lang['Error_FluxBB2PWG'] = '<b>The FluxBB account not in Piwigo:</b> ';
 $lang['Del_User'] = 'Removal from FluxBB of account : ';
+$lang['Audit_OK'] = 'Audit OK<br/><br/>';
 
-$lang['Audit_OK'] = 'Audit OK<br><br>';
-
-$lang['Mig_Btn'] = 'Migration';
-$lang['Mig_Title'] = 'Migration of accounts from Piwigo to FluxBB';
-$lang['Mig_Text'] = '
-  <div class="warning"> USE ONLY IF you have never used the plugin to link Piwigo to FluxBB <u>AND IF</u> your forum is empty of users !!!</b></div><br>
-  		--> In this case, your table [PrefixFluxBB]_user of FluxBB must be empty of any account except the 2 accounts guest and administrator.<br><br>
-  - The migration will first remove the links between accounts of Piwigo and FluxBB.<br>
-  - Then <b>WILL DELETE ALL FluxBB ACCOUNTS</b> except the 2 accounts guest and administrator.<br>
-  <br>
-  <div class="warning">WARNING IF YOU HAVE ANY SPECIAL ACCOUNTS IN FluxBB == DO NOT USE THIS FUNCTION !!!</div><br>
-  - Finally, the migration will create all Piwigo\'s accounts in FluxBB, except the guest.<br>
-  <br>
-  If errors occur during operation, correct the cause of the problem and retry the operation of migration (at the time only you can renew the migration).<br>';
-$lang['Mig_Disclaimer'] = '<div class="warning"> NEVER PERFORM MIGRATION FOR UPDATING !!!</div>';
-$lang['Mig_Start'] = '<b>Migration of accounts from Piwigo to FluxBB</b>';
-$lang['Mig_Del_Link'] = '<b>Deleting links between accounts of Piwigo and FluxBB</b>';
-$lang['Mig_Del_AllUsers'] = '<b>Deleting FluxBB accounts</b>';
-$lang['Mig_Del_User'] = '<b>Deletion of the account:</b> ';
-$lang['Mig_Add_AllUsers'] = '<b>Transferring Piwigo accounts</b>';
-$lang['Mig_Add_User'] = '<b>Transfer of account:</b> ';
-$lang['Mig_End'] = '<b>Migration done !</b>';
-$lang['Title_Tab'] = 'Register_FluxBB - Version: ';
-
-$lang['No_Reg_advise'] = '
-  For better integration, it is advisable to make the following changes to your FluxBB forum (<b>Warning: These changes will disappear when updating the forum</b>):
-<br><br>
-  <b>* In FluxBB\'s administration panel, change "Allow new registrations" to NO (in: Options - Registration)</b>
-<br><br>
-  <b>* Modify the file</b> : [FluxBBRoot]/lang/English/register.php by replacing the following line:
-  <div class="mod">\'No new regs\'				=>	\'This forum is not accepting new users.\'</div>
-  <b>with :</b>
-  <div class="info">\'No new regs\'				=>	\'&lt;a href=&quot;http://[YourPiwigoRoot]/register.php&quot; &gt; Go here to register &lt;/a&gt;&lt;br/&gt;&lt;br/&gt;\'</div>
-  <br>
-  Of course you should also make the same change for other languages of your FluxBB forum.
-<br><br>
-  <b>* Modify the file</b> : [FluxBBRoot]/login.php by replacing the line 69:
-  <div class="mod">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;login.php?action=forget&quot;&gt;</div>
-  <b>with :</b>
-  <div class="info">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;../[YourPiwigoRoot]/password.php&quot;&gt;</div>
-<br>
-  and at line 216:
-  <div class="mod">&lt;a href=&quot;login.php?action=forget&quot; tabindex=&quot;5&quot;&gt;&lt;?php echo $lang_login[\'Forgotten pass\']&lt;/a&gt;</div>
-  <b>with :</b>
-  <div class="info">&lt;a href=&quot;../[YourPiwigoRoot]/password.php&quot; tabindex=&quot;5&quot;&gt;&lt;?php echo $lang_login[\'Forgotten pass\'] ?&gt;&lt;/a&gt;</div>
-  <br>';
-$lang['About_Reg'] = 'About the registration of users on the forum FluxBB';
-$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'] = '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 linked forum: Registrants can not post until they have validated their registration in the gallery. <br>
-Here is the general procedure to apply:
-<br>
-- In the administration of your FluxBB forum, set at least 2 groups of users (for example: "validated" and "no_validated").<br>
-- Give the first group ("validated") access permissions you want on your forum and set it as the default group.<br>
-- Remove the second group ("no_validated") all permissions on your forum (the members of this group can only read public posts).<br>
-- Locate the ID of the second group "no_validated".<br>
-- Enter this ID in Register_FluxBB plugin, activate the bridge and save the settings.
-<br>
-<b class="mod"><u>Important notes:</u></b>
-<br>
-If you already use an earlier version of Register_FluxBB, Piwigo\'s accounts linked between your gallery and your FluxBB forum will not be impacted by the effects of the bridge. Only new registers will be impacted after activation of the bridge.<b><u>Accounts resynchronization function will be void.</u></b><br>
-Similarly, if you\'ve never used Register_FluxBB, the Piwigo\'s accounts migration phase from your gallery to your FluxBB forum will disregard the state validated or not for the accounts at the launch of the migration phase.';
-
-$lang['Admin'] = 'Piwigo\'s administrator username. <b style="color: red">The username of FluxBB\'s administrator account has to be the same!</b>';
-$lang['error_config_admin1'] = 'ERROR : Piwigo\'s admin username is wrong!';
-$lang['error_config_admin2'] = 'ERROR : The name of the FluxBB\'s administrator account is different from that of Piwigo ! Check the configuration of your FluxBB forum and rename the administrator account in the same name as that of Piwigo.';
-$lang['error_config_guest'] = 'ERROR : The name of the FluxBB\'s guest account is wrong!';
-
-$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>';
 ?>
Index: /extensions/Register_FluxBB/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Register_FluxBB/language/fr_FR/plugin.lang.php	(revision 21423)
+++ /extensions/Register_FluxBB/language/fr_FR/plugin.lang.php	(revision 21424)
@@ -1,68 +1,165 @@
 <?php
-$lang['Tab_Info'] = 'Instructions';
-$lang['Tab_Manage'] = 'Etape 1 : Configuration du plugin';
-$lang['Tab_Migration'] = 'Etape 2 : Migration des comptes';
-$lang['Tab_Synchro'] = 'Maintenance : Resynchronisation des comptes';
+$lang['Title'] = 'Register_FluxBB - Version: ';
+$lang['save_config'] ='Configuration enregistrée.';
 
-$lang['Title'] = 'Register FluxBB';
+$lang['Instruction_Title'] = 'Instructions (important à lire en premier !)';
+$lang['Instruction_Title_d'] = 'Notice d\'utilisation et informations importantes';
+$lang['Disclaimer'] = '
+  *** Pour débuter, 2 étapes à suivre ***<br/>
+  1ère étape : Configurez les paramètres du plugin en relation avec les paramètres de FluxBB<br/>
+  2ème étape : Migrez les comptes utilisateurs de Piwigo vers FluxBB<br/><br/>
+  A l\'issue des 2 étapes principales, le plugin sera pleinement fonctionnel.<br/><br/>
+  *** Pour maintenir les liaisons déjà actives ***<br/>
+  Maintenance : Synchronisez les tables (dans le cas où un ajout, une mise à jour ou une suppression d\'utilisateur se serait mal déroulée). Cela permet aussi de remettre à jour mots de passe et adresses email et voir intrus (Mais vous ne devriez pas avoir à l\'utiliser régulièrement).<br/><br/>
+  <div class="warning">Pensez faire une sauvegarde de votre base et spécialement de vos tables ###_USERS avant toute action 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 "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>';
+
+
+$lang['About_Reg_Title'] = 'A propos de l\'enregistrement d\'utilisateur sur le forum FluxBB';
+$lang['About_Reg_Title_d'] = 'Instructions importantes pour une meilleure intégration';
+$lang['No_Reg_advise'] = '
+  Pour une meilleur intégration, il est conseillé d\'apporter les modifications suivantes à votre forum FluxBB (<b>Attention! Ces modifications disparaitront en cas de mise à jour du script du forum</b>):
+<br/><br/>
+  <b>* Modifiez dans l\'interface d\'administration de FluxBB l\'option "Autoriser les nouvelles inscriptions" à NON ( dans : Options - Inscriptions )</b>
+<br/><br/>
+  <b>* Modifiez le fichier</b> : [RacineDeFluxBB]/lang/French/register.php en remplacant la ligne suivante:
+  <div class="mod">\'No new regs\'				=>	\'Ce forum n\\\'accepte pas de nouveaux utilisateurs.\'</div>
+  <b>par :</b>
+  <div class="info">\'No new regs\'				=>	\'&lt;a href=&quot;http://[VotreRacineDePiwigo]/register.php&quot; &gt; Cliquez ici pour vous inscrire &lt;/a&gt;&lt;br/&gt;&lt;br/&gt;\'</div>
+  <br/>
+  Et reportez cette modification pour toutes les langues gérées sur votre forum.
+<br/><br/>
+  <b>* Modifiez le fichier</b> : [RacineDeFluxBB]/login.php en remplacant vers la ligne 64 :
+  <div class="mod">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;login.php?action=forget&quot;&gt;</div>
+  <b>par :</b>
+  <div class="info">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;../[VotreRacineDePiwigo]/password.php&quot;&gt;</div>
+<br/>
+  et vers la ligne 295:
+  <div class="mod">&lt;a href=&quot;login.php?action=forget&quot; tabindex=&quot;5&quot;&gt;&lt;?php echo $lang_login[\'Forgotten pass\']&lt;/a&gt;</div>
+  <b>par :</b>
+  <div class="info">&lt;a href=&quot;../[VotreRacineDePiwigo]/password.php&quot; tabindex=&quot;5&quot;&gt;&lt;?php echo $lang_login[\'Forgotten pass\'] ?&gt;&lt;/a&gt;</div>
+  <br/>';
+
+
+$lang['About_Bridge_Title'] = 'A propos du pont Register_FluxBB / UAM';
+$lang['About_Bridge_Title_d'] = 'Instructions au sujet du pont entre les plugins Register_FluxBB et UserAdvManager';
+$lang['UAM_Bridge_advice'] = 'Le plugin UserAdvManager permet de forcer les nouveaux inscrits à valider leur inscription avant de leur permettre d\'accéder à la totalité de la galerie. L\'utilisation conjointe de ce plugin avec Register_FluxBB permet de faire de même sur le forum lié: Ils ne pourront pas poster tant qu\'ils n\'auront pas validé leur inscription à la galerie.<br/>
+Voici la procédure générale à appliquer:
+<br/><br/>
+- Dans la partie d\'administration de votre forum FluxBB, établissez au minimum 2 groupes d\'utilisateurs (par exemple: "validés" et "non_validés").<br/>
+- Attribuez au premier groupe ("validés") les permissions d\'accès souhaitées sur votre forum et définissez le comme groupe par défaut.<br/>
+- Retirez au second groupe ("non_validés") toutes les permissions sur votre forum (les membres de ce groupe ne pourront que lire les posts publics).<br/>
+- Repérez l\'ID du second groupe "non_validés".<br/>
+- Notez l\'ID dans le plugin Register_FluxBB, activez le pont et sauvegardez les paramètres.
+<br/><br/>
+<b class="mod"><u>Notes importantes:</u></b>
+<br/><br/>
+Si vous utilisiez déjà Register_FluxBB dans une version antérieur, les comptes liés entre votre galerie Piwigo et votre forum FluxBB ne seront pas impactés par les effets du pont. Seuls les nouveaux inscrits après l\'activation du pont y seront soumis.<b><u>La fonction de resynchronisation des comptes sera sans effet.</u></b><br/><br/>
+De même, si vous n\'avez jamais utilisé Register_FluxBB, la phase de migration des comptes de votre galerie Piwigo vers votre forum FluxBB ne tiendra pas compte de l\'état validé ou non de vos inscrits au moment du lancement de la phase de migration.';
+
 
 $lang['Config_Title'] = 'Configuration du plugin';
+$lang['Config_Title_d'] = 'Configuration du plugin';
+$lang['Config_Title1'] = 'Paramétrages du pont entre FluxBB et Piwigo';
+$lang['Config_Title2'] = 'Paramétrages avancés du plugin';
+
 $lang['Config_Disclaimer'] = '
-  Vérifiez les paramètres relatifs à votre installation de FluxBB et corrigez les au besoin.<br>
+  Vérifiez les paramètres relatifs à votre installation de FluxBB et corrigez les au besoin.<br/>
   Modifiez, le cas échéant, le comportement du plugin à votre convenance.';
+
+$lang['Details'] = 'Niveau de détails à afficher dans les rapports d\'opérations (synchronisation et migration)';
+$lang['Details_true'] = ' --&gt; Niveau maximum - Affiche tous les détails des résultats sur les opérations de synchronisation et de migration';
+$lang['Details_false'] = ' --&gt; Niveau minimum - N\'affiche que l\'essentiel des résultats sur les opérations de synchronisation et de migration';
+
+$lang['Confirm'] = 'Confirmations des actions de correction dans l\'audit';
+$lang['Confirm_true'] = ' --&gt; Ne pas demander de confirmations';
+$lang['Confirm_false'] = ' --&gt; Confirmation obligatoire avant toute action dans l\'audit';
+
 $lang['Prefix'] = 'Préfixe des tables de FluxBB :';
-$lang['Guest'] = 'Nom d\'utilisateur de l\'invité de FluxBB.';
-$lang['Details'] = 'Niveau de détails dans les rapports d\'opérations.';
-$lang['Details_true'] = ' --&gt; Afficher tous les détails des résultats sur les opérations.';
-$lang['Details_false'] = ' --&gt; N\'affiche que l\'essentiel des résultats sur les opérations';
-$lang['Del_Pt'] = 'Suppression des topics et posts de l\'utilisateur lorsqu\'il est supprimé.';
-$lang['Del_Pt_true'] = ' --&gt; Supprime tout';
-$lang['Del_Pt_false'] = ' --&gt; Ne supprime pas les posts et les topics';
-$lang['Confirm'] = 'Suppression des confirmations sur les actions d\'administration dans l\'audit.';
-$lang['Confirm_true'] = ' --&gt; Supprime les confirmations';
-$lang['Confirm_false'] = ' --&gt; Confirmation obligatoire avant action dans l\'audit';
 
-$lang['save_config'] ='Configuration enregistrée.';
+$lang['Admin'] = 'Nom d\'utilisateur du compte "Webmaster" de Piwigo. <b style="color: red">Le nom du compte "Administrateur" de FluxBB doit être identique !</b>';
+$lang['error_config_admin1'] = 'ERREUR : Le nom du compte "Webmaster" de Piwigo est incorrect !';
+$lang['error_config_admin2'] = 'ERREUR : Le nom du compte "Administrateur" de FluxBB est différent du compte "Webmaster" de Piwigo ! Vérifiez la configuration de votre forum FluxBB et nommez le compte "Administrateur" de la même manière que celui de Piwigo';
 
-$lang['Audit_Btn'] = 'Audit';
-$lang['Sync_Btn'] = 'Synchronisation';
+$lang['Guest'] = 'Nom d\'utilisateur du compte "invité" de FluxBB';
+$lang['error_config_guest'] = 'ERREUR : Le nom du compte visiteur ("Guest") de FluxBB est incorrect !';
+
+$lang['Del_Pt'] = 'Suppression des sujets et messages de l\'utilisateur sur le forum lorsqu\'il est supprimé de Piwigo';
+$lang['Del_Pt_true'] = ' --&gt; Supprimer tout';
+$lang['Del_Pt_false'] = ' --&gt; Ne pas supprimer les sujets et messages du forum';
+
+$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\'interdire 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)';
+$lang['Bridge_UAM_true'] = ' --> Pont Register_FluxBB / UAM activé';
+$lang['Bridge_UAM_false'] = ' --> Pont Register_FluxBB / UAM désactivé (par défaut)';
+
+$lang['FluxBB_Group'] = 'Précisez ici l\'ID (format : nombre entier) du <b>groupe d\'utilisateurs FluxBB</b> dans lequel les utilisateurs non validés doivent se trouver lorsqu\'ils n\'ont pas validé leur inscription à la galerie. Ce groupe d\'utilisateurs est à créer au préalable dans FluxBB. Pour être efficace, ce groupe ne doit avoir aucune permission sur le forum (voir dans la section "Instructions" pour les informations détaillées)';
+
+
+$lang['Mig_Title'] = 'Migration des comptes de Piwigo vers FluxBB';
+$lang['Mig_Title_d'] = 'A N\'UTILISER QUE SI vous n\'avez jamais utilisé le plugin auparavent';
+$lang['Mig_Text'] = '
+  <div class="warning"> A N\'EXECUTER QUE SI vous n\'avez jamais utilisé le plugin pour lier Piwigo à FluxBB <u>ET SI</u> votre forum ne contient aucun utilisateurs !!!</div><br/>
+  		--> Dans ce cas, votre table [PrefixFluxBB]_users de FluxBB doit être vide de tout compte sauf les 2 comptes d\'invité et administrateur.<br/><br/>
+  - La procédure de migration supprimera d\'abord les liens des comptes entre Piwigo et FluxBB si existants<br/>
+  - Puis <b>SUPPRIMERA TOUS LES COMPTES de votre forum FluxBB</b> sauf les 2 comptes d\'invité et d\'administrateur.<br/>
+  <br/>
+  <div class="warning">ATTENTION - SI VOUS AVEZ DES COMPTES D\'UTILISATEURS PARTICULIERS DANS FluxBB == NE SURTOUT PAS UTILISER CETTE FONCTION !!!</div><br/>
+  - Enfin la migration créera tout les comptes de Piwigo dans FluxBB sauf l\'invité.<br/>
+  <br/>
+  Si des erreurs se produisent pendant l\'opération, une information s\'affichera. Corrigez la cause du problème et recommencez l\'opération de migration (à ce moment là seulement vous pouvez renouveller une procédure de migration).<br/>
+  Vous pouvez aussi lancer un audit pour vérifier l\'état d\'une migration.<br/>
+  <div class="warning">NE JAMAIS EFFECTUER DE MIGRATION POUR METTRE A JOUR !!!</div><br/>';
+$lang['Mig_Start'] = '<b>Migration des comptes de Piwigo vers FluxBB</b>';
+$lang['Mig_Del_Link'] = '<b>Suppression des liens entre les comptes Piwigo et FluxBB</b>';
+$lang['Mig_Del_AllUsers'] = '<b>Suppression des comptes FluxBB</b>';
+$lang['Mig_Del_User'] = '<b>Suppression du compte :</b> ';
+$lang['Mig_Add_AllUsers'] = '<b>Transfert des comptes Piwigo</b>';
+$lang['Mig_Add_User'] = '<b>Transfert du compte :</b> ';
+$lang['Mig_End'] = '<b>Migration finie !</b>';
+$lang['Mig_Btn'] = 'Migration';
+
+
 $lang['Sync_Title'] = 'Synchronisation des comptes Piwigo vers FluxBB';
+$lang['Sync_Title_d'] = 'A utiliser pour resynchroniser les comptes';
 $lang['Sync_Text'] = '
-  <div class="warning">Vous avez déjà utilisé le plugin pour lier votre Piwigo (mise à jour du plugin) et/ou votre forum FluxBB n\'est pas vide d\'utilisateurs !!!</div><br>
-  <br> -> Ceci signifie que votre forum posséde des utilisateurs.<br><br>
-  - La synchronisation détectera les données présentes en comparant les noms des utilisateurs, leur mot de passe (crypté) et leur adresse email dans les deux tables [PrefixPWG]_users et [PrefixFluxBB]_users.<br>
-  - Puis mettra à jour cette table de correspondance ainsi que le mot de passe et l\'adresse email de chaque compte depuis Piwigo vers FluxBB sauf Piwigo Guest et FluxBB Anonymous.<br>
-  - Enfin indiquera en erreur les comptes orphelins qui n\'existent que dans l\'une des 2 tables ###_USERS.<br>
-  <br>
-  A l\'issue de l\'opération lancez un AUDIT et veuillez vérifier la présence de doublons éventuels dans les utilisateurs de FluxBB, si c\'est le cas, il faut supprimer les plus anciens (tri des utilisateurs FluxBB selon leur date d\'incription).<br>';
-$lang['Sync_Check_Dup'] = '<b>Analyse des tables des comptes utilisateurs de Piwigo et FluxBB pour contrôler les doublons</b>';
-$lang['Advise_Check_Dup'] = '<b>IMPOSSIBLE de continuer la synchronisation si vous avez des doublons dans les comptes utilisateurs de Piwigo ou FluxBB.</b><br><br>';
+  <div class="warning">A exécuter si vous êtes déjà utilisateur de ce plugin, que vous l\'avez temporairement désactivé et que de nouveaux utilisateurs se sont inscrits sur la galerie entre temps</div><br/>
+  <br/> -> Ceci signifie que votre forum posséde des utilisateurs.<br/><br/>
+  - La synchronisation comparera les noms des utilisateurs, leur mot de passe (crypté) et leur adresse email dans les deux tables [PrefixPWG]_users et [PrefixFluxBB]_users<br/>
+  - Puis mettra à jour une table de correspondances ainsi que le mot de passe et l\'adresse email de chaque compte depuis Piwigo vers FluxBB sauf les utilisateurs "Guest" de Piwigo et "Anonymous" de FluxBB.<br/>
+  - Enfin indiquera en erreur les comptes orphelins (qui n\'existent que dans l\'une des 2 tables ###_USERS) et proposera une résolution des erreurs.<br/>
+  <br/>
+  A l\'issue de l\'opération lancez un AUDIT et vérifiez la présence de doublons éventuels dans les utilisateurs de FluxBB, si c\'est le cas, il faut supprimer les plus anciens (triez des utilisateurs FluxBB selon leur date d\'inscription).<br/>';
+$lang['Sync_Check_Dup'] = '<b>Analyse des tables d\'utilisateurs pour contrôle les doublons</b>';
+$lang['Advise_Check_Dup'] = '<b>IMPOSSIBLE de continuer la synchronisation si vous avez des doublons dans les comptes utilisateurs de Piwigo ou FluxBB. Veuillez corriger puis réessayez.</b><br/><br/>';
 $lang['Sync_Link_Break'] = '<b>Analyse des liens réparables entre les comptes Piwigo et FluxBB</b>';
 $lang['Sync_Link_Bad'] = '<b>Analyse des mauvais liens entre les comptes Piwigo et FluxBB</b>';
 $lang['Sync_DataUser'] = '<b>Analyse des mots de passe et des adresses emails entre les comptes Piwigo et FluxBB</b>';
-$lang['Sync_PWG2FluxBB'] = '<b>Analyse des comptes existants dans Piwigo et manquants dans FluxBB</b>';
-$lang['Sync_FluxBB2PWG'] = '<b>Analyse des comptes existants dans FluxBB et manquants dans Piwigo</b>';
-$lang['Sync_OK'] = 'Synchronisation OK<br><br>';
+$lang['Sync_PWG2FluxBB'] = '<b>Analyse des comptes existants dans Piwigo mais manquants dans FluxBB</b>';
+$lang['Sync_FluxBB2PWG'] = '<b>Analyse des comptes existants dans FluxBB mais manquants dans Piwigo</b>';
+$lang['Sync_OK'] = 'Synchronisation OK<br/><br/>';
+$lang['Sync_Btn'] = 'Synchronisation';
 
+
+$lang['Audit_Btn'] = 'Audit';
 $lang['Audit_PWG_Dup'] = '<b>Audit de la table des comptes de Piwigo</b>';
 $lang['Error_PWG_Dup'] = '<b>Erreur dans la table des comptes Piwigo, il y a des doublons :</b> ';
-$lang['Advise_PWG_Dup'] = '<b>ATTENTION ! Vous devez faire ces corrections dans Piwigo avant de continuer<br>utilisez le gestionnaires d\'utilisateurs de Piwigo pour régler le problème.</b>';
-
+$lang['Advise_PWG_Dup'] = '<b>ATTENTION ! Vous devez faire ces corrections dans Piwigo avant de continuer<br/>Utilisez le gestionnaire d\'utilisateurs de Piwigo pour régler le problème.</b>';
 $lang['Audit_FluxBB_Dup'] = '<b>Audit de la table des comptes FluxBB</b>';
 $lang['Error_FluxBB_Dup'] = '<b>Erreur dans la table des comptes FluxBB, il y a des doublons :</b> ';
-$lang['Advise_FluxBB_Dup'] = '<b>ATTENTION Vous devez faire ces corrections dans FluxBB avant de continuer<br>utilisez les icones pour supprimer les utilisateurs de FluxBB et régler le problème.</b>';
-
+$lang['Advise_FluxBB_Dup'] = '<b>ATTENTION Vous devez faire ces corrections dans FluxBB avant de continuer<br/>utilisez les icones pour supprimer les utilisateurs de FluxBB et régler le problème.</b>';
 $lang['Audit_Link_Break'] = '<b>Audit des liens réparables entre les comptes Piwigo et FluxBB</b>';
 $lang['Error_Link_Break'] = '<b>Lien brisé entre les comptes Piwigo et FluxBB :</b> ';
 $lang['New_Link'] = 'Liaison du compte : ';
-
 $lang['Audit_Link_Bad'] = '<b>Audit des mauvais liens entre les comptes Piwigo et FluxBB</b>';
-$lang['Error_Link_Del'] = '<b>Erreur dans la table de lien entre les 2 utilisateurs :</b> ';
+$lang['Error_Link_Del'] = '<b>Erreur dans la table de liens entre les 2 utilisateurs :</b> ';
 $lang['Link_Del'] = 'Suppression du lien : ';
-$lang['Error_Link_Dead'] = '<b>Erreur dans la table de lien, des liens morts existent :</b> ';
+$lang['Error_Link_Dead'] = '<b>Erreur dans la table de liens, des liens morts existent :</b> ';
 $lang['Link_Dead'] = 'Suppression du liens morts ';
-$lang['Error_Link_Dup'] = '<b>Erreur dans la table de lien, il y a des doublons :</b> ';
+$lang['Error_Link_Dup'] = '<b>Erreur dans la table de liens, il y a des doublons :</b> ';
 $lang['Link_Dup'] = 'Suppression des liens dupliqués ';
-
 $lang['Audit_Synchro'] = '<b>Audit de la synchronisation des mots de passe et des adresses emails entre les comptes Piwigo et FluxBB</b>';
 $lang['Error_Synchro'] = '<b>Mauvaise synchronisation du compte :</b> ';
@@ -71,103 +168,11 @@
 $lang['Audit_Synchro_OK'] = ' <b>: Synchro des données OK</b>';
 $lang['Sync_User'] = 'Synchronisation du compte : ';
-
 $lang['Audit_PWG2FluxBB'] = '<b>Audit des comptes existants dans Piwigo et manquants dans FluxBB</b>';
 $lang['Error_PWG2FluxBB'] = '<b>Le compte Piwigo n\'existe pas dans FluxBB :</b> ';
 $lang['Add_User'] = 'Ajout dans FluxBB du compte : ';
-
 $lang['Audit_FluxBB2PWG'] = '<b>Audit des comptes existants dans FluxBB et manquants dans Piwigo</b>';
 $lang['Error_FluxBB2PWG'] = '<b>Le compte FluxBB n\'existe pas dans Piwigo :</b> ';
 $lang['Del_User'] = 'Suppression de FluxBB du compte : ';
+$lang['Audit_OK'] = 'Audit OK<br/><br/>';
 
-$lang['Audit_OK'] = 'Audit OK<br><br>';
-
-$lang['Mig_Btn'] = 'Migration';
-$lang['Mig_Title'] = 'Migration des comptes de Piwigo vers FluxBB';
-$lang['Mig_Text'] = '
-  <div class="warning"> A N\'UTILISER QUE SI vous n\'avez jamais utilisé le plugin pour lier Piwigo à FluxBB <u>ET SI</u> votre forum est vide d\'utilisateurs !!!</div><br>
-  		--> Dans ce cas, votre table [PrefixFluxBB]_users de FluxBB doit être vide de tout compte sauf les 2 comptes d\'invité et d\'administrateur.<br><br>
-  - La migration va d\'abord supprimer les liens des comptes entre Piwigo et FluxBB.<br>
-  - Puis <b>SUPPRIMERA TOUS LES COMPTES FluxBB</b> sauf les 2 comptes d\'invité et d\'administrateur.<br>
-  <br>
-  <div class="warning">ATTENTION SI VOUS AVEZ DES COMPTES PARTICULIERS DANS FluxBB == NE SURTOUT PAS UTILISER CETTE FONCTION !!!</div><br>
-  - Enfin la migration va créer tout les comptes de Piwigo dans FluxBB sauf l\'invité.<br>
-  <br>
-  Si des erreurs se produisent pendant l\'opération, corrigez la cause du problème et recommencez l\'opération de migration (à ce moment là seulement vous pouvez renouveller la migration).<br>';
-$lang['Mig_Disclaimer'] = '<div class="warning"> NE JAMAIS EFFECTUER DE MIGRATION POUR METTRE A JOUR !!!</div>';
-$lang['Mig_Start'] = '<b>Migration des comptes Piwigo vers FluxBB</b>';
-$lang['Mig_Del_Link'] = '<b>Suppression des liens entre les comptes Piwigo et FluxBB</b>';
-$lang['Mig_Del_AllUsers'] = '<b>Suppression des comptes FluxBB</b>';
-$lang['Mig_Del_User'] = '<b>Suppression du compte :</b> ';
-$lang['Mig_Add_AllUsers'] = '<b>Transfert des comptes Piwigo</b>';
-$lang['Mig_Add_User'] = '<b>Transfert du compte :</b> ';
-$lang['Mig_End'] = '<b>Migration finie !</b>';
-$lang['Title_Tab'] = 'Register_FluxBB - Version: ';
-
-
-// --------- Starting below: New or revised $lang ---- from version 2.3.0
-$lang['No_Reg_advise'] = '
-  Pour une meilleur intégration, il est conseillé d\'apporter les modifications suivantes à votre forum FluxBB (<b>Attention! Ces modifications disparaitront en cas de mise à jour du forum</b>):
-<br><br>
-  <b>* Modifier dans l\'interface d\'administration de FluxBB l\'option "Autoriser les nouvelles inscriptions" à NON ( dans : Options - Inscriptions )</b>
-<br><br>
-  <b>* Modifier le fichier</b> : [RacineDeFluxBB]/lang/French/register.php en remplacant la ligne suivante:
-  <div class="mod">\'No new regs\'				=>	\'Ce forum n\\\'accepte pas de nouveaux utilisateurs.\'</div>
-  <b>par :</b>
-  <div class="info">\'No new regs\'				=>	\'&lt;a href=&quot;http://[VotreRacineDePiwigo]/register.php&quot; &gt; Cliquez ici pour vous inscrire &lt;/a&gt;&lt;br/&gt;&lt;br/&gt;\'</div>
-  <br>
-  Et reporter cette modification pour toutes les langues gérées sur votre forum.
-<br><br>
-  <b>* Modifier le fichier</b> : [RacineDeFluxBB]/login.php en remplacant à la ligne 69:
-  <div class="mod">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;login.php?action=forget&quot;&gt;</div>
-  <b>par :</b>
-  <div class="info">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;../[VotreRacineDePiwigo]/password.php&quot;&gt;</div>
-<br>
-  à la ligne 216:
-  <div class="mod">&lt;a href=&quot;login.php?action=forget&quot; tabindex=&quot;5&quot;&gt;&lt;?php echo $lang_login[\'Forgotten pass\']&lt;/a&gt;</div>
-  <b>par :</b>
-  <div class="info">&lt;a href=&quot;../[VotreRacineDePiwigo]/password.php&quot; tabindex=&quot;5&quot;&gt;&lt;?php echo $lang_login[\'Forgotten pass\'] ?&gt;&lt;/a&gt;</div>
-  <br>';
-$lang['About_Reg'] = 'A propos de l\'enregistrement d\'utilisateur sur le 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\'interdire 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).';
-$lang['Bridge_UAM_true'] = ' --> Pont Register_FluxBB / UAM activé';
-$lang['Bridge_UAM_false'] = ' --> Pont Register_FluxBB / UAM désactivé (par défaut)';
-$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).';
-$lang['About_Bridge'] = 'A propos du pont Register_FluxBB / UAM';
-$lang['UAM_Bridge_advice'] = 'Le plugin UserAdvManager permet de forcer les nouveaux inscrits à valider leur inscription avant de leur permettre d\'accéder à la totalité de la galerie. L\'utilisation conjointe de ce plugin avec Register_FluxBB permet de faire de même sur le forum lié: Ils ne pourront pas poster tant qu\'ils n\'auront pas validé leur inscription à la galerie.<br>
-Voici la procédure générale à appliquer:
-<br><br>
-- Dans la partie d\'administration de votre forum FluxBB, établissez au minimum 2 groupes d\'utilisateurs (par exemple: "validés" et "non_validés").<br>
-- Attribuez au premier groupe ("validés") les permissions d\'accès souhaitées sur votre forum et définissez le comme groupe par défaut.<br>
-- Retirez au second groupe ("non_validés") toutes les permissions sur votre forum (les membres de ce groupe ne pourront que lire les posts publics).<br>
-- Repérez l\'ID du second groupe "non_validés".<br>
-- Notez l\'ID dans le plugin Register_FluxBB, activez le pont et sauvegardez les paramètres.
-<br><br>
-<b class="mod"><u>Notes importantes:</u></b>
-<br><br>
-Si vous utilisiez déjà Register_FluxBB dans une version antérieur, les comptes liés entre votre galerie Piwigo et votre forum FluxBB ne seront pas impactés par les effets du pont. Seuls les nouveaux inscrits après l\'activation du pont y seront soumis.<b><u>La fonction de resynchronisation des comptes sera sans effet.</u></b><br><br>
-De même, si vous n\'avez jamais utilisé Register_FluxBB, la phase de migration des comptes de votre galerie Piwigo vers votre forum FluxBB ne tiendra pas compte de l\'état validé ou non de vos inscrits au moment du lancement de la phase de migration.';
-// --------- End: New or revised $lang ---- from version 2.3.0
-
-// --------- Starting below: New or revised $lang ---- from version 2.3.3
-$lang['Admin'] = 'Nom d\'utilisateur de l\'administrateur de Piwigo. <b style="color: red">Le nom de l\'administrateur de FluxBB doit être identique !</b>';
-$lang['error_config_admin1'] = 'ERREUR : Le nom du compte administrateur de Piwigo est incorrect !';
-$lang['error_config_admin2'] = 'ERREUR : Le nom du compte administrateur de FluxBB est différent de celui de Piwigo ! Vérifiez la configuration de votre forum FluxBB et nommez le compte administrateur de la même manière que celui de Piwigo.';
-$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/main.inc.php
===================================================================
--- /extensions/Register_FluxBB/main.inc.php	(revision 21423)
+++ /extensions/Register_FluxBB/main.inc.php	(revision 21424)
@@ -107,10 +107,12 @@
                       - Update pl_PL, thanks to : kuba
                       - Bad explanation in inline tips fixed
+
+2.5.0     - ../../..  - Compliance with Piwigo 2.5 
+                      - Code refactory : Plugin's configuration vars are now serialized in database
+                      - Admin panel refactory : No more tabs
+                      - English language reference review
+                      - Compliance improved with FluxBB 1.5
 --------------------------------------------------------------------------------
 */
-
-// pour faciliter le debug - make debug easier :o)
-//ini_set('error_reporting', E_ALL);
-//ini_set('display_errors', true);
 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
Index: /extensions/Register_FluxBB/maintain.inc.php
===================================================================
--- /extensions/Register_FluxBB/maintain.inc.php	(revision 21423)
+++ /extensions/Register_FluxBB/maintain.inc.php	(revision 21424)
@@ -1,32 +1,61 @@
 <?php
-
-if (!defined('REGFLUXBB_PATH')) define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
-//ini_set('error_reporting', E_ALL);
-//ini_set('display_errors', true);
+if(!defined('REGFLUXBB_PATH'))
+{
+  define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+}
 
 include_once (PHPWG_ROOT_PATH.'/include/constants.php');
-include_once (REGFLUXBB_PATH.'include/constants.php');
 include_once (REGFLUXBB_PATH.'include/functions.inc.php');
-
 
 function plugin_install()
 {
-  global $prefixeTable;
+  global $prefixeTable, $conf;
 
+  // Set current plugin version in config table
+  $plugin =  RegFluxBB_Infos(REGFLUXBB_PATH);
+  $version = $plugin['version'];
+
+  // Default global parameters for RegisterFluxBB conf
+  // -------------------------------------------------
+  $defaultRegFluxBB = array(
+    'REGFLUXBB_VERSION' => $version,
+    'FLUXBB_PREFIX'     => '',
+    'FLUXBB_ADMIN'      => '',
+    'FLUXBB_GUEST'      => '',
+    'FLUXBB_DEL_PT'     => 'false',
+    'FLUXBB_CONFIRM'    => 'false',
+    'FLUXBB_DETAIL'     => 'false',
+    'FLUXBB_UAM_LINK'   => 'false',
+    'FLUXBB_GROUP'      => ''
+  );
+
+  // Create RegisterFluxBB conf if not already exists
+  // ------------------------------------------------
+	$query = '
+SELECT param
+  FROM '.CONFIG_TABLE.'
+WHERE param = "Register_FluxBB"
+;';
+  $count = pwg_db_num_rows(pwg_query($query));
+  
+  if ($count == 0)
+  {
+    $q = '
+INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
+VALUES ("Register_FluxBB","'.pwg_db_real_escape_string(serialize($defaultRegFluxBB)).'","Register_FluxBB parameters")
+  ;';
+    pwg_query($q);
+  }
+
+  // Create relation table between FluxBB and Piwigo
+  // -----------------------------------------------
   $q = '
-INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
-VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true;false;0","Parametres Register_FluxBB")
-;';
-    
-  pwg_query($q);
-  
-  $q = "
-CREATE TABLE IF NOT EXISTS ".Register_FluxBB_ID_TABLE." (
-  id_user_pwg smallint(5) NOT NULL default '0',
-  id_user_FluxBB int(10) NOT NULL default '0',
+CREATE TABLE IF NOT EXISTS '.Register_FluxBB_ID_TABLE.' (
+  id_user_pwg smallint(5) NOT NULL default "0",
+  id_user_FluxBB int(10) NOT NULL default "0",
 PRIMARY KEY  (id_user_pwg),
   KEY id_user_pwg (id_user_pwg, id_user_FluxBB)
 )
-;";
+;';
 
   pwg_query($q);
@@ -42,13 +71,23 @@
   regfluxbb_obsolete_files();
 
-/* Check version < 2.3.0 */
-  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
-  
-  if (!isset($conf_Register_FluxBB[6]) and !isset($conf_Register_FluxBB[7]))
+include_once (REGFLUXBB_PATH.'include/upgradedb.inc.php');
+
+/* Database upgrade */
+/* **************** */
+  $conf_RegFluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+
+  if (isset($conf_RegFluxBB[0]) and strpos($conf_RegFluxBB[0],"{") === false) /* Version < 2.5.0 */
   {
-    $upgrade_RFBB = $conf_Register_FluxBB[0].';'.$conf_Register_FluxBB[1].';'.$conf_Register_FluxBB[2].';'.$conf_Register_FluxBB[3].';'.$conf_Register_FluxBB[4].';'.$conf_Register_FluxBB[5].';false;0';
+    upgrade_240_250();
+  }
 
-    conf_update_param('Register_FluxBB', pwg_db_real_escape_string($upgrade_RFBB));
-  }
+/* Update plugin version number in #_config table */
+/* and check consistency of #_plugins table       */
+/* ********************************************** */
+  RegFluxBB_version_update();
+
+/* Reload plugin parameters */
+/* ************************ */
+  load_conf_from_db('param like \'Register_FluxBB\'');
 }
 
@@ -66,5 +105,5 @@
     pwg_query($q);
   }
-  
+
   $q = 'DROP TABLE '.Register_FluxBB_ID_TABLE.';';
   pwg_query( $q );
Index: /extensions/Register_FluxBB/obsolete.list.php
===================================================================
--- /extensions/Register_FluxBB/obsolete.list.php	(revision 21424)
+++ /extensions/Register_FluxBB/obsolete.list.php	(revision 21424)
@@ -0,0 +1,4 @@
+admin/template/info.tpl
+admin/template/manage.tpl
+admin/template/migration.tpl
+admin/template/synchro.tpl
