Index: /extensions/Register_FluxBB/tags/2.1.3/admin/Register_FluxBB_admin.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/admin/Register_FluxBB_admin.php	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/admin/Register_FluxBB_admin.php	(revision 4289)
@@ -0,0 +1,1030 @@
+<?php
+
+global $user, $lang, $conf, $template, $errors;
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+//ini_set('error_reporting', E_ALL);
+//ini_set('display_errors', true);
+
+include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+include_once (Register_FluxBB_PATH.'include/constants.php');
+include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+$my_base_url = get_admin_plugin_menu_link(__FILE__);
+load_language('plugin.lang', Register_FluxBB_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();
+
+// +-----------------------------------------------------------------------+
+// |                            Functions
+// +-----------------------------------------------------------------------+
+function Audit_PWG_FluxBB()
+{
+  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_PWG2FluxBB = '';
+  $msg_error_FluxBB2PWG = '';
+
+
+
+  $query = "
+SELECT COUNT(*) AS nbr_dup, id, username
+FROM ".USERS_TABLE." 
+GROUP BY BINARY username
+HAVING COUNT(*) > 1
+;";
+  $result = pwg_query($query);
+  
+  while($row = mysql_fetch_array($result))
+    $msg_error_PWG_Dup .= '<br/>'.l10n('Register_FluxBB_Error_PWG_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']);
+
+  if ($msg_error_PWG_Dup == '')
+    array_push($page['infos'], l10n('Register_FluxBB_Audit_PWG_Dup').'<br/>'.l10n('Register_FluxBB_Audit_OK'));
+  else
+    $msg_error_PWG_Dup = l10n('Register_FluxBB_Audit_PWG_Dup').$msg_error_PWG_Dup.'<br>'.l10n('Register_FluxBB_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 = mysql_fetch_array($result))
+  {
+    $msg_error_FluxBB_Dup .= '<br/>'.l10n('Register_FluxBB_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 = mysql_fetch_array($subresult))
+    {
+      $msg_error_FluxBB_Dup .= '<br/>id:'.$subrow['id'].'='.stripslashes($subrow['username']).' ('.$subrow['email'].')';
+  
+      if ( !is_adviser() )
+      {
+        $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('Register_FluxBB_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="'.Register_FluxBB_PATH.'/icon/user_delete.png" alt="'.l10n('Register_FluxBB_Del_User').$subrow['username'].'" /></a>';
+      }
+    }
+  }
+
+  if ($msg_error_FluxBB_Dup == '')
+    array_push($page['infos'], l10n('Register_FluxBB_Audit_FluxBB_Dup').'<br/>'.l10n('Register_FluxBB_Audit_OK'));
+  else
+    $msg_error_FluxBB_Dup = l10n('Register_FluxBB_Audit_FluxBB_Dup').$msg_error_FluxBB_Dup.'<br>'.l10n('Register_FluxBB_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.mail_address = bb.email
+;";
+
+  $result = pwg_query($query);
+  
+  while($row = mysql_fetch_array($result))
+  {
+    $msg_error_Link_Break .= '<br/>'.l10n('Register_FluxBB_Error_Link_Break').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')';
+
+    if ( !is_adviser() )
+    {
+      $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('Register_FluxBB_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="'.Register_FluxBB_PATH.'/icon/link_break.png" alt="'.l10n('Register_FluxBB_New_Link').stripslashes($row['pwg_user']).'" /></a>';
+    }
+  }
+
+  if ($msg_error_Link_Break == '')
+    array_push($page['infos'], l10n('Register_FluxBB_Audit_Link_Break').'<br/>'.l10n('Register_FluxBB_Audit_OK'));
+  else
+    $msg_error_Link_Break = l10n('Register_FluxBB_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
+;";
+
+  $result = pwg_query($query);
+  
+  while($row = mysql_fetch_array($result))
+  {
+    $msg_error_Link_Bad .= '<br/>'.l10n('Register_FluxBB_Error_Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')';
+
+    if ( !is_adviser() )
+    {
+      $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('Register_FluxBB_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="'.Register_FluxBB_PATH.'/icon/link_delete.png" alt="'.l10n('Register_FluxBB_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('Register_FluxBB_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="'.Register_FluxBB_PATH.'/icon/arrow_switch.png" alt="'.l10n('Register_FluxBB_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 = mysql_fetch_array(pwg_query($query));
+
+  if (!empty($Compteur) and $Compteur['nbr_dead'] > 0)
+  { 
+    $msg_error_Link_Bad .= '<br/>'.l10n('Register_FluxBB_Error_Link_Dead').$Compteur['nbr_dead'];
+
+    if ( !is_adviser() )
+    {
+      $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('Register_FluxBB_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="'.Register_FluxBB_PATH.'/icon/link_delete.png" alt="'.l10n('Register_FluxBB_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
+GROUP BY link.id_user_pwg, link.id_user_FluxBB
+HAVING COUNT(*) > 1
+;";
+
+  $result = pwg_query($query);
+  
+  while($row = mysql_fetch_array($result))
+  {
+    $msg_error_Link_Bad .= '<br/>'.l10n('Register_FluxBB_Error_Link_Dup').$row['nbr_dup'].' = '.stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).')';
+
+    if ( !is_adviser() )
+    {
+      $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('Register_FluxBB_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="'.Register_FluxBB_PATH.'/icon/link_error.png" alt="'.l10n('Register_FluxBB_Link_Dup').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'" /></a>';
+    }      
+  }
+
+  if ($msg_error_Link_Bad == '')
+    array_push($page['infos'], l10n('Register_FluxBB_Audit_Link_Bad').'<br/>'.l10n('Register_FluxBB_Audit_OK'));
+  else
+    $msg_error_Link_Bad = l10n('Register_FluxBB_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
+AND BINARY pwg.username = BINARY FluxBB.username
+ORDER BY LOWER(pwg.username)
+;";
+
+  $result = pwg_query($query);
+  
+  while($row = mysql_fetch_array($result))
+  {
+    if ( ($row['pwg_pwd'] != $row['bb_pwd']) or ($row['pwg_eml'] != $row['bb_eml']) )
+    {
+      $msg_error_Synchro .= '<br/>'.l10n('Register_FluxBB_Error_Synchro').stripslashes($row['username']);
+
+      if ( !is_adviser() )
+      {
+        $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('Register_FluxBB_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="'.Register_FluxBB_PATH.'/icon/user_refresh.png" alt="'.l10n('Register_FluxBB_Sync_User').stripslashes($row['username']).'" /></a>';
+      }
+      
+      if ($row['pwg_pwd'] != $row['bb_pwd'])
+        $msg_error_Synchro .= '<br>'.l10n('Register_FluxBB_Error_Synchro_Pswd');
+      
+      if ($row['pwg_eml'] != $row['bb_eml'])
+        $msg_error_Synchro .= '<br>'.l10n('Register_FluxBB_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('Register_FluxBB_Audit_Synchro_OK');
+  }
+
+  if ($msg_error_Synchro <> '')
+    $msg_error_Synchro = l10n('Register_FluxBB_Audit_Synchro').$msg_error_Synchro;
+    
+  if ($msg_ok_Synchro <> '')
+    if ($msg_error_Synchro <> '')
+      array_push($page['infos'], l10n('Register_FluxBB_Audit_Synchro').$msg_ok_Synchro.'<br/><br/>');
+    else
+      array_push($page['infos'], l10n('Register_FluxBB_Audit_Synchro').$msg_ok_Synchro.'<br/><br/>'.l10n('Register_FluxBB_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 = mysql_fetch_array($result))
+  {
+    $msg_error_PWG2FluxBB .= '<br/>'.l10n('Register_FluxBB_Error_PWG2FluxBB').stripslashes($row['username']).' ('.$row['mail_address'].')';
+
+    if ( !is_adviser() )
+    {
+      $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('Register_FluxBB_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="'.Register_FluxBB_PATH.'/icon/user_add.png" alt="'.l10n('Register_FluxBB_Add_User').stripslashes($row['username']).'" /></a>';
+    }
+  }
+
+  if ($msg_error_PWG2FluxBB == '')
+    array_push($page['infos'], l10n('Register_FluxBB_Audit_PWG2FluxBB').'<br/>'.l10n('Register_FluxBB_Audit_OK'));
+  else
+    $msg_error_PWG2FluxBB = l10n('Register_FluxBB_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 = mysql_fetch_array($result))
+  {
+    $msg_error_FluxBB2PWG .= '<br/>'.l10n('Register_FluxBB_Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')';
+
+    if ( !is_adviser() )
+    {
+      $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('Register_FluxBB_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="'.Register_FluxBB_PATH.'/icon/user_delete.png" alt="'.l10n('Register_FluxBB_Del_User').stripslashes($row['username']).'" /></a>';
+    }
+  }
+
+  if ($msg_error_FluxBB2PWG == '')
+    array_push($page['infos'], l10n('Register_FluxBB_Audit_FluxBB2PWG').'<br/>'.l10n('Register_FluxBB_Audit_OK'));
+  else
+    $msg_error_FluxBB2PWG = l10n('Register_FluxBB_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;
+}
+
+
+
+
+// +-----------------------------------------------------------------------+
+// |                            Actions process
+// +-----------------------------------------------------------------------+
+
+if ( isset($_GET['action']) and ($_GET['action']=='link_dead') and !is_adviser() )
+{
+  $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']) and !is_adviser() )
+{
+  $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']) and !is_adviser() )
+{
+  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']) and !is_adviser() )
+{
+  $query = "
+SELECT id AS id_pwg, username, password, mail_address 
+FROM ".USERS_TABLE."
+WHERE BINARY username = BINARY '".mysql_real_escape_string($_GET['username'])."'
+LIMIT 1
+;";
+
+  $data = mysql_fetch_array(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']) and !is_adviser() )
+{
+  $query = "
+SELECT id, username, password, mail_address 
+FROM ".USERS_TABLE."
+WHERE BINARY username = BINARY '".mysql_real_escape_string($_GET['username'])."'
+LIMIT 1
+;";
+
+  $data = mysql_fetch_array(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']) and !is_adviser() )
+{
+  FluxBB_Deluser( $_GET['id'], true );
+  
+  Audit_PWG_FluxBB();
+}
+
+
+// +-----------------------------------------------------------------------+
+// |                            Tabssheet select                           |
+// +-----------------------------------------------------------------------+
+
+switch ($page['tab'])
+{
+  case 'info':
+  
+  $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/info.tpl');
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
+	break;
+
+	case 'manage':
+  
+  if ( isset($_POST['submit']) and !is_adviser() 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']) )
+  {
+    $conf['Register_FluxBB'] = $_POST['FluxBB_prefix'].';'.addslashes($_POST['FluxBB_admin']).';'.addslashes($_POST['FluxBB_guest']).';'.$_POST['FluxBB_del_pt'].';'.$_POST['FluxBB_confirm'].';'.$_POST['FluxBB_details'];
+
+    $query = '
+UPDATE '.CONFIG_TABLE.'
+SET value="'.$conf['Register_FluxBB'].'"
+WHERE param="Register_FluxBB"
+LIMIT 1
+;';
+
+    pwg_query($query);
+
+    array_push($page['infos'], l10n('Register_FluxBB_save_config'));
+  }
+
+  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+
+  $template->assign(array(
+    '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"' : '' ,
+    )
+  );
+
+
+  $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/manage.tpl');
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
+	break;
+
+	case 'Migration':
+	
+  if ( isset($_POST['Migration']) and !is_adviser() )
+  {
+    array_push($page['infos'], l10n('Register_FluxBB_Mig_Start').'<br/><br/>');
+  
+    array_push($page['infos'], l10n('Register_FluxBB_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 = mysql_fetch_array($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('Register_FluxBB_Mig_Del_User').stripslashes($row['username']);
+        
+        FluxBB_Deluser($row['id'], false);
+      }
+    }
+
+    array_push($page['infos'], l10n('Register_FluxBB_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 = mysql_fetch_array($result))
+    {
+      if((stripslashes($row['username']) != 'guest') and (stripslashes($row['username']) != stripslashes($conf_Register_FluxBB[1])))
+      {
+        $msg_Mig_Add_AllUsers .= '<br/> - '.l10n('Register_FluxBB_Mig_Add_User').stripslashes($row['username']);
+
+        FluxBB_Adduser($row['id'], stripslashes($row['username']), $row['password'], $row['mail_address']);
+      }
+    }
+
+    array_push($page['infos'], l10n('Register_FluxBB_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 = mysql_fetch_array(pwg_query($query));
+
+    if (!empty($row))
+    {
+      array_push($page['infos'], l10n('Register_FluxBB_Sync_User').stripslashes($row['username']).'<br/><br/>');
+      
+      FluxBB_Updateuser($row['id'], stripslashes($row['username']), $row['password'], $row['mail_address']);
+    }
+
+    array_push($page['infos'], l10n('Register_FluxBB_Mig_End'));
+  }
+  else if ( isset($_POST['Audit']))
+  {
+    Audit_PWG_FluxBB();
+  }
+
+  $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/migration.tpl');
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
+	break;
+  
+	case 'Synchro':
+  
+  if ( isset($_POST['Synchro']) and !is_adviser() )
+  {
+    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 = mysql_fetch_array($result))
+      $msg_error_PWG_Dup .= '<br/>'.l10n('Register_FluxBB_Error_PWG_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']);
+
+      if ($msg_error_PWG_Dup <> '')
+        $msg_error_PWG_Dup = l10n('Register_FluxBB_Audit_PWG_Dup').$msg_error_PWG_Dup.'<br>'.l10n('Register_FluxBB_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 = mysql_fetch_array($result))
+    {
+      $msg_error_FluxBB_Dup .= '<br/>'.l10n('Register_FluxBB_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 = mysql_fetch_array($subresult))
+      {
+        $msg_error_FluxBB_Dup .= '<br/>id:'.$subrow['id'].'='.stripslashes($subrow['username']).' ('.$subrow['email'].')';
+  
+        if ( !is_adviser() )
+        {
+          $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('Register_FluxBB_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="'.Register_FluxBB_PATH.'/icon/user_delete.png" alt="'.l10n('Register_FluxBB_Del_User').stripslashes($subrow['username']).'" /></a>';
+        }
+      }
+    }
+
+    if ($msg_error_FluxBB_Dup <> '')
+      $msg_error_FluxBB_Dup = l10n('Register_FluxBB_Sync_Check_Dup').$msg_error_FluxBB_Dup.'<br>'.l10n('Register_FluxBB_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 = mysql_fetch_array($result))
+      {
+        $msg_error_Link_Break .= '<br/>'.l10n('Register_FluxBB_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('Register_FluxBB_Sync_Link_Break').'<br/>'.l10n('Register_FluxBB_Sync_OK'));
+      else
+        $msg_error_Link_Break = l10n('Register_FluxBB_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 = mysql_fetch_array($result))
+      {
+        $msg_error_Link_Bad .= '<br/>'.l10n('Register_FluxBB_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 = mysql_fetch_array(pwg_query($query));
+    
+      if ( !empty($Compteur) and $Compteur['nbr_dead'] > 0)
+      { 
+        $msg_error_Link_Bad .= '<br/>'.l10n('Register_FluxBB_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 = mysql_fetch_array($result))
+      {
+        $msg_error_Link_Bad .= '<br/>'.l10n('Register_FluxBB_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('Register_FluxBB_Sync_Link_Bad').'<br/>'.l10n('Register_FluxBB_Sync_OK'));
+      else
+        $msg_error_Link_Bad = l10n('Register_FluxBB_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 = mysql_fetch_array($result))
+      {
+        if ( ($row['pwg_pwd'] != $row['bb_pwd']) or ($row['pwg_eml'] != $row['bb_eml']) )
+        {
+          $msg_error_Synchro .= '<br/>'.l10n('Register_FluxBB_Sync_User').stripslashes($row['username']);
+  
+          $query = "
+SELECT id, username, password, mail_address 
+FROM ".USERS_TABLE."
+WHERE BINARY id = '".$row['pwg_id']."'
+;";
+
+          $data = mysql_fetch_array(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('Register_FluxBB_Sync_DataUser').'<br/>'.l10n('Register_FluxBB_Sync_OK'));
+      else
+        $msg_error_Synchro = l10n('Register_FluxBB_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 = mysql_fetch_array($result))
+      {
+        $msg_error_PWG2FluxBB .= '<br/>'.l10n('Register_FluxBB_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 = mysql_fetch_array(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('Register_FluxBB_Sync_PWG2FluxBB').'<br/>'.l10n('Register_FluxBB_Sync_OK'));
+      else
+        $msg_error_PWG2FluxBB = l10n('Register_FluxBB_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 = mysql_fetch_array($result))
+      {
+        $msg_error_FluxBB2PWG .= '<br/>'.l10n('Register_FluxBB_Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')';
+  
+        if ( !is_adviser() )
+        {
+          $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('Register_FluxBB_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="'.Register_FluxBB_PATH.'/icon/user_delete.png" alt="'.l10n('Register_FluxBB_Del_User').stripslashes($row['username']).'" /></a>';
+        }
+      }
+  
+      if ($msg_error_FluxBB2PWG == '')
+        array_push($page['infos'], l10n('Register_FluxBB_Sync_FluxBB2PWG').'<br/>'.l10n('Register_FluxBB_Sync_OK'));
+      else
+        $msg_error_FluxBB2PWG = l10n('Register_FluxBB_Sync_FluxBB2PWG').$msg_error_FluxBB2PWG;
+    }
+    else
+      $errors[] = l10n('Register_FluxBB_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->set_filename('plugin_admin_content', dirname(__FILE__) . '/synchro.tpl');
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');	
+
+	break;
+}
+?>
Index: /extensions/Register_FluxBB/tags/2.1.3/admin/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/admin/index.php	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/admin/index.php	(revision 4289)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Register_FluxBB/tags/2.1.3/admin/info.tpl
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/admin/info.tpl	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/admin/info.tpl	(revision 4289)
@@ -0,0 +1,8 @@
+<div class="titrePage">
+  <ul class="categoryActions">
+  
+  </ul>
+  <h2>{'Tab_Info'|@translate}</h2>
+</div>
+
+<div align="left" style="margin-left: 1em; margin-right: 1em;">{'Register_FluxBB_Disclaimer'|@translate}</div>
Index: /extensions/Register_FluxBB/tags/2.1.3/admin/manage.tpl
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/admin/manage.tpl	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/admin/manage.tpl	(revision 4289)
@@ -0,0 +1,48 @@
+<div class="titrePage">
+  <ul class="categoryActions">
+  
+  </ul>
+  <h2>{'Tab_Manage'|@translate}</h2>
+</div>
+
+<br>
+
+<form method="post" action={$FluxBB_F_ACTION}>
+  <fieldset>
+  	<legend>{'Register_FluxBB_Config_Title'|@translate}</legend>
+    <div align="left">{'Register_FluxBB_Config_Disclaimer'|@translate}</div>
+    <ul>
+    	<li><label>{'Register_FluxBB_Prefix'|@translate}</label><br>
+    		<input type="text" name="FluxBB_prefix" size="20" style="text-align: center;" value={$FluxBB_PREFIX}><br>
+    	</li>
+      <br>
+    	<li><label>{'Register_FluxBB_Admin'|@translate}</label><br>
+    		<input type="text" name="FluxBB_admin" value={$FluxBB_ADMIN} size="20" style="text-align: center;"><br>
+    		<label>{'Register_FluxBB_User'|@translate}</label><br>
+    	</li>
+      <br>
+    	<li><label>{'Register_FluxBB_Guest'|@translate}</label><br>
+    		<input type="text" name="FluxBB_guest" value={$FluxBB_GUEST} size="20" style="text-align: center;"><br>
+    	</li>
+      <br>
+    	<li><label>{'Register_FluxBB_Del_Pt'|@translate}</label><br>
+        <input type="radio" value="true" {$FluxBB_DEL_PT_TRUE} name="FluxBB_del_pt">{'Register_FluxBB_Del_Pt_true'|@translate}<br>
+        <input type="radio" value="false" {$FluxBB_DEL_PT_FALSE} name="FluxBB_del_pt">{'Register_FluxBB_Del_Pt_false'|@translate}<br>
+    	</li>
+      <br>
+    	<li><label>{'Register_FluxBB_Confirm'|@translate}</label><br>
+        <input type="radio" value="true" {$FluxBB_CONFIRM_TRUE} name="FluxBB_confirm">{'Register_FluxBB_Confirm_true'|@translate}<br>
+        <input type="radio" value="false" {$FluxBB_CONFIRM_FALSE} name="FluxBB_confirm">{'Register_FluxBB_Confirm_false'|@translate}<br>
+    	</li>
+      <br>
+    	<li><label>{'Register_FluxBB_Details'|@translate}</label><br>
+        <input type="radio" value="true" {$FluxBB_DETAILS_TRUE} name="FluxBB_details">{'Register_FluxBB_Details_true'|@translate}<br>
+        <input type="radio" value="false" {$FluxBB_DETAILS_FALSE} name="FluxBB_details">{'Register_FluxBB_Details_false'|@translate}<br>
+    	</li>
+    </ul>
+    <br>
+  	{'Register_FluxBB_No_Reg_advise'|@translate}
+    <br>
+  	<div align="center"><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}></div>
+  </fieldset>
+</form>
Index: /extensions/Register_FluxBB/tags/2.1.3/admin/migration.tpl
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/admin/migration.tpl	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/admin/migration.tpl	(revision 4289)
@@ -0,0 +1,19 @@
+<div class="titrePage">
+  <ul class="categoryActions">
+
+  </ul>
+  <h2>{'Tab_Migration'|@translate}</h2>
+</div>
+
+<br>
+
+<form method="post" action={$FluxBB_F_ACTION}>
+  <fieldset>
+  	<legend>{'Register_FluxBB_Mig_Title'|@translate}</legend>
+  	<div align="left">{'Register_FluxBB_Mig_Text'|@translate}</div>
+    <br>
+  	<div align="center"><input onclick="return confirm('{'Are you sure?'|@translate}');" class="submit" type="submit" value="{'Register_FluxBB_Mig_Btn'|@translate}" name="Migration" {$TAG_INPUT_ENABLED}></div>
+    <br>
+  	<div align="center">{'Register_FluxBB_Mig_Disclaimer'|@translate}</div>
+  </fieldset>
+</form>
Index: /extensions/Register_FluxBB/tags/2.1.3/admin/synchro.tpl
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/admin/synchro.tpl	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/admin/synchro.tpl	(revision 4289)
@@ -0,0 +1,17 @@
+<div class="titrePage">
+  <ul class="categoryActions">
+
+  </ul>
+  <h2>{'Tab_Synchro'|@translate}</h2>
+</div>
+
+<br>
+
+<form method="post" action={$FluxBB_F_ACTION}>
+  <fieldset>
+  	<legend>{'Register_FluxBB_Sync_Title'|@translate}</legend>
+  	<div align="left">{'Register_FluxBB_Sync_Text'|@translate}</div>
+    <br>
+  	<p><input {$FluxBB_CONFIRM_ENABLE} class="submit" type="submit" value="{'Register_FluxBB_Audit_Btn'|@translate}" name="Audit"> <input onclick="return confirm('{'Are you sure?'|@translate}');" {$FluxBB_CONFIRM_ENABLE} class="submit" type="submit" value="{'Register_FluxBB_Sync_Btn'|@translate}" name="Synchro" {$TAG_INPUT_ENABLED}></p>
+  </fieldset>
+</form>
Index: /extensions/Register_FluxBB/tags/2.1.3/icon/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/icon/index.php	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/icon/index.php	(revision 4289)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Register_FluxBB/tags/2.1.3/include/constants.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/include/constants.php	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/include/constants.php	(revision 4289)
@@ -0,0 +1,17 @@
+<?php
+
+global $prefixeTable, $conf;
+
+$conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+
+define('Register_FluxBB_ID_TABLE', $prefixeTable.'Register_FluxBB_id');
+
+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].'subscriptions');
+}
+?>
Index: /extensions/Register_FluxBB/tags/2.1.3/include/functions_Register_FluxBB.inc.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/include/functions_Register_FluxBB.inc.php	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/include/functions_Register_FluxBB.inc.php	(revision 4289)
@@ -0,0 +1,264 @@
+<?php
+
+function FluxBB_Linkuser($pwg_id, $bb_id)
+{
+  include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+  include_once (Register_FluxBB_PATH.'include/constants.php');
+
+  $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
+;";
+  
+  $data = mysql_fetch_array(pwg_query($query));
+  
+  if (!empty($data))
+  {
+    $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."
+  (id_user_pwg, id_user_FluxBB)
+VALUES (".$pwg_id.", ".$bb_id.")
+;";
+
+    $subresult = pwg_query($subquery);
+  }
+}
+
+
+
+function FluxBB_Unlinkuser($bb_id)
+{
+  include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+  include_once (Register_FluxBB_PATH.'include/constants.php');
+
+  $query = "
+DELETE FROM ".Register_FluxBB_ID_TABLE."
+WHERE id_user_FluxBB = ".$bb_id."
+;";
+
+  $result = pwg_query($query);
+}
+
+
+
+function FluxBB_Adduser($pwg_id, $login, $password, $adresse_mail)
+{
+  include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+  include_once (Register_FluxBB_PATH.'include/constants.php');
+
+  global $conf;
+
+  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+
+  $registred = time();
+  $registred_ip = $_SERVER['REMOTE_ADDR'];
+
+  $query = "
+SELECT conf_value
+FROM ".FluxBB_CONFIG_TABLE."
+WHERE conf_name = 'o_default_user_group'
+;";
+
+  $o_default_user_group = mysql_fetch_array(pwg_query($query));
+  
+  $query = "
+SELECT conf_value
+FROM ".FluxBB_CONFIG_TABLE."
+WHERE conf_name = 'o_server_timezone'
+;";
+
+  $o_server_timezone = mysql_fetch_array(pwg_query($query));
+  
+  $query = "
+SELECT conf_value
+FROM ".FluxBB_CONFIG_TABLE."
+WHERE conf_name = 'o_default_lang'
+;";
+
+  $o_default_lang = mysql_fetch_array(pwg_query($query));
+  
+  $query = "
+SELECT conf_value
+FROM ".FluxBB_CONFIG_TABLE."
+WHERE conf_name = 'o_default_style'
+;";
+
+  $o_default_style = mysql_fetch_array(pwg_query($query));
+  
+  $query = '
+INSERT INTO '.FluxBB_USERS_TABLE." (
+  username, 
+  ". ( isset($o_default_user_group['conf_value']) ? 'group_id' : '' ) .",
+  password, 
+  email, 
+  ". ( isset($o_server_timezone['conf_value']) ? 'timezone' : '' ) .",
+  ". ( isset($o_default_lang['conf_value']) ? 'language' : '' ) .",
+  ". ( isset($o_default_style['conf_value']) ? 'style' : '' ) .",
+  registered, 
+  registration_ip, 
+  last_visit
+  )
+VALUES(
+  '".mysql_real_escape_string($login)."',
+  ". ( isset($o_default_user_group['conf_value']) ? "'".$o_default_user_group['conf_value']."'" : '' ) .",
+  '".$password."', 
+	'".$adresse_mail."',
+  ". ( isset($o_server_timezone['conf_value']) ? "'".$o_server_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);
+
+  $bb_id = mysql_insert_id();
+  
+  FluxBB_Linkuser($pwg_id, $bb_id);
+}
+
+
+
+function FluxBB_Searchuser($id_user_pwg)
+{
+  include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+  include_once (Register_FluxBB_PATH.'include/constants.php');
+
+  $query = "
+SELECT id_user_FluxBB, id_user_pwg FROM ".Register_FluxBB_ID_TABLE."
+WHERE id_user_pwg = ".$id_user_pwg."
+LIMIT 1
+;";
+
+  $data = mysql_fetch_array(pwg_query($query));
+  
+  if (!empty($data))
+    return $data['id_user_FluxBB'];
+  else
+    return '0';  
+}
+
+
+
+function FluxBB_Deluser($id_user_FluxBB, $SuppTopicsPosts)
+{
+  include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+  include_once (Register_FluxBB_PATH.'include/constants.php');
+
+  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."
+LIMIT 1
+;";
+
+  $data0 = mysql_fetch_array(pwg_query($query0));
+
+  // Si égale à VRAI, suppression de tous les posts et topics
+  if ($SuppTopicsPosts and $conf_Register_FluxBB[3])
+  {
+    // Suppression des posts de cet utilisateur
+    $subquery = "
+DELETE FROM ".FluxBB_POSTS_TABLE."
+WHERE poster_id = ".$id_user_FluxBB."
+;";
+
+    $subresult = pwg_query($subquery);
+
+    // Suppression des topics de cet utilisateur
+    $subquery = "
+DELETE FROM ".FluxBB_TOPICS_TABLE."
+WHERE BINARY poster = BINARY '".mysql_real_escape_string($data0['username'])."'
+;";
+
+    $subresult = pwg_query($subquery);
+  }
+
+  // Suppression des abonnements de l'utilisateur
+  $subquery = "
+DELETE FROM ".FluxBB_SUBSCRIPTIONS_TABLE."
+WHERE user_id = ".$id_user_FluxBB."
+;";
+
+  $subresult = pwg_query($subquery);
+  
+  // Suppression du compte utilisateur
+  $subquery = "
+DELETE FROM ".FluxBB_USERS_TABLE."
+WHERE id = ".$id_user_FluxBB."
+;";
+
+  $subresult = pwg_query($subquery);
+
+  FluxBB_Unlinkuser($id_user_FluxBB);
+}
+
+
+
+function FluxBB_Updateuser($pwg_id, $username, $password, $adresse_mail)
+{
+  include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+  include_once (Register_FluxBB_PATH.'include/constants.php');
+  include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
+
+  $query = "
+SELECT id_user_FluxBB as FluxBB_id
+FROM ".Register_FluxBB_ID_TABLE."
+WHERE id_user_pwg = ".$pwg_id."
+;";
+
+  $row = mysql_fetch_array(pwg_query($query));
+
+  if (!empty($row))
+  {
+    $query = "
+UPDATE ".FluxBB_USERS_TABLE."
+SET username = '".mysql_real_escape_string($username)."', email = '".$adresse_mail."', password = '".$password."' 
+WHERE id = ".$row['FluxBB_id']."
+;";
+   
+    $result = pwg_query($query);
+      
+    FluxBB_Linkuser($pwg_id, $row['FluxBB_id']);
+  }
+  else
+  {
+    $query = "
+SELECT id as FluxBB_id
+FROM ".FluxBB_USERS_TABLE."
+WHERE BINARY username = BINARY '".mysql_real_escape_string($username)."'
+;";
+
+    $row = mysql_fetch_array(pwg_query($query));
+  
+    if (!empty($row))
+    {
+      $query = "
+UPDATE ".FluxBB_USERS_TABLE."
+SET username = '".mysql_real_escape_string($username)."', email = '".$adresse_mail."', password = '".$password."' 
+WHERE id = ".$row['FluxBB_id']."
+;";
+     
+      $result = pwg_query($query);
+      
+      FluxBB_Linkuser($pwg_id, $row['FluxBB_id']);
+    }
+  }
+}
+?>
Index: /extensions/Register_FluxBB/tags/2.1.3/include/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/include/index.php	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/include/index.php	(revision 4289)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Register_FluxBB/tags/2.1.3/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/index.php	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/index.php	(revision 4289)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Register_FluxBB/tags/2.1.3/language/en_UK/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/language/en_UK/index.php	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/language/en_UK/index.php	(revision 4289)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Register_FluxBB/tags/2.1.3/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/language/en_UK/plugin.lang.php	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/language/en_UK/plugin.lang.php	(revision 4289)
@@ -0,0 +1,127 @@
+<?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['Register_FluxBB_Title'] = 'Register FluxBB';
+$lang['Register_FluxBB_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/>
+  <b><blink>WARNING !! For safety, consider making a backup of your database, especially ###_user tables before any action.</blink></b>';
+
+
+$lang['Register_FluxBB_Config_Title'] = 'Plugin setup';
+$lang['Register_FluxBB_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['Register_FluxBB_FluxBB_Prefix'] = 'FluxBB Prefix tables :';
+$lang['Register_FluxBB_FluxBB_Admin'] = 'Username of the Piwigo administrator.';
+$lang['Register_FluxBB_Register_FluxBB_Guest'] = 'Username of the FluxBB Guest user.';
+$lang['Register_FluxBB_Register_FluxBB_User'] = '<b><u>FluxBB\'s administrator name must be the same</u></b>';
+$lang['Register_FluxBB_Details'] = 'Level of detail in reports of operations.';
+$lang['Register_FluxBB_Details_true'] = ' --&gt; View all details of the results of operations.';
+$lang['Register_FluxBB_Details_false'] = ' --&gt; Shows that most of the results of operations';
+$lang['Register_FluxBB_Del_Pt'] = 'Removal of topics and posts when the user is deleted.';
+$lang['Register_FluxBB_Del_Pt_true'] = ' --&gt; Delete all';
+$lang['Register_FluxBB_Del_Pt_false'] = ' --&gt; Don\'t delete topics and posts';
+$lang['Register_FluxBB_Confirm'] = 'Delete confirmation on the administration actions in the audit.';
+$lang['Register_FluxBB_Confirm_true'] = ' --&gt; Delete confirmation';
+$lang['Register_FluxBB_Confirm_false'] = ' --&gt; Confirmation mandatory before actions in audit';
+$lang['Register_FluxBB_No_Reg_advise'] = '<b>About the registration of users on the forum FluxBB</b><br/><br/>
+  For easiest way for your users, I advise you to change 2 things:<br/>
+  * In FluxBB\'s administration panel, change "Allow new registrations" to NO (in: Options - Registration)<br/><br/>
+  * Modify the file</b> : [FluxBBRoot]/lang/English/register.php<br/>
+  <b>By replacing the following line :</b><br/><br/>
+  \'No new regs\'				=>	\'This forum is not accepting new users.\',<br/><br/>
+  <b>with :</b><br/><br/>
+  \'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;\',<br/>
+  <br/>
+  Of course you should also make the same change for other languages of your FluxBB forum.<br/>';
+
+$lang['Register_FluxBB_save_config'] ='Settings saved';
+
+
+$lang['Register_FluxBB_Audit_Btn'] = 'Audit';
+$lang['Register_FluxBB_Sync_Btn'] = 'Synchronization';
+$lang['Register_FluxBB_Sync_Title'] = 'Synchronize accounts from Piwigo to FluxBB';
+$lang['Register_FluxBB_Sync_Text'] = '
+  <b><u>You\'ve already used the plugin to link your Piwigo (plugin update) and / or your FluxBB forum is not empty of users!</u></b><br/>
+  <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['Register_FluxBB_Sync_Check_Dup'] = '<b>Analyzing tables of user accounts of Piwigo and FluxBB to control duplicates</b>';
+$lang['Register_FluxBB_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['Register_FluxBB_Sync_Link_Break'] = '<b>Analysis of repairable links between accounts in Piwigo and FluxBB</b>';
+$lang['Register_FluxBB_Sync_Link_Bad'] = '<b>Analysis of bad relationships between accounts in Piwigo and FluxBB</b>';
+$lang['Register_FluxBB_Sync_DataUser'] = '<b>Analysis of passwords and email addresses between accounts in Piwigo and FluxBB</b>';
+$lang['Register_FluxBB_Sync_PWG2FluxBB'] = '<b>Analysis of existing accounts in Piwigo and missing in FluxBB</b>';
+$lang['Register_FluxBB_Sync_FluxBB2PWG'] = '<b>Analysis of existing accounts in FluxBB and missing in Piwigo</b>';
+$lang['Register_FluxBB_Sync_OK'] = 'Synchronization OK<br/><br/>';
+
+$lang['Register_FluxBB_Audit_PWG_Dup'] = '<b>Audit of Piwigo\'s accounts table</b>';
+$lang['Register_FluxBB_Error_PWG_Dup'] = '<b>Error in Piwigo\'s accounts table, there are duplicates:</b> ';
+$lang['Register_FluxBB_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['Register_FluxBB_Audit_FluxBB_Dup'] = '<b>Audit of FluxBB\'s accounts table</b>';
+$lang['Register_FluxBB_Error_FluxBB_Dup'] = '<b>Error in FluxBB\'s accounts table, there are duplicates:</b> ';
+$lang['Register_FluxBB_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['Register_FluxBB_Audit_Link_Break'] = '<b>Audit of repairable links between Piwigo and FluxBB accounts</b>';
+$lang['Register_FluxBB_Error_Link_Break'] = '<b>Broken link between Piwigo and FluxBB accounts:</b> ';
+$lang['Register_FluxBB_New_Link'] = 'Account linked: ';
+
+$lang['Register_FluxBB_Audit_Link_Bad'] = '<b>Audit of bad links between Piwigo and FluxBB accounts</b>';
+$lang['Register_FluxBB_Error_Link_Del'] = '<b>Error in the link table between 2 users:</b> ';
+$lang['Register_FluxBB_Link_Del'] = 'Remove of link: ';
+$lang['Register_FluxBB_Error_Link_Dead'] = '<b>Error in the link table, dead links:</b> ';
+$lang['Register_FluxBB_Link_Dead'] = 'Remove of dead links ';
+$lang['Register_FluxBB_Error_Link_Dup'] = '<b>Error in the link table, there are duplicates:</b> ';
+$lang['Register_FluxBB_Link_Dup'] = 'Remove of duplicates ';
+
+$lang['Register_FluxBB_Audit_Synchro'] = '<b>Audit of the synchronization of passwords and email addresses between Piwigo and FluxBB accounts</b>';
+$lang['Register_FluxBB_Error_Synchro'] = '<b>Bad synchronization of account:</b> ';
+$lang['Register_FluxBB_Error_Synchro_Pswd'] = 'on password';
+$lang['Register_FluxBB_Error_Synchro_Mail'] = 'on email address';
+$lang['Register_FluxBB_Audit_Synchro_OK'] = ' <b>: Data synchronization OK</b>';
+$lang['Register_FluxBB_Sync_User'] = 'Account synchronization : ';
+
+$lang['Register_FluxBB_Audit_PWG2FluxBB'] = '<b>Audit of the existing accounts in Piwigo and missing in FluxBB</b>';
+$lang['Register_FluxBB_Error_PWG2FluxBB'] = '<b>The Piwigo account not in FluxBB:</b> ';
+$lang['Register_FluxBB_Add_User'] = 'Adding in FluxBB of account: ';
+
+$lang['Register_FluxBB_Audit_FluxBB2PWG'] = '<b>Audit of the existing accounts in FluxBB and missing in Piwigo</b>';
+$lang['Register_FluxBB_Error_FluxBB2PWG'] = '<b>The FluxBB account not in Piwigo:</b> ';
+$lang['Register_FluxBB_Del_User'] = 'Removal from FluxBB of account : ';
+
+$lang['Register_FluxBB_Audit_OK'] = 'Audit OK<br/><br/>';
+
+$lang['Register_FluxBB_Mig_Btn'] = 'Migration';
+$lang['Register_FluxBB_Mig_Title'] = 'Migration of accounts from Piwigo to FluxBB';
+$lang['Register_FluxBB_Mig_Text'] = '
+  <b><u>!!! USE ONLY IF</u> you have never used the plugin to link Piwigo to FluxBB <u>AND IF</u> your forum is empty of users !!!</b><br/><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/>
+  <center><b>!!! WARNING IF YOU HAVE ANY SPECIAL ACCOUNTS IN FluxBB == DO NOT USE THIS FUNCTION !!!</b></center><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['Register_FluxBB_Mig_Disclaimer'] = '<b><blink>!!! NEVER PERFORM MIGRATION FOR UPDATING !!!</blink></b>';
+$lang['Register_FluxBB_Mig_Start'] = '<b>Migration of accounts from Piwigo to FluxBB</b>';
+$lang['Register_FluxBB_Mig_Del_Link'] = '<b>Deleting links between accounts of Piwigo and FluxBB</b>';
+$lang['Register_FluxBB_Mig_Del_AllUsers'] = '<b>Deleting FluxBB accounts</b>';
+$lang['Register_FluxBB_Mig_Del_User'] = '<b>Deletion of the account:</b> ';
+$lang['Register_FluxBB_Mig_Add_AllUsers'] = '<b>Transferring Piwigo accounts</b>';
+$lang['Register_FluxBB_Mig_Add_User'] = '<b>Transfer of account:</b> ';
+$lang['Register_FluxBB_Mig_End'] = '<b>Migration done !</b>';
+?>
Index: /extensions/Register_FluxBB/tags/2.1.3/language/fr_FR/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/language/fr_FR/index.php	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/language/fr_FR/index.php	(revision 4289)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Register_FluxBB/tags/2.1.3/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/language/fr_FR/plugin.lang.php	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/language/fr_FR/plugin.lang.php	(revision 4289)
@@ -0,0 +1,124 @@
+<?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['Register_FluxBB_Title'] = 'Register FluxBB';
+$lang['Register_FluxBB_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/>
+  <b><blink>PENSEZ A ... faire une sauvegarde de votre base et spécialement de vos tables ###_USERS avant toutes actions par mesure de sécurité.</blink></b>';
+
+$lang['Register_FluxBB_Config_Title'] = 'Configuration du plugin';
+$lang['Register_FluxBB_Config_Disclaimer'] = '
+  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['Register_FluxBB_Prefix'] = 'Préfixe des tables de FluxBB :';
+$lang['Register_FluxBB_Admin'] = 'Nom d\'utilisateur de l\'administrateur de Piwigo.';
+$lang['Register_FluxBB_Guest'] = 'Nom d\'utilisateur de l\'invité de FluxBB.';
+$lang['Register_FluxBB_User'] = '<b><u>Le nom de l\'administrateur de FluxBB doit être identique</u></b>';
+$lang['Register_FluxBB_Details'] = 'Niveau de détails dans les rapports d\'opérations.';
+$lang['Register_FluxBB_Details_true'] = ' --&gt; Afficher tous les détails des résultats sur les opérations.';
+$lang['Register_FluxBB_Details_false'] = ' --&gt; N\'affiche que l\'essentiel des résultats sur les opérations';
+$lang['Register_FluxBB_Del_Pt'] = 'Suppression des topics et posts de l\'utilisateur lorsqu\'il est supprimé.';
+$lang['Register_FluxBB_Del_Pt_true'] = ' --&gt; Supprime tout';
+$lang['Register_FluxBB_Del_Pt_false'] = ' --&gt; Ne supprime pas les posts et les topics';
+$lang['Register_FluxBB_Confirm'] = 'Suppression des confirmations sur les actions d\'administration dans l\'audit.';
+$lang['Register_FluxBB_Confirm_true'] = ' --&gt; Supprime les confirmations';
+$lang['Register_FluxBB_Confirm_false'] = ' --&gt; Confirmation obligatoire avant action dans l\'audit';
+$lang['Register_FluxBB_No_Reg_advise'] = '<b>A propos de l\'enregistrement d\'utilisateur sur le forum FluxBB</b><br/><br/>
+  Pour plus de facilité pour vos utilisateurs, je vous conseille de modifier 2 choses :<br/>
+  * modifier dans l\'interface d\'administration de FluxBB "Autoriser les nouvelles inscriptions" à NON ( dans : Options - Inscriptions )<br/><br/>
+  * modifier le fichier</b> : [RacineDeFluxBB]/lang/French/register.php<br/>
+  <b>en remplacant la ligne suivante :</b><br/><br/>
+  \'No new regs\'				=>	\'Ce forum n\\\'accepte pas de nouveaux utilisateurs.\',<br/><br/>
+  <b>par :</b><br/><br/>
+  \'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;\',<br/>
+  <br/>
+  Bien sur vous devez aussi faire le même changement pour les autres langues de votre forum FluxBB.<br/>';
+
+$lang['Register_FluxBB_save_config'] ='Configuration enregistrée.';
+
+$lang['Register_FluxBB_Audit_Btn'] = 'Audit';
+$lang['Register_FluxBB_Sync_Btn'] = 'Synchronisation';
+$lang['Register_FluxBB_Sync_Title'] = 'Synchronisation des comptes Piwigo vers FluxBB';
+$lang['Register_FluxBB_Sync_Text'] = '
+  <b><u>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 !!!</u></b><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['Register_FluxBB_Sync_Check_Dup'] = '<b>Analyse des tables des comptes utilisateurs de Piwigo et FluxBB pour contrôler les doublons</b>';
+$lang['Register_FluxBB_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/>';
+$lang['Register_FluxBB_Sync_Link_Break'] = '<b>Analyse des liens réparables entre les comptes Piwigo et FluxBB</b>';
+$lang['Register_FluxBB_Sync_Link_Bad'] = '<b>Analyse des mauvais liens entre les comptes Piwigo et FluxBB</b>';
+$lang['Register_FluxBB_Sync_DataUser'] = '<b>Analyse des mots de passe et des adresses emails entre les comptes Piwigo et FluxBB</b>';
+$lang['Register_FluxBB_Sync_PWG2FluxBB'] = '<b>Analyse des comptes existants dans Piwigo et manquants dans FluxBB</b>';
+$lang['Register_FluxBB_Sync_FluxBB2PWG'] = '<b>Analyse des comptes existants dans FluxBB et manquants dans Piwigo</b>';
+$lang['Register_FluxBB_Sync_OK'] = 'Synchronisation OK<br/><br/>';
+
+$lang['Register_FluxBB_Audit_PWG_Dup'] = '<b>Audit de la table des comptes de Piwigo</b>';
+$lang['Register_FluxBB_Error_PWG_Dup'] = '<b>Erreur dans la table des comptes Piwigo, il y a des doublons :</b> ';
+$lang['Register_FluxBB_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['Register_FluxBB_Audit_FluxBB_Dup'] = '<b>Audit de la table des comptes FluxBB</b>';
+$lang['Register_FluxBB_Error_FluxBB_Dup'] = '<b>Erreur dans la table des comptes FluxBB, il y a des doublons :</b> ';
+$lang['Register_FluxBB_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['Register_FluxBB_Audit_Link_Break'] = '<b>Audit des liens réparables entre les comptes Piwigo et FluxBB</b>';
+$lang['Register_FluxBB_Error_Link_Break'] = '<b>Lien brisé entre les comptes Piwigo et FluxBB :</b> ';
+$lang['Register_FluxBB_New_Link'] = 'Liaison du compte : ';
+
+$lang['Register_FluxBB_Audit_Link_Bad'] = '<b>Audit des mauvais liens entre les comptes Piwigo et FluxBB</b>';
+$lang['Register_FluxBB_Error_Link_Del'] = '<b>Erreur dans la table de lien entre les 2 utilisateurs :</b> ';
+$lang['Register_FluxBB_Link_Del'] = 'Suppression du lien : ';
+$lang['Register_FluxBB_Error_Link_Dead'] = '<b>Erreur dans la table de lien, des liens morts existent :</b> ';
+$lang['Register_FluxBB_Link_Dead'] = 'Suppression du liens morts ';
+$lang['Register_FluxBB_Error_Link_Dup'] = '<b>Erreur dans la table de lien, il y a des doublons :</b> ';
+$lang['Register_FluxBB_Link_Dup'] = 'Suppression des liens dupliqués ';
+
+$lang['Register_FluxBB_Audit_Synchro'] = '<b>Audit de la synchronisation des mots de passe et des adresses emails entre les comptes Piwigo et FluxBB</b>';
+$lang['Register_FluxBB_Error_Synchro'] = '<b>Mauvaise synchronisation du compte :</b> ';
+$lang['Register_FluxBB_Error_Synchro_Pswd'] = 'pour le mot de passe';
+$lang['Register_FluxBB_Error_Synchro_Mail'] = 'pour l\'adresse email';
+$lang['Register_FluxBB_Audit_Synchro_OK'] = ' <b>: Synchro des données OK</b>';
+$lang['Register_FluxBB_Sync_User'] = 'Synchronisation du compte : ';
+
+$lang['Register_FluxBB_Audit_PWG2FluxBB'] = '<b>Audit des comptes existants dans Piwigo et manquants dans FluxBB</b>';
+$lang['Register_FluxBB_Error_PWG2FluxBB'] = '<b>Le compte Piwigo n\'existe pas dans FluxBB :</b> ';
+$lang['Register_FluxBB_Add_User'] = 'Ajout dans FluxBB du compte : ';
+
+$lang['Register_FluxBB_Audit_FluxBB2PWG'] = '<b>Audit des comptes existants dans FluxBB et manquants dans Piwigo</b>';
+$lang['Register_FluxBB_Error_FluxBB2PWG'] = '<b>Le compte FluxBB n\'existe pas dans Piwigo :</b> ';
+$lang['Register_FluxBB_Del_User'] = 'Suppression de FluxBB du compte : ';
+
+$lang['Register_FluxBB_Audit_OK'] = 'Audit OK<br/><br/>';
+
+$lang['Register_FluxBB_Mig_Btn'] = 'Migration';
+$lang['Register_FluxBB_Mig_Title'] = 'Migration des comptes de Piwigo vers FluxBB';
+$lang['Register_FluxBB_Mig_Text'] = '
+  <b><u>!!! A N\'UTILISER QUE SI</u> vous n\'avez jamais utilisé le plugin pour lier Piwigo à FluxBB <u>ET SI</u> votre forum est vide d\'utilisateurs !!!</b><br/><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/>
+  <center><b>!!! ATTENTION SI VOUS AVEZ DES COMPTES PARTICULIERS DANS FluxBB == NE SURTOUT PAS UTILISER CETTE FONCTION !!!</b></center><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['Register_FluxBB_Mig_Disclaimer'] = '<b><blink>!!! NE JAMAIS EFFECTUER DE MIGRATION POUR METTRE A JOUR !!!</blink></b>';
+$lang['Register_FluxBB_Mig_Start'] = '<b>Migration des comptes Piwigo vers FluxBB</b>';
+$lang['Register_FluxBB_Mig_Del_Link'] = '<b>Suppression des liens entre les comptes Piwigo et FluxBB</b>';
+$lang['Register_FluxBB_Mig_Del_AllUsers'] = '<b>Suppression des comptes FluxBB</b>';
+$lang['Register_FluxBB_Mig_Del_User'] = '<b>Suppression du compte :</b> ';
+$lang['Register_FluxBB_Mig_Add_AllUsers'] = '<b>Transfert des comptes Piwigo</b>';
+$lang['Register_FluxBB_Mig_Add_User'] = '<b>Transfert du compte :</b> ';
+$lang['Register_FluxBB_Mig_End'] = '<b>Migration finie !</b>';
+?>
Index: /extensions/Register_FluxBB/tags/2.1.3/language/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/language/index.php	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/language/index.php	(revision 4289)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/Register_FluxBB/tags/2.1.3/main.inc.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/main.inc.php	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/main.inc.php	(revision 4289)
@@ -0,0 +1,183 @@
+<?php
+/*
+Plugin Name: Register FluxBB
+Version: 2.1.3
+Description: Link user registration from Piwigo to FluxBB forum (registration, password changing, deletion) - Original Nicco's NBC_LinkUser2PunBB plugin upgraded to Piwigo / Liez l'inscription des utilisateurs de Piwigo avec votre forum FluxBB - Portage du plugin NBC_LinkUser2PunBB de Nicco vers Piwigo
+Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=252
+Author: Eric
+Author URI: http://www.infernoweb.net
+*/
+
+/*
+--------------------------------------------------------------------------------
+  Author     : Eric
+    email    : lucifer@infernoweb.net
+    website  : http://www.infernoweb.net
+    PWG user : http://forum.phpwebgallery.net/profile.php?id=1106
+--------------------------------------------------------------------------------
+
+:: HISTORY
+
+2.0.0b		- 23/11/08  - Initial release. Basic changes to be available for Piwigo 2.0RC4
+
+2.0.1b 		- 24/11/08  - Small bug correction on submit button display
+
+2.0.2			- 19/02/09	- Language pack correction
+
+2.1.0			- 25/04/09  - Admin panel with tabsheets
+                      - Radio buttons functionnalities corrections (now radio buttons show the configuration saved in database)
+                      - Language files (fr - en) improvement
+
+2.1.1			- 30/04/09	- Bug fixed on profile update
+
+2.1.2			- 22/08/09	- Compatibility bug fixed when used with DynamicRecentPeriod plugin
+
+2.1.3     - 16/11/09  - Using sha1 hash instead of md5 for password hashing in FluxBB
+                      - Escaping all characters in login names and be able to retreive them without slashes - FluxBB does not allow this so Piwigo's user names with escaped characters will not been escaped in FluxBB (ie : "it's" in Piwigo will be "It\'s" in FluxBB)
+                      - Code refactoring
+                      - Full HTML 4.0 for tpl
+
+--------------------------------------------------------------------------------
+*/
+
+// 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!');
+
+define('Register_FluxBB_DIR' , basename(dirname(__FILE__)));
+define('Register_FluxBB_PATH' , PHPWG_PLUGINS_PATH . Register_FluxBB_DIR . '/');
+include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+
+/* plugin administration */
+add_event_handler('get_admin_plugin_menu_links', 'Register_FluxBB_admin_menu');
+
+function Register_FluxBB_admin_menu($menu)
+{
+  array_push($menu, array(
+    'NAME' => 'Register FluxBB',
+    'URL'  => get_admin_plugin_menu_link(Register_FluxBB_PATH.'admin/Register_FluxBB_admin.php')));
+  return $menu;
+}
+
+
+/* user creation*/
+add_event_handler('register_user', 'Register_FluxBB_Adduser');
+
+function Register_FluxBB_Adduser($register_user)
+{
+  global $conf;
+	
+  include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+
+  // Warning : FluxBB uses Sha1 hash instead of md5 for Piwigo !
+  FluxBB_Adduser($register_user['id'], $register_user['username'], sha1($_POST['password']), $register_user['email']);
+}
+
+
+/* user deletion */
+add_event_handler('delete_user', 'Register_FluxBB_Deluser');
+
+function Register_FluxBB_Deluser($user_id)
+{
+  include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+
+  FluxBB_Deluser( FluxBB_Searchuser($user_id), true );
+}
+
+
+
+add_event_handler('init', 'Register_FluxBB_InitPage');
+ 
+function Register_FluxBB_InitPage()
+{
+  global $conf, $user ;
+  include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+
+/* user update */
+  if (script_basename() == 'profile')
+  {
+    if (isset($_POST['validate']))
+    {
+      $errors = array();
+
+      $int_pattern = '/^\d+$/';
+      if (empty($_POST['nb_image_line'])
+        or (!preg_match($int_pattern, $_POST['nb_image_line'])))
+      {
+        $errors[] = l10n('nb_image_line_error');
+      }
+    
+      if (empty($_POST['nb_line_page'])
+        or (!preg_match($int_pattern, $_POST['nb_line_page'])))
+      {
+        $errors[] = l10n('nb_line_page_error');
+      }
+    
+      if ($_POST['maxwidth'] != ''
+        and (!preg_match($int_pattern, $_POST['maxwidth'])
+        or $_POST['maxwidth'] < 50))
+      {
+        $errors[] = l10n('maxwidth_error');
+      }
+
+      if ($_POST['maxheight']
+        and (!preg_match($int_pattern, $_POST['maxheight'])
+        or $_POST['maxheight'] < 50))
+      {
+        $errors[] = l10n('maxheight_error');
+      }
+
+      if (isset($_POST['mail_address']))
+      {
+        $mail_error = validate_mail_address($user['id'],$_POST['mail_address']);
+        if (!empty($mail_error))
+        {
+          $errors[] = $mail_error;
+        }
+      }
+    
+      if (!empty($_POST['use_new_pwd']))
+      {
+        // password must be the same as its confirmation
+        if ($_POST['use_new_pwd'] != $_POST['passwordConf'])
+        {
+          $errors[] = l10n('New password confirmation does not correspond');
+        }
+    
+        if ( !defined('IN_ADMIN') )
+        {// changing password requires old password
+          $query = '
+SELECT '.$conf['user_fields']['password'].' AS password
+FROM '.USERS_TABLE.'
+WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+;';
+
+          list($current_password) = mysql_fetch_row(pwg_query($query));
+      
+          if ($conf['pass_convert']($_POST['password']) != $current_password)
+          {
+            $errors[] = l10n('Current password is wrong');
+          }
+        }
+      }
+    
+      if (count($errors) == 0)
+      {
+        include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+      
+        $query = '
+SELECT '.$conf['user_fields']['username'].' AS username
+FROM '.USERS_TABLE.'
+WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+;';
+
+        list($username) = mysql_fetch_row(pwg_query($query));
+
+        FluxBB_Updateuser($user['id'], stripslashes($username), sha1($_POST['use_new_pwd']), $_POST['mail_address']);
+      }
+    }
+  }
+}
+?>
Index: /extensions/Register_FluxBB/tags/2.1.3/maintain.inc.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.1.3/maintain.inc.php	(revision 4289)
+++ /extensions/Register_FluxBB/tags/2.1.3/maintain.inc.php	(revision 4289)
@@ -0,0 +1,61 @@
+<?php
+
+define('Register_FluxBB_DIR' , basename(dirname(__FILE__)));
+define('Register_FluxBB_PATH' , PHPWG_PLUGINS_PATH . Register_FluxBB_DIR . '/');
+
+//ini_set('error_reporting', E_ALL);
+//ini_set('display_errors', true);
+
+include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+include_once (Register_FluxBB_PATH.'include/constants.php');
+
+
+
+function plugin_install()
+{
+  global $prefixeTable;
+
+  $q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true","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',
+PRIMARY KEY  (id_user_pwg),
+  KEY id_user_pwg (id_user_pwg, id_user_FluxBB)
+)
+;";
+
+  pwg_query($q);
+
+}
+
+function plugin_activate()
+{
+
+}
+
+function plugin_uninstall()
+{
+  global $conf;
+
+  if (isset($conf['Register_FluxBB']))
+  {
+    $q = '
+DELETE FROM '.CONFIG_TABLE.'
+WHERE param="Register_FluxBB" LIMIT 1
+;';
+
+    pwg_query($q);
+  }
+  
+  $q = 'DROP TABLE '.Register_FluxBB_ID_TABLE.';';
+  pwg_query( $q );
+
+}
+?>
