Index: /extensions/Register_FluxBB/tags/2.3.0/admin/admin.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/admin/admin.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/admin/admin.php	(revision 6817)
@@ -0,0 +1,1085 @@
+<?php
+
+global $user, $lang, $conf, $template, $errors;
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+if (!defined('REGFLUXBB_PATH')) define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+
+//ini_set('error_reporting', E_ALL);
+//ini_set('display_errors', true);
+
+include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+
+$my_base_url = get_admin_plugin_menu_link(__FILE__);
+load_language('plugin.lang', REGFLUXBB_PATH);
+
+// +-----------------------------------------------------------------------+
+// |                            Tabssheet                                  |
+// +-----------------------------------------------------------------------+
+if (!isset($_GET['tab']))
+  $page['tab'] = 'info';
+else
+  $page['tab'] = $_GET['tab'];
+
+$tabsheet = new tabsheet();
+$tabsheet->add('info',
+            l10n('Tab_Info'),
+            $my_base_url.'&amp;tab=info');
+$tabsheet->add('manage',
+            l10n('Tab_Manage'),
+            $my_base_url.'&amp;tab=manage');
+$tabsheet->add('Migration',
+            l10n('Tab_Migration'),
+            $my_base_url.'&amp;tab=Migration');
+$tabsheet->add('Synchro',
+            l10n('Tab_Synchro'),
+            $my_base_url.'&amp;tab=Synchro');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+
+$page['infos'] = array();
+$error = array();
+
+// +-----------------------------------------------------------------------+
+// |                      Getting plugin version                           |
+// +-----------------------------------------------------------------------+
+$plugin =  RegFluxBB_Infos(REGFLUXBB_PATH);
+$version = $plugin['version'] ;
+
+// +-----------------------------------------------------------------------+
+// |                            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 = pwg_db_fetch_assoc($result))
+    $msg_error_PWG_Dup .= '<br>'.l10n('Error_PWG_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']);
+
+  if ($msg_error_PWG_Dup == '')
+    array_push($page['infos'], l10n('Audit_PWG_Dup').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_PWG_Dup = l10n('Audit_PWG_Dup').$msg_error_PWG_Dup.'<br>'.l10n('Advise_PWG_Dup');
+  
+
+
+  $query = "
+SELECT COUNT(*) AS nbr_dup, username
+FROM ".FluxBB_USERS_TABLE." 
+GROUP BY BINARY username
+HAVING COUNT(*) > 1
+;";
+  $result = pwg_query($query);
+  
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    $msg_error_FluxBB_Dup .= '<br>'.l10n('Error_FluxBB_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']);
+
+    $subquery = "
+SELECT id, username, email
+FROM ".FluxBB_USERS_TABLE." 
+WHERE BINARY username = BINARY '".$row['username']."'
+;";
+    $subresult = pwg_query($subquery);
+  
+    while($subrow = pwg_db_fetch_assoc($subresult))
+    {
+      $msg_error_FluxBB_Dup .= '<br>id:'.$subrow['id'].'='.stripslashes($subrow['username']).' ('.$subrow['email'].')';
+  
+      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('Del_User').stripslashes($subrow['username']).'"';
+        
+        $msg_error_FluxBB_Dup .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+        
+        $msg_error_FluxBB_Dup .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').$subrow['username'].'" /></a>';
+      }
+    }
+  }
+
+  if ($msg_error_FluxBB_Dup == '')
+    array_push($page['infos'], l10n('Audit_FluxBB_Dup').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_FluxBB_Dup = l10n('Audit_FluxBB_Dup').$msg_error_FluxBB_Dup.'<br>'.l10n('Advise_FluxBB_Dup');
+  
+
+
+  $query = "
+SELECT pwg.id as pwg_id, bb.id as bb_id, pwg.username as pwg_user, pwg.mail_address as pwg_mail
+FROM ".FluxBB_USERS_TABLE." AS bb, ".USERS_TABLE." as pwg
+WHERE bb.id NOT in (
+  SELECT id_user_FluxBB
+  FROM ".Register_FluxBB_ID_TABLE."
+  )
+AND pwg.id NOT in (
+  SELECT id_user_pwg
+  FROM ".Register_FluxBB_ID_TABLE."
+  )
+AND pwg.username = bb.username
+AND pwg.mail_address = bb.email
+;";
+
+  $result = pwg_query($query);
+  
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    $msg_error_Link_Break .= '<br>'.l10n('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('New_Link').stripslashes($row['pwg_user']).'"';
+      
+      $msg_error_Link_Break .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+      $msg_error_Link_Break .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_break.png" alt="'.l10n('New_Link').stripslashes($row['pwg_user']).'" /></a>';
+    }
+  }
+
+  if ($msg_error_Link_Break == '')
+    array_push($page['infos'], l10n('Audit_Link_Break').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_Link_Break = l10n('Audit_Link_Break').$msg_error_Link_Break;
+    
+
+  
+  $query = "
+SELECT pwg.username as pwg_user, pwg.id as pwg_id, pwg.mail_address as pwg_mail, bb.id as bb_id, bb.username as bb_user, bb.email as bb_mail
+FROM ".FluxBB_USERS_TABLE." AS bb 
+INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = bb.id
+INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
+WHERE pwg.username <> bb.username
+;";
+
+  $result = pwg_query($query);
+  
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')';
+
+    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('Link_Del').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'"';
+      
+      $msg_error_Link_Bad .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+      
+      $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_delete.png" alt="'.l10n('Link_Del').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'" /></a>';
+
+      $msg_error_Link_Bad .= ' -- <a href="';
+
+      $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array(
+        'action' => 'sync_user',
+        'username' => stripslashes($row['pwg_user']),
+      ));
+      
+      $msg_error_Link_Bad .= '" title="'.l10n('Sync_User').stripslashes($row['pwg_user']).' --> '.stripslashes($row['bb_user']).'"';
+      
+      $msg_error_Link_Bad .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+      
+      $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/arrow_switch.png" alt="'.l10n('Sync_User').stripslashes($row['pwg_user']).' --> '.stripslashes($row['bb_user']).'" /></a>';
+    }
+  }
+
+
+  $query = "
+SELECT COUNT(*) as nbr_dead
+FROM ".Register_FluxBB_ID_TABLE." AS Link
+WHERE id_user_FluxBB NOT IN (
+  SELECT id
+  FROM ".FluxBB_USERS_TABLE."
+  )
+OR id_user_pwg NOT IN (
+  SELECT id
+  FROM ".USERS_TABLE."
+  )
+;";
+
+  $Compteur = pwg_db_fetch_assoc(pwg_query($query));
+
+  if (!empty($Compteur) and $Compteur['nbr_dead'] > 0)
+  { 
+    $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Dead').$Compteur['nbr_dead'];
+
+    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('Link_Dead').$Compteur['nbr_dead'].'"';
+      
+      $msg_error_Link_Bad .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+      
+      $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_delete.png" alt="'.l10n('Link_Dead').$Compteur['nbr_dead'].'" /></a>';
+    }
+  }
+
+  $query = "
+SELECT COUNT(*) AS nbr_dup, pwg.id AS pwg_id, pwg.username AS pwg_user, bb.username AS bb_user, bb.id AS bb_id
+FROM ".FluxBB_USERS_TABLE." AS bb 
+INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = bb.id
+INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
+GROUP BY link.id_user_pwg, link.id_user_FluxBB
+HAVING COUNT(*) > 1
+;";
+
+  $result = pwg_query($query);
+  
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    $msg_error_Link_Bad .= '<br>'.l10n('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('Link_Dup').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'"';
+      
+      $msg_error_Link_Bad .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+      
+      $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_error.png" alt="'.l10n('Link_Dup').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'" /></a>';
+    }      
+  }
+
+  if ($msg_error_Link_Bad == '')
+    array_push($page['infos'], l10n('Audit_Link_Bad').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_Link_Bad = l10n('Audit_Link_Bad').$msg_error_Link_Bad;
+    
+
+  
+  $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 = pwg_db_fetch_assoc($result))
+  {
+    if ( ($row['pwg_pwd'] != $row['bb_pwd']) or ($row['pwg_eml'] != $row['bb_eml']) )
+    {
+      $msg_error_Synchro .= '<br>'.l10n('Error_Synchro').stripslashes($row['username']);
+
+      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('Sync_User').stripslashes($row['username']).'"';
+        
+        $msg_error_Synchro .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+        $msg_error_Synchro .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_refresh.png" alt="'.l10n('Sync_User').stripslashes($row['username']).'" /></a>';
+      }
+      
+      if ($row['pwg_pwd'] != $row['bb_pwd'])
+        $msg_error_Synchro .= '<br>'.l10n('Error_Synchro_Pswd');
+      
+      if ($row['pwg_eml'] != $row['bb_eml'])
+        $msg_error_Synchro .= '<br>'.l10n('Error_Synchro_Mail').'<br>-- PWG = '.$row['pwg_eml'].'<br>-- FluxBB = '.$row['bb_eml'];
+    }
+    else if ($conf_Register_FluxBB[5] == 'true')
+      $msg_ok_Synchro .= '<br> - '.stripslashes($row['username']).' ('.$row['pwg_eml'].')'.l10n('Audit_Synchro_OK');
+  }
+
+  if ($msg_error_Synchro <> '')
+    $msg_error_Synchro = l10n('Audit_Synchro').$msg_error_Synchro;
+    
+  if ($msg_ok_Synchro <> '')
+    if ($msg_error_Synchro <> '')
+      array_push($page['infos'], l10n('Audit_Synchro').$msg_ok_Synchro.'<br><br>');
+    else
+      array_push($page['infos'], l10n('Audit_Synchro').$msg_ok_Synchro.'<br><br>'.l10n('Audit_OK'));
+
+
+  $query = "
+SELECT username, mail_address FROM ".USERS_TABLE."
+WHERE BINARY username <> BINARY 'guest'
+AND id not in (
+  SELECT id_user_pwg FROM ".Register_FluxBB_ID_TABLE."
+  )
+AND BINARY username not in (
+  SELECT username FROM ".FluxBB_USERS_TABLE."
+  )
+ORDER BY LOWER(username)
+;";
+
+  $result = pwg_query($query);
+
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    $msg_error_PWG2FluxBB .= '<br>'.l10n('Error_PWG2FluxBB').stripslashes($row['username']).' ('.$row['mail_address'].')';
+
+    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('Add_User').stripslashes($row['username']).'" ';
+      
+      $msg_error_PWG2FluxBB .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+      $msg_error_PWG2FluxBB .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_add.png" alt="'.l10n('Add_User').stripslashes($row['username']).'" /></a>';
+    }
+  }
+
+  if ($msg_error_PWG2FluxBB == '')
+    array_push($page['infos'], l10n('Audit_PWG2FluxBB').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_PWG2FluxBB = l10n('Audit_PWG2FluxBB').$msg_error_PWG2FluxBB;
+
+  
+
+  $query = "
+SELECT id, username, email FROM ".FluxBB_USERS_TABLE."
+WHERE BINARY username <> BINARY '".$conf_Register_FluxBB[2]."'
+AND id not in (
+  SELECT id_user_FluxBB FROM ".Register_FluxBB_ID_TABLE."
+  )
+AND BINARY username not in (
+  SELECT username FROM ".USERS_TABLE."
+  )
+ORDER BY LOWER(username)
+;";
+
+  $result = pwg_query($query);
+
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    $msg_error_FluxBB2PWG .= '<br>'.l10n('Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')';
+
+    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('Del_User').stripslashes($row['username']).'"';
+      
+      $msg_error_FluxBB2PWG .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+      $msg_error_FluxBB2PWG .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($row['username']).'" /></a>';
+    }
+  }
+
+  if ($msg_error_FluxBB2PWG == '')
+    array_push($page['infos'], l10n('Audit_FluxBB2PWG').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_FluxBB2PWG = l10n('Audit_FluxBB2PWG').$msg_error_FluxBB2PWG;
+
+
+
+  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 '".pwg_db_real_escape_string($_GET['username'])."'
+LIMIT 1
+;";
+
+  $data = pwg_db_fetch_assoc(pwg_query($query));
+  
+  if (!empty($data))
+  {
+    FluxBB_Updateuser($data['id_pwg'], stripslashes($data['username']), $data['password'], $data['mail_address']);
+  }
+  
+  Audit_PWG_FluxBB();
+}
+else if ( isset($_GET['action']) and ($_GET['action']=='add_user') and isset($_GET['username']) and !is_adviser() )
+{
+  $query = "
+SELECT id, username, password, mail_address 
+FROM ".USERS_TABLE."
+WHERE BINARY username = BINARY '".pwg_db_real_escape_string($_GET['username'])."'
+LIMIT 1
+;";
+
+  $data = pwg_db_fetch_assoc(pwg_query($query));
+  
+  if (!empty($data))
+    FluxBB_Adduser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']);  
+  
+    Audit_PWG_FluxBB();
+}
+else if ( isset($_GET['action']) and ($_GET['action']=='del_user') and isset($_GET['id']) and !is_adviser() )
+{
+  FluxBB_Deluser( $_GET['id'], true );
+  
+  Audit_PWG_FluxBB();
+}
+
+
+// +-----------------------------------------------------------------------+
+// |                            Tabssheet select                           |
+// +-----------------------------------------------------------------------+
+
+switch ($page['tab'])
+{
+  case 'info':
+
+  $template->assign(
+    array(
+      'REGFLUXBB_PATH'    => REGFLUXBB_PATH,
+      'REGFLUXBB_VERSION' => $version,
+    )
+  );
+  
+  $template->set_filename('plugin_admin_content', dirname(__FILE__).'/template/info.tpl');
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
+	break;
+
+	case 'manage':
+  
+  if (isset($_POST['submit']) and !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'].';'.$_POST['FluxBB_UAM'].';'.$_POST['FluxBB_group'];
+
+    $query = '
+UPDATE '.CONFIG_TABLE.'
+SET value="'.$conf['Register_FluxBB'].'"
+WHERE param="Register_FluxBB"
+LIMIT 1
+;';
+
+    pwg_query($query);
+
+    array_push($page['infos'], l10n('save_config'));
+  }
+
+  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+
+  $template->assign(
+    array
+    (
+      'REGFLUXBB_PATH'       => REGFLUXBB_PATH,
+      'REGFLUXBB_VERSION'    => $version,
+      'FluxBB_PREFIX'        => $conf_Register_FluxBB[0],
+      'FluxBB_ADMIN'         => stripslashes($conf_Register_FluxBB[1]),
+      'FluxBB_GUEST'         => stripslashes($conf_Register_FluxBB[2]),
+      'FluxBB_DEL_PT_TRUE'   => (isset($conf_Register_FluxBB[3]) and $conf_Register_FluxBB[3] == 'true') ? 'checked="checked"' : '',
+      'FluxBB_DEL_PT_FALSE'  => (isset($conf_Register_FluxBB[3]) and $conf_Register_FluxBB[3] == 'false') ? 'checked="checked"' : '',
+      'FluxBB_CONFIRM_TRUE'  => (isset($conf_Register_FluxBB[4]) and $conf_Register_FluxBB[4] == 'true') ? 'checked="checked"' : '',
+      'FluxBB_CONFIRM_FALSE' => (isset($conf_Register_FluxBB[4]) and $conf_Register_FluxBB[4] == 'false') ? 'checked="checked"' : '',
+      'FluxBB_DETAILS_TRUE'  => (isset($conf_Register_FluxBB[5]) and $conf_Register_FluxBB[5] == 'true') ? 'checked="checked"' : '',
+      'FluxBB_DETAILS_FALSE' => (isset($conf_Register_FluxBB[5]) and $conf_Register_FluxBB[5] == 'false') ? 'checked="checked"' : '',
+    )
+  );
+
+// If UAM exists and if UAM ConfirmMail is set, we can set this feature
+  if (function_exists('FindAvailableConfirmMailID'))
+  {  
+    $conf_UAM = unserialize($conf['UserAdvManager']);
+    $UAM_bridge = false;
+    
+    if (isset($conf_UAM[1]) and ($conf_UAM[1] == 'true' or $conf_UAM[1] == 'local') and isset($conf_UAM[2]) and $conf_UAM[2] != '-1')
+    {
+      $UAM_bridge = true;
+    }
+  }
+  
+  $template->assign(
+    array
+    (
+      'UAM_BRIDGE'            => $UAM_bridge,
+      'FluxBB_UAM_LINK_TRUE'  => (isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true') ? 'checked="checked"' : '',
+      'FluxBB_UAM_LINK_FALSE' => (isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'false') ? 'checked="checked"' : '',
+      'FluxBB_GROUP'          => $conf_Register_FluxBB[7],
+    )
+  );
+
+  $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/manage.tpl');
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
+	break;
+
+	case 'Migration':
+	
+  if ( isset($_POST['Migration']) and !is_adviser() )
+  {
+    array_push($page['infos'], l10n('Mig_Start').'<br><br>');
+  
+    array_push($page['infos'], l10n('Mig_Del_Link').'<br><br>');
+
+    $query = "TRUNCATE ".Register_FluxBB_ID_TABLE.";";
+    $result = pwg_query($query);
+  
+  
+    $msg_Mig_Del_AllUsers = '';
+
+    $query = "
+SELECT username, id
+FROM ".FluxBB_USERS_TABLE."
+;";
+
+    $result = pwg_query($query);
+  
+    while ($row = pwg_db_fetch_assoc($result))
+    {
+      if((stripslashes($row['username']) != stripslashes($conf_Register_FluxBB[2])) and (stripslashes($row['username']) != stripslashes($conf_Register_FluxBB[1])))
+      {
+        $msg_Mig_Del_AllUsers .= '<br> - '.l10n('Mig_Del_User').stripslashes($row['username']);
+        
+        FluxBB_Deluser($row['id'], false);
+      }
+    }
+
+    array_push($page['infos'], l10n('Mig_Del_AllUsers').$msg_Mig_Del_AllUsers.'<br><br>');
+
+
+    $query = "
+SELECT id, username, password, mail_address
+FROM ".USERS_TABLE."
+;";
+
+    $result = pwg_query($query);
+  
+    $registred = time();
+    $registred_ip = $_SERVER['REMOTE_ADDR'];
+  
+    $msg_Mig_Add_AllUsers = '';
+  
+    while ($row = pwg_db_fetch_assoc($result))
+    {
+      if((stripslashes($row['username']) != 'guest') and (stripslashes($row['username']) != stripslashes($conf_Register_FluxBB[1])))
+      {
+        $msg_Mig_Add_AllUsers .= '<br> - '.l10n('Mig_Add_User').stripslashes($row['username']);
+
+        FluxBB_Adduser($row['id'], stripslashes($row['username']), $row['password'], $row['mail_address']);
+      }
+    }
+
+    array_push($page['infos'], l10n('Mig_Add_AllUsers').$msg_Mig_Add_AllUsers.'<br><br>');
+
+
+    $query = "
+SELECT id, username, password, mail_address
+FROM ".USERS_TABLE."
+WHERE username = '".$conf_Register_FluxBB[1]."'
+;";
+
+    $row = pwg_db_fetch_assoc(pwg_query($query));
+
+    if (!empty($row))
+    {
+      array_push($page['infos'], l10n('Sync_User').stripslashes($row['username']).'<br><br>');
+      
+      FluxBB_Updateuser($row['id'], stripslashes($row['username']), $row['password'], $row['mail_address']);
+    }
+
+    array_push($page['infos'], l10n('Mig_End'));
+  }
+  else if ( isset($_POST['Audit']))
+  {
+    Audit_PWG_FluxBB();
+  }
+
+  $template->assign(
+    array
+    (
+      'REGFLUXBB_PATH'    => REGFLUXBB_PATH,
+      'REGFLUXBB_VERSION' => $version,
+    )
+  );
+
+  $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/migration.tpl');
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
+	break;
+  
+	case 'Synchro':
+  
+  if ( isset($_POST['Synchro']) 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 = pwg_db_fetch_assoc($result))
+      $msg_error_PWG_Dup .= '<br>'.l10n('Error_PWG_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']);
+
+      if ($msg_error_PWG_Dup <> '')
+        $msg_error_PWG_Dup = l10n('Audit_PWG_Dup').$msg_error_PWG_Dup.'<br>'.l10n('Advise_PWG_Dup');
+  
+
+    $query = "
+SELECT COUNT(*) AS nbr_dup, username
+FROM ".FluxBB_USERS_TABLE." 
+GROUP BY BINARY username
+HAVING COUNT(*) > 1
+;";
+
+    $result = pwg_query($query);
+  
+    while($row = pwg_db_fetch_assoc($result))
+    {
+      $msg_error_FluxBB_Dup .= '<br>'.l10n('Error_FluxBB_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']);
+
+      $subquery = "
+SELECT id, username, email
+FROM ".FluxBB_USERS_TABLE." 
+WHERE BINARY username = BINARY '".$row['username']."'
+;";
+
+      $subresult = pwg_query($subquery);
+  
+      while($subrow = pwg_db_fetch_assoc($subresult))
+      {
+        $msg_error_FluxBB_Dup .= '<br>id:'.$subrow['id'].'='.stripslashes($subrow['username']).' ('.$subrow['email'].')';
+  
+        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('Del_User').stripslashes($subrow['username']).'"';
+
+          $msg_error_FluxBB_Dup .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+          $msg_error_FluxBB_Dup .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($subrow['username']).'" /></a>';
+        }
+      }
+    }
+
+    if ($msg_error_FluxBB_Dup <> '')
+      $msg_error_FluxBB_Dup = l10n('Sync_Check_Dup').$msg_error_FluxBB_Dup.'<br>'.l10n('Advise_FluxBB_Dup');
+  
+
+    if ($msg_error_FluxBB_Dup == '' and $msg_error_PWG_Dup == '')
+    {
+      $query = "
+SELECT pwg.id as pwg_id, bb.id as bb_id, pwg.username as pwg_user, pwg.mail_address as pwg_mail
+FROM ".FluxBB_USERS_TABLE." AS bb, ".USERS_TABLE." as pwg
+WHERE bb.id NOT in (
+  SELECT id_user_FluxBB
+  FROM ".Register_FluxBB_ID_TABLE."
+  )
+AND pwg.id NOT in (
+  SELECT id_user_pwg
+  FROM ".Register_FluxBB_ID_TABLE."
+  )
+AND pwg.username = bb.username
+AND pwg.mail_address = bb.email
+;";
+
+      $result = pwg_query($query);
+    
+      while($row = pwg_db_fetch_assoc($result))
+      {
+        $msg_error_Link_Break .= '<br>'.l10n('New_Link').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')';
+  
+        FluxBB_Linkuser($row['pwg_id'], $row['bb_id']);
+      }
+  
+      if ($msg_error_Link_Break == '')
+        array_push($page['infos'], l10n('Sync_Link_Break').'<br>'.l10n('Sync_OK'));
+      else
+        $msg_error_Link_Break = l10n('Sync_Link_Break').$msg_error_Link_Break;
+  
+    
+      $query = "
+SELECT pwg.username as pwg_user, pwg.id as pwg_id, pwg.mail_address as pwg_mail, bb.id as bb_id, bb.username as bb_user, bb.email as bb_mail
+FROM ".FluxBB_USERS_TABLE." AS bb 
+INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = bb.id
+INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
+WHERE BINARY pwg.username <> BINARY bb.username
+;";
+
+      $result = pwg_query($query);
+    
+      while($row = pwg_db_fetch_assoc($result))
+      {
+        $msg_error_Link_Bad .= '<br>'.l10n('Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')';
+
+        $subquery = "
+DELETE FROM ".Register_FluxBB_ID_TABLE."
+WHERE id_user_pwg = ".$row['pwg_id']."
+AND id_user_FluxBB = ".$row['bb_id']."
+;";
+
+        $subresult = pwg_query($subquery);
+      }
+
+
+      $query = "
+SELECT COUNT(*) as nbr_dead
+FROM ".Register_FluxBB_ID_TABLE." AS Link
+WHERE id_user_FluxBB NOT IN (
+  SELECT id
+  FROM ".FluxBB_USERS_TABLE."
+  )
+OR id_user_pwg NOT IN (
+  SELECT id
+  FROM ".USERS_TABLE."
+  )
+;";
+
+      $Compteur = pwg_db_fetch_assoc(pwg_query($query));
+    
+      if ( !empty($Compteur) and $Compteur['nbr_dead'] > 0)
+      { 
+        $msg_error_Link_Bad .= '<br>'.l10n('Link_Dead').$Compteur['nbr_dead'];
+    
+        $query = "
+DELETE FROM ".Register_FluxBB_ID_TABLE."
+WHERE id_user_FluxBB NOT IN (
+  SELECT id
+  FROM ".FluxBB_USERS_TABLE."
+  )
+OR id_user_pwg NOT IN (
+  SELECT id
+  FROM ".USERS_TABLE."
+  )
+;";
+
+        $result = pwg_query($query);
+      }
+    
+      
+      $query = "
+SELECT COUNT(*) AS nbr_dup, pwg.id AS pwg_id, pwg.username AS pwg_user, bb.username AS bb_user, bb.id AS bb_id
+FROM ".FluxBB_USERS_TABLE." AS bb 
+INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = bb.id
+INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
+GROUP BY link.id_user_pwg, link.id_user_FluxBB
+HAVING COUNT(*) > 1
+;";
+
+      $result = pwg_query($query);
+    
+      while($row = pwg_db_fetch_assoc($result))
+      {
+        $msg_error_Link_Bad .= '<br>'.l10n('Link_Dup').$row['nbr_dup'].' = '.stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).')';
+  
+        FluxBB_Linkuser($row['pwg_id'], $row['bb_id']);
+      }
+
+      if ($msg_error_Link_Bad == '')
+        array_push($page['infos'], l10n('Sync_Link_Bad').'<br>'.l10n('Sync_OK'));
+      else
+        $msg_error_Link_Bad = l10n('Sync_Link_Bad').$msg_error_Link_Bad;
+  
+    
+      $query = "
+SELECT pwg.id as pwg_id, pwg.username as username, pwg.password as pwg_pwd, pwg.mail_address as pwg_eml, FluxBB.id as bb_id, FluxBB.password as bb_pwd, FluxBB.email as bb_eml
+FROM ".FluxBB_USERS_TABLE." AS FluxBB 
+INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = FluxBB.id
+INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
+AND BINARY pwg.username = BINARY FluxBB.username
+ORDER BY LOWER(pwg.username)
+;";
+
+      $result = pwg_query($query);
+    
+      while($row = pwg_db_fetch_assoc($result))
+      {
+        if ( ($row['pwg_pwd'] != $row['bb_pwd']) or ($row['pwg_eml'] != $row['bb_eml']) )
+        {
+          $msg_error_Synchro .= '<br>'.l10n('Sync_User').stripslashes($row['username']);
+  
+          $query = "
+SELECT id, username, password, mail_address 
+FROM ".USERS_TABLE."
+WHERE BINARY id = '".$row['pwg_id']."'
+;";
+
+          $data = pwg_db_fetch_assoc(pwg_query($query));
+        
+          if (!empty($data))
+            FluxBB_Updateuser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']);
+        }
+      }
+  
+      if ($msg_error_Synchro == '')
+        array_push($page['infos'], l10n('Sync_DataUser').'<br>'.l10n('Sync_OK'));
+      else
+        $msg_error_Synchro = l10n('Sync_DataUser').$msg_error_Synchro;
+
+  
+      $query = "
+SELECT username, mail_address FROM ".USERS_TABLE."
+WHERE BINARY username <> BINARY 'guest'
+AND id not in (
+  SELECT id_user_pwg FROM ".Register_FluxBB_ID_TABLE."
+  )
+AND BINARY username not in (
+  SELECT username FROM ".FluxBB_USERS_TABLE."
+  )
+ORDER BY LOWER(username)
+;";
+
+      $result = pwg_query($query);
+  
+      while($row = pwg_db_fetch_assoc($result))
+      {
+        $msg_error_PWG2FluxBB .= '<br>'.l10n('Add_User').stripslashes($row['username']).' ('.$row['mail_address'].')';
+
+        $query = "
+SELECT id, username, password, mail_address 
+FROM ".USERS_TABLE."
+WHERE BINARY username = BINARY '".$row['username']."'
+LIMIT 1
+;";
+
+        $data = pwg_db_fetch_assoc(pwg_query($query));
+      
+        if (!empty($data))
+          FluxBB_Adduser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']);  
+      }
+  
+      if ($msg_error_PWG2FluxBB == '')
+        array_push($page['infos'], l10n('Sync_PWG2FluxBB').'<br>'.l10n('Sync_OK'));
+      else
+        $msg_error_PWG2FluxBB = l10n('Sync_PWG2FluxBB').$msg_error_PWG2FluxBB;
+    
+  
+      $query = "
+SELECT id, username, email FROM ".FluxBB_USERS_TABLE."
+WHERE BINARY username <> BINARY '".$conf_Register_FluxBB[2]."'
+AND id not in (
+  SELECT id_user_FluxBB FROM ".Register_FluxBB_ID_TABLE."
+  )
+AND BINARY username not in (
+  SELECT username FROM ".USERS_TABLE."
+  )
+ORDER BY LOWER(username)
+;";
+
+      $result = pwg_query($query);
+  
+      while($row = pwg_db_fetch_assoc($result))
+      {
+        $msg_error_FluxBB2PWG .= '<br>'.l10n('Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')';
+  
+        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('Del_User').stripslashes($row['username']).'"';
+
+          $msg_error_FluxBB2PWG .= $conf_Register_FluxBB[4]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+          $msg_error_FluxBB2PWG .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($row['username']).'" /></a>';
+        }
+      }
+  
+      if ($msg_error_FluxBB2PWG == '')
+        array_push($page['infos'], l10n('Sync_FluxBB2PWG').'<br>'.l10n('Sync_OK'));
+      else
+        $msg_error_FluxBB2PWG = l10n('Sync_FluxBB2PWG').$msg_error_FluxBB2PWG;
+    }
+    else
+      $errors[] = l10n('Advise_Check_Dup');
+
+
+    if ($msg_error_PWG_Dup <> '')
+      $errors[] = $msg_error_PWG_Dup . ( ($msg_error_FluxBB_Dup == '' and $msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
+  
+    if ($msg_error_FluxBB_Dup <> '')
+      $errors[] = $msg_error_FluxBB_Dup . ( ($msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
+
+    if ($msg_error_Link_Break <> '')
+      $errors[] = $msg_error_Link_Break . ( ($msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
+
+    if ($msg_error_Link_Bad <> '')
+      $errors[] = $msg_error_Link_Bad . ( ($msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
+
+    if ($msg_error_Synchro <> '')
+      $errors[] = $msg_error_Synchro . ( ($msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
+
+    if ($msg_error_PWG2FluxBB <> '')
+      $errors[] = $msg_error_PWG2FluxBB . ( ($msg_error_FluxBB2PWG == '') ? '' : '<br><br>' );
+
+    if ($msg_error_FluxBB2PWG <> '')
+      $errors[] = $msg_error_FluxBB2PWG;
+  }
+  else if ( isset($_POST['Audit']))
+  {
+    Audit_PWG_FluxBB();
+  }
+
+  $template->assign(
+    array
+    (
+      'REGFLUXBB_PATH'    => REGFLUXBB_PATH,
+      'REGFLUXBB_VERSION' => $version,
+    )
+  );
+
+  $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/synchro.tpl');
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');	
+
+	break;
+}
+?>
Index: /extensions/Register_FluxBB/tags/2.3.0/admin/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/admin/index.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/admin/index.php	(revision 6817)
@@ -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.3.0/admin/template/icon/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/admin/template/icon/index.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/admin/template/icon/index.php	(revision 6817)
@@ -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.3.0/admin/template/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/admin/template/index.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/admin/template/index.php	(revision 6817)
@@ -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.3.0/admin/template/info.tpl
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/admin/template/info.tpl	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/admin/template/info.tpl	(revision 6817)
@@ -0,0 +1,7 @@
+{html_head}<link rel="stylesheet" type="text/css" href="{$REGFLUXBB_PATH}admin/template/register_fluxbb.css">{/html_head}
+
+<div class="titrePage">
+  <h2>{'Title_Tab'|@translate} {$REGFLUXBB_VERSION}<br>{'Tab_Info'|@translate}</h2>
+</div>
+
+<div align="left" style="margin-left: 1em; margin-right: 1em;">{'Disclaimer'|@translate}</div>
Index: /extensions/Register_FluxBB/tags/2.3.0/admin/template/manage.tpl
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/admin/template/manage.tpl	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/admin/template/manage.tpl	(revision 6817)
@@ -0,0 +1,106 @@
+{html_head}<link rel="stylesheet" type="text/css" href="{$REGFLUXBB_PATH}admin/template/register_fluxbb.css">{/html_head}
+
+<script type="text/javascript">
+function blockToggleDisplay(headerId, contentId)
+{ldelim}
+  var revHeader = document.getElementById(headerId);
+  var revContent = document.getElementById(contentId);
+
+  if (revContent.style.display == 'none')
+  {ldelim}
+    revContent.style.display = 'block';
+    revHeader.className = 'instructionBlockHeaderExpanded';
+  {rdelim}
+  else
+  {ldelim}
+    revContent.style.display = 'none';
+    revHeader.className = 'instructionBlockHeaderCollapsed';
+  {rdelim}
+{rdelim}
+
+function rfbb_blockToggleDisplay( headerId, contentId )
+{ldelim}
+  if (typeof(headerId)=='string')
+  {ldelim}
+   if ( headerId.length>  1)
+       blockToggleDisplay(headerId, contentId) ;
+      document.getElementById("nb_para").value =headerId ;
+      document.getElementById("nb_para2").value =contentId;
+  {rdelim}
+{rdelim}
+</script>
+
+<div class="titrePage">
+  <h2>{'Title_Tab'|@translate} {$REGFLUXBB_VERSION}<br>{'Tab_Manage'|@translate}</h2>
+</div>
+
+<form method="post" action="">
+  <fieldset>
+  	<legend>{'Config_Title'|@translate}</legend>
+    {'Config_Disclaimer'|@translate}
+    <br><br>
+    <ul>
+    	<li><label>{'Prefix'|@translate}</label><br>
+    		<input type="text" name="FluxBB_prefix" value={$FluxBB_PREFIX} size="20" style="text-align: center;"><br>
+      <br>
+    	</li>
+    	<li><label>{'Admin'|@translate}</label><br>
+    		<input type="text" name="FluxBB_admin" value={$FluxBB_ADMIN} size="20" style="text-align: center;"><br>
+    		{'User'|@translate}
+      <br>
+    	</li>
+    	<li><label>{'Guest'|@translate}</label><br>
+    		<input type="text" name="FluxBB_guest" value={$FluxBB_GUEST} size="20" style="text-align: center;"><br>
+      <br>
+    	</li>
+    	<li><label>{'Del_Pt'|@translate}</label><br>
+        <input type="radio" value="true" {$FluxBB_DEL_PT_TRUE} name="FluxBB_del_pt">{'Del_Pt_true'|@translate}<br>
+        <input type="radio" value="false" {$FluxBB_DEL_PT_FALSE} name="FluxBB_del_pt">{'Del_Pt_false'|@translate}<br>
+      <br>
+    	</li>
+    	<li><label>{'Confirm'|@translate}</label><br>
+        <input type="radio" value="true" {$FluxBB_CONFIRM_TRUE} name="FluxBB_confirm">{'Confirm_true'|@translate}<br>
+        <input type="radio" value="false" {$FluxBB_CONFIRM_FALSE} name="FluxBB_confirm">{'Confirm_false'|@translate}<br>
+      <br>
+    	</li>
+    	<li><label>{'Details'|@translate}</label><br>
+        <input type="radio" value="true" {$FluxBB_DETAILS_TRUE} name="FluxBB_details">{'Details_true'|@translate}<br>
+        <input type="radio" value="false" {$FluxBB_DETAILS_FALSE} name="FluxBB_details">{'Details_false'|@translate}<br>
+      <br>
+    	</li>
+      {if $UAM_BRIDGE}
+    	<li><label>{'Bridge_UAM'|@translate}</label><br>
+        <input type="radio" value="true" {$FluxBB_UAM_LINK_TRUE} name="FluxBB_UAM">{'Bridge_UAM_true'|@translate}<br>
+        <input type="radio" value="false" {$FluxBB_UAM_LINK_FALSE} name="FluxBB_UAM">{'Bridge_UAM_false'|@translate}<br>
+      <br>
+      </li>
+    	<li><label>{'FluxBB_Group'|@translate}</label><br>
+    		<input type="text" name="FluxBB_group" value={$FluxBB_GROUP} size="6" style="text-align: center;"><br>
+    	</li>
+      {/if}
+    </ul>
+    <br>
+  	<div align="center"><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}></div>
+  </fieldset>
+
+  <div id="instructionConfig1" class="instructionBlock" >
+    <div id="config1_header" class="instructionBlockHeaderCollapsed" onclick="rfbb_blockToggleDisplay('config1_header', 'Config1')">
+        {'About_Reg'|@translate}
+      </span>
+    </div>
+  
+    <div id="Config1" class="instructionBlockContent" style="display:none">
+      {'No_Reg_advise'|@translate}
+    </div>
+  </div>
+  <div id="instructionConfig2" class="instructionBlock" >
+    <div id="config2_header" class="instructionBlockHeaderCollapsed" onclick="rfbb_blockToggleDisplay('config2_header', 'Config2')">
+        {'About_Bridge'|@translate}
+      </span>
+    </div>
+  
+    <div id="Config2" class="instructionBlockContent" style="display:none">
+      {'UAM_Bridge_advice'|@translate}
+    </div>
+  </div>
+</form>
Index: /extensions/Register_FluxBB/tags/2.3.0/admin/template/migration.tpl
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/admin/template/migration.tpl	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/admin/template/migration.tpl	(revision 6817)
@@ -0,0 +1,16 @@
+{html_head}<link rel="stylesheet" type="text/css" href="{$REGFLUXBB_PATH}admin/template/register_fluxbb.css">{/html_head}
+
+<div class="titrePage">
+  <h2>{'Title_Tab'|@translate} {$REGFLUXBB_VERSION}<br>{'Tab_Migration'|@translate}</h2>
+</div>
+
+<form method="post" action="">
+  <fieldset>
+  	<legend>{'Mig_Title'|@translate}</legend>
+  	{'Mig_Text'|@translate}
+    <br>
+  	<p><input onclick="return confirm('{'Are you sure?'|@translate}');" class="submit" type="submit" value="{'Mig_Btn'|@translate}" name="Migration" {$TAG_INPUT_ENABLED}></p>
+    <br>
+  	{'Mig_Disclaimer'|@translate}
+  </fieldset>
+</form>
Index: /extensions/Register_FluxBB/tags/2.3.0/admin/template/register_fluxbb.css
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/admin/template/register_fluxbb.css	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/admin/template/register_fluxbb.css	(revision 6817)
@@ -0,0 +1,82 @@
+/**
+ * Informations box in administration
+ */
+.warning, .info{
+  margin: 5px;
+  padding: 50px 50px 10px 10px;
+  font-weight:bold;
+  background-repeat: no-repeat;
+  background-position: 5px 5px;
+  padding:15px 60px 0pt 60px;
+  min-height: 54px;
+}
+
+.warning {
+  color: #f22;
+  background-color: #ffd5dc;
+  background-image: url(icon/warning.png);
+}
+
+.info{
+  margin: 5px;
+  padding: 50px 50px 10px 10px;
+  font-weight:bold;
+  background-repeat: no-repeat;
+  background-position: 5px 5px;
+  padding: 5px 60px 0pt 60px;
+  min-height: 20px;
+}
+
+.info {
+  color: #0a0;
+  background-color:#c2f5c2;
+}
+
+.mod{
+  margin: 5px;
+  padding: 50px 50px 10px 10px;
+  font-weight:bold;
+  background-repeat: no-repeat;
+  background-position: 5px 5px;
+  padding: 5px 60px 0pt 60px;
+  min-height: 20px;
+}
+
+.mod {
+  color: #f22;
+  background-color: #ffd5dc;
+}
+
+/* Bloc expand-collapse instructions */
+.instructionBlockHeaderCollapsed, .instructionBlockHeaderExpanded
+{
+  background-color:#111;
+  background-position:15px center;
+  background-repeat:no-repeat;
+  color:#ff3363;
+  cursor:pointer;
+  font-size:110%;
+  overflow:hidden;
+  padding:8px 41px;
+  text-align: left;
+}
+
+.instructionBlockHeaderCollapsed span, .instructionBlockHeaderExpanded span
+{
+  border-bottom: none;
+}
+ 
+.instructionBlockHeaderCollapsed
+{
+  background-image: url(./icon/expand.gif);
+}
+
+.instructionBlockHeaderExpanded
+{
+  background-image: url(./icon/collapse.gif);
+}
+
+.instructionBlockContent
+{
+  padding:0 15px 15px;
+}
Index: /extensions/Register_FluxBB/tags/2.3.0/admin/template/synchro.tpl
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/admin/template/synchro.tpl	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/admin/template/synchro.tpl	(revision 6817)
@@ -0,0 +1,14 @@
+{html_head}<link rel="stylesheet" type="text/css" href="{$REGFLUXBB_PATH}admin/template/register_fluxbb.css">{/html_head}
+
+<div class="titrePage">
+  <h2>{'Title_Tab'|@translate} {$REGFLUXBB_VERSION}<br>{'Tab_Synchro'|@translate}</h2>
+</div>
+
+<form method="post" action="">
+  <fieldset>
+  	<legend>{'Sync_Title'|@translate}</legend>
+  	{'Sync_Text'|@translate}
+    <br>
+  	<p><input {$FluxBB_CONFIRM_ENABLE} class="submit" type="submit" value="{'Audit_Btn'|@translate}" name="Audit"> <input onclick="return confirm('{'Are you sure?'|@translate}');" {$FluxBB_CONFIRM_ENABLE} class="submit" type="submit" value="{'Sync_Btn'|@translate}" name="Synchro" {$TAG_INPUT_ENABLED}></p>
+  </fieldset>
+</form>
Index: /extensions/Register_FluxBB/tags/2.3.0/include/constants.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/include/constants.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/include/constants.php	(revision 6817)
@@ -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.3.0/include/functions.inc.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/include/functions.inc.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/include/functions.inc.php	(revision 6817)
@@ -0,0 +1,341 @@
+<?php
+
+  include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+  include_once (REGFLUXBB_PATH.'include/constants.php');
+
+function FluxBB_Linkuser($pwg_id, $bb_id)
+{
+  $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 = pwg_db_fetch_row(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)
+{
+  $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)
+{
+  global $conf;
+
+  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+
+  $registred = time();
+  $registred_ip = $_SERVER['REMOTE_ADDR'];
+  
+  // Check if UAM is installed and if bridge is set - Exception for admins and webmasters
+  if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true')
+  {
+    $o_default_user_group = $conf_Register_FluxBB[7];
+  }
+  else
+  {
+    $query = "
+SELECT conf_value
+FROM ".FluxBB_CONFIG_TABLE."
+WHERE conf_name = 'o_default_user_group'
+;";
+
+    $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));
+  }
+
+// Check for FluxBB version 1.4.x and get the correct value
+  $query1 = "
+SELECT conf_value
+FROM ".FluxBB_CONFIG_TABLE."
+WHERE conf_name = 'o_default_timezone'
+;";
+
+  $count1 = pwg_db_num_rows(pwg_query($query1));
+
+// Check for FluxBB version 1.2.x and get the correct value
+  $query2 = "
+SELECT conf_value
+FROM ".FluxBB_CONFIG_TABLE."
+WHERE conf_name = 'o_server_timezone'
+;";
+
+  $count2 = pwg_db_num_rows(pwg_query($query2));
+  
+  if ($count1 == 1 and $count2 == 0)
+  {
+    $o_default_timezone = pwg_db_fetch_assoc(pwg_query($query1));
+  }
+  else if ($count1 == 0 and $count2 == 1)
+  {
+    $o_default_timezone = pwg_db_fetch_assoc(pwg_query($query2));
+  }
+  
+  
+  $query = "
+SELECT conf_value
+FROM ".FluxBB_CONFIG_TABLE."
+WHERE conf_name = 'o_default_lang'
+;";
+
+  $o_default_lang = pwg_db_fetch_assoc(pwg_query($query));
+  
+  $query = "
+SELECT conf_value
+FROM ".FluxBB_CONFIG_TABLE."
+WHERE conf_name = 'o_default_style'
+;";
+
+  $o_default_style = pwg_db_fetch_assoc(pwg_query($query));
+  
+  $query = '
+INSERT INTO '.FluxBB_USERS_TABLE." (
+  username, 
+  ". ( isset($o_default_user_group['conf_value']) ? 'group_id' : '' ) .",
+  password, 
+  email, 
+  ". ( isset($o_default_timezone['conf_value']) ? 'timezone' : '' ) .",
+  ". ( isset($o_default_lang['conf_value']) ? 'language' : '' ) .",
+  ". ( isset($o_default_style['conf_value']) ? 'style' : '' ) .",
+  registered, 
+  registration_ip, 
+  last_visit
+  )
+VALUES(
+  '".pwg_db_real_escape_string($login)."',
+  ". ( isset($o_default_user_group['conf_value']) ? "'".$o_default_user_group['conf_value']."'" : '' ) .",
+  '".$password."', 
+	'".$adresse_mail."',
+  ". ( isset($o_default_timezone['conf_value']) ? "'".$o_default_timezone['conf_value']."'" : '' ) .",
+  ". ( isset($o_default_lang['conf_value']) ? "'".$o_default_lang['conf_value']."'" : '' ) .",
+  ". ( isset($o_default_style['conf_value']) ? "'".$o_default_style['conf_value']."'" : '' ) .",
+  '".$registred."',
+  '".$registred_ip."',
+  '".$registred."'
+  )
+;";
+
+  $result = pwg_query($query);
+
+  $bb_id = pwg_db_insert_id();
+  
+  FluxBB_Linkuser($pwg_id, $bb_id);
+}
+
+
+
+function FluxBB_Searchuser($id_user_pwg)
+{
+  $query = "
+SELECT id_user_FluxBB, id_user_pwg FROM ".Register_FluxBB_ID_TABLE."
+WHERE id_user_pwg = ".$id_user_pwg."
+LIMIT 1
+;";
+
+  $data = pwg_db_fetch_assoc(pwg_query($query));
+  
+  if (!empty($data))
+    return $data['id_user_FluxBB'];
+  else
+    return '0';  
+}
+
+
+
+function FluxBB_Deluser($id_user_FluxBB, $SuppTopicsPosts)
+{
+  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 = pwg_db_fetch_assoc(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 '".pwg_db_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/common.inc.php' );
+
+  $query = "
+SELECT id_user_FluxBB as FluxBB_id
+FROM ".Register_FluxBB_ID_TABLE."
+WHERE id_user_pwg = ".$pwg_id."
+;";
+
+  $row = pwg_db_fetch_assoc(pwg_query($query));
+
+  if (!empty($row))
+  {
+    $query = "
+UPDATE ".FluxBB_USERS_TABLE."
+SET username = '".pwg_db_real_escape_string($username)."', email = '".$adresse_mail."', password = '".$password."' 
+WHERE id = ".$row['FluxBB_id']."
+;";
+   
+    $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 '".pwg_db_real_escape_string($username)."'
+;";
+
+    $row = pwg_db_fetch_assoc(pwg_query($query));
+  
+    if (!empty($row))
+    {
+      $query = "
+UPDATE ".FluxBB_USERS_TABLE."
+SET username = '".pwg_db_real_escape_string($username)."', email = '".$adresse_mail."', password = '".$password."' 
+WHERE id = ".$row['FluxBB_id']."
+;";
+     
+      $result = pwg_query($query);
+      
+      FluxBB_Linkuser($pwg_id, $row['FluxBB_id']);
+    }
+  }
+}
+
+
+function RegFluxBB_Infos($dir)
+{
+  $path = $dir;
+
+  $plg_data = implode( '', file($path.'main.inc.php') );
+  if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) )
+  {
+    $plugin['name'] = trim( $val[1] );
+  }
+  if (preg_match("|Version: (.*)|", $plg_data, $val))
+  {
+    $plugin['version'] = trim($val[1]);
+  }
+  if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) )
+  {
+    $plugin['uri'] = trim($val[1]);
+  }
+  if ($desc = load_language('description.txt', $path.'/', array('return' => true)))
+  {
+    $plugin['description'] = trim($desc);
+  }
+  elseif ( preg_match("|Description: (.*)|", $plg_data, $val) )
+  {
+    $plugin['description'] = trim($val[1]);
+  }
+  if ( preg_match("|Author: (.*)|", $plg_data, $val) )
+  {
+    $plugin['author'] = trim($val[1]);
+  }
+  if ( preg_match("|Author URI: (.*)|", $plg_data, $val) )
+  {
+    $plugin['author uri'] = trim($val[1]);
+  }
+  if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid='))
+  {
+    list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']);
+    if (is_numeric($extension)) $plugin['extension'] = $extension;
+  }
+// IMPORTANT SECURITY !
+  $plugin = array_map('htmlspecialchars', $plugin);
+
+  return $plugin ;
+}
+
+function regfluxbb_obsolete_files()
+{
+  if (file_exists(REGFLUXBB_PATH.'obsolete.list')
+    and $old_files = file(REGFLUXBB_PATH.'obsolete.list', FILE_IGNORE_NEW_LINES)
+    and !empty($old_files))
+  {
+    array_push($old_files, 'obsolete.list');
+    foreach($old_files as $old_file)
+    {
+      $path = REGFLUXBB_PATH.$old_file;
+      if (is_file($path))
+      {
+        @unlink($path);
+      }
+    }
+  }
+}
+?>
Index: /extensions/Register_FluxBB/tags/2.3.0/include/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/include/index.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/include/index.php	(revision 6817)
@@ -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.3.0/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/index.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/index.php	(revision 6817)
@@ -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.3.0/language/de_DE/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/language/de_DE/index.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/language/de_DE/index.php	(revision 6817)
@@ -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.3.0/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/language/de_DE/plugin.lang.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/language/de_DE/plugin.lang.php	(revision 6817)
@@ -0,0 +1,159 @@
+<?php
+$lang['Tab_Info'] = 'Anleitung';
+$lang['Tab_Manage'] = 'Schritt 1 : Pluginkonfiguration';
+$lang['Tab_Migration'] = 'Step 2 : Kontenmigration';
+$lang['Tab_Synchro'] = 'Wartung : Kontensynchronisierung';
+
+$lang['Title'] = 'Register FluxBB';
+$lang['Disclaimer'] = '
+  *** Befolgen Sie bitte die folgenden zwei Schritte, um zu beginnen ***<br>
+  Step 1 : Konfigurieren Sie den Plugin für den Zugriff auf FluxBB.<br>
+  Step 2 : Migrieren Sie die Benutzerkonten von Piwigo nach FluxBB.<br><br>
+  Wenn dies erfolgt ist arbeitet der Plugin voll funktionstüchtig und Sie müssen diese Seiten nicht mehr aufsuchen.<br><br>
+  *** Für die Wartung bereits bestehender Verbindungen ***<br>
+  Wartung: : Tabellensynchronisation (im Fall des Hinzufügens, Aktualisierens oder Löschens eines Users) erlaubt Ihnen, Passwörter und e-mail Adressen auf den neuesten Stand zu bringen und unerwünschte User zu erkennen (Dies sollten Sie jedoch im Normalfall nicht benötigen).<br><br>
+  <div class="warning">Warnung !! Aus Sicherheitsgründen sollten Sie ein Backup Ihrer Datenbank anfertigen (Speziell die ###_user Tabellen).</div>';
+
+$lang['Config_Title'] = 'Pluginkonfiguration';
+$lang['Config_Disclaimer'] = '
+  Überprüfen Sie die Einstellungen ihrer FluxBB Installation und korrigieren Sie sie gegebenenfalls. <br>
+  Passen Sie das Verhalten des Plugins nach Ihren Wünschen an.';
+$lang['FluxBB_Prefix'] = 'FluxBB Tabellenpräfix :';
+$lang['FluxBB_Admin'] = 'Benutzername des Piwigo-administrators.';
+$lang['Guest'] = 'Benutzername des FluxBB Gast-benutzers.';
+$lang['User'] = '<div class="warning">Das Administratorkonto von FluxBB muss das selbe sein</div>';
+$lang['Details'] = 'Detailgrad der generierten Reports.';
+$lang['Details_true'] = ' --&gt; Alle Ergebnisdetails anzeigen.';
+$lang['Details_false'] = ' --&gt; Nur die wichtigsten Details der Ergebnisse anzeigen';
+$lang['Del_Pt'] = 'Löschen von Themen und Beiträgen, wenn ein Benutzer gelöscht wird.';
+$lang['Del_Pt_true'] = ' --&gt; Alle Löschen';
+$lang['Del_Pt_false'] = ' --&gt; Themen und Beiträge nicht löschen';
+$lang['Confirm'] = 'Bestätigung zum Löschen im Audit durch einen Administrator.';
+$lang['Confirm_true'] = ' --&gt; Bestätigung unterdrücken';
+$lang['Confirm_false'] = ' --&gt; Bestätigung erforderlich bevor Aktionen im Audit durchgeführt werden';
+
+$lang['save_config'] ='Einstellungen gespeichert';
+
+$lang['Audit_Btn'] = 'Audit';
+$lang['Sync_Btn'] = 'Synchronisierung';
+$lang['Sync_Title'] = 'Kontensynchronisierung von Piwigo nach FluxBB';
+$lang['Sync_Text'] = '
+  <div class="warning">Sie haben diesen Plugin bereits benutzt, um Piwigo mit FluxBB zu verbinden und/oder Ihr FluxBB Forum besitzt bereits Benutzerkonten!</div>
+  <br> -> Das bedeutet, dass in Ihrem Forum bereits Benutzerkonten angelegt sind.<br><br>
+  - Die Synchronisierung extrahiert die Daten durch Vergleichen der Benutzernamen und deren Passwörter (verschlüsselt) und e-mail Adressen in den beiden Tabellen [PrefixPWG]_user and [PrefixFluxBB]_user.<br>
+  - Anschliessend müssen Sie diese Daten fuer jedes Benutzerkonto von Piwigo nach FluxBB in die entsprechende Tabelle übertragen (außer für die Benutzer Piwigo Gast und FluxBB Anonym).<br>
+  - Danach müssen Sie die Benutzerkonten finden, die nur in einer der beiden ###_user Tabellen vorhanden sind.<br>
+  <br>
+  Abschliessend starten Sie einen Audit und suchen nach doppelt vorhandenen Benutzerkonten in FluxBB. Sollten Sie einen ausfindig machen, dann löschen Sie den Ältesten, indemSie die FluxBB Benutzerkonten nach dem Datum der Registrierung sortieren.<br>';
+$lang['Sync_Check_Dup'] = '<b>Analyse der Tabellen für Benutzerkonten von Piwigo und FluxBB, um Duplikate ausfindig zu machen.</b>';
+$lang['Advise_Check_Dup'] = '<b>Die Synchronisierung kann nicht fortgesetzt werden, wenn Sie doppelt vorhanden Benutzerkonten in Piwigo und FluxBB haben.</b><br><br>';
+$lang['Sync_Link_Break'] = '<b>Analyse von reparierbaren Links von Benutzerkonten in Piwigo und FluxBB</b>';
+$lang['Sync_Link_Bad'] = '<b>Analyse von falschen Beziehungen von Benutzerkonten in Piwigo und FluxBB</b>';
+$lang['Sync_DataUser'] = '<b>Analyse von Passwörtern und e-mail Adressen von Benutzerkonten in Piwigo und FluxBB</b>';
+$lang['Sync_PWG2FluxBB'] = '<b>Analyse von bestehenden Benutzerkonten in Piwigo und fehlenden Benutzerkonten in FluxBB</b>';
+$lang['Sync_FluxBB2PWG'] = '<b>Analyse von bestehenden Benutzerkonten in FluxBB und fehlenden Benutzerkonten in Piwogo</b>';
+$lang['Sync_OK'] = 'Synchronisierung OK<br><br>';
+
+$lang['Audit_PWG_Dup'] = '<b>Audit der Kontentabelle von Piwigo</b>';
+$lang['Error_PWG_Dup'] = '<b>Fehler in Piwigos Kontentabelle - Duplikate gefunden:</b> ';
+$lang['Advise_PWG_Dup'] = '<b>WARNUNG! Sie müssen diese Änderungen in Piwigo vornehmen bevor sie fortfahren<br>Benutzen Sie Piwigos Benutzerverwaltung, um das Problem zu beheben.</b>';
+
+$lang['Audit_FluxBB_Dup'] = '<b>Audit der Kontentabelle von FluxBB</b>';
+$lang['Error_FluxBB_Dup'] = '<b>Fehler in FluxBBs Kontentabelle - Duplikate gefunden:</b> ';
+$lang['Advise_FluxBB_Dup'] = '<b>WARNUNG! Sie müssen diese Änderungen in FluxBB vornehmen bevor sie fortfahren<br>Benutzen Sie die Icons, um die Benutzerkonten in FluxBB zu löschen und damit das Problem zu beheben.</b>';
+
+$lang['Audit_Link_Break'] = '<b>Audit von reparierbaren Links von Benutzerkonten in Piwigo und FluxBB</b>';
+$lang['Error_Link_Break'] = '<b>Fehlerhafter Link von Benutzerkonten in Piwigo und FluxBB:</b> ';
+$lang['New_Link'] = 'Verbundene Benutzerkonten: ';
+
+$lang['Audit_Link_Bad'] = '<b>Audit von fehlerhaften Links von Benutzerkonten in Piwigo und FluxBB</b>';
+$lang['Error_Link_Del'] = '<b>Fehler in der Linktabelle zwischen zwei Benutzerkonten:</b> ';
+$lang['Link_Del'] = 'Link löschen: ';
+$lang['Error_Link_Dead'] = '<b>Fehler in der Linktabelle, tote Links:</b> ';
+$lang['Link_Dead'] = 'Tote Links löschen ';
+$lang['Error_Link_Dup'] = '<b>Fehler in der Linktabelle, Duplikate gefunden:</b> ';
+$lang['Link_Dup'] = 'Duplikate löschen ';
+
+$lang['Audit_Synchro'] = '<b>Audit der Synchronisierung von Passwörtern und e-mail Adressen von Benutzerkonten in Piwigo und FluxBB</b>';
+$lang['Error_Synchro'] = '<b>Fehlerhafte Synchronisierung des Benutzerkontos:</b> ';
+$lang['Error_Synchro_Pswd'] = 'mit dem Passwort';
+$lang['Error_Synchro_Mail'] = 'mit der e-mail Adresse';
+$lang['Audit_Synchro_OK'] = ' <b>: Datensynchronisierung OK</b>';
+$lang['Sync_User'] = 'Kontensynchronisierung : ';
+
+$lang['Audit_PWG2FluxBB'] = '<b>Audit von vorhandenen Benutzerkonten in Piwigo und fehlenden Benutzerkonten in FluxBB</b>';
+$lang['Error_PWG2FluxBB'] = '<b>In FluxBB nicht vorhandene Piwigo Benutzerkonten:</b> ';
+$lang['Add_User'] = 'Benutzerkonto in FluxBB hinzufügen: ';
+
+$lang['Audit_FluxBB2PWG'] = '<b>Audit von vorhandenen Benutzerkonten in FluxBB und fehlenden Benutzerkonten in Piwigo</b>';
+$lang['Error_FluxBB2PWG'] = '<b>In Piwigo nicht vorhandene FluxBB Benutzerkonten:</b> ';
+$lang['Del_User'] = 'Benutzerkonto in FluxBB löschen: ';
+
+$lang['Audit_OK'] = 'Audit OK<br><br>';
+
+$lang['Mig_Btn'] = 'Migration';
+$lang['Mig_Title'] = 'Migration von Benutzerkonten von Piwigo nach FluxBB';
+$lang['Mig_Text'] = '
+  <div class="warning"> NUR BENUTZEN wenn Sie diesen Plugin noch nie benutzt haben, um Piwigo mit FluxBB zu verbinden <u>UND</u> wenn es in Ihrem Forum keine Benutzerkonten gibt !!!</b></div><br>
+  		--> In diesem Fall dürfen in der Tabelle [PrefixFluxBB]_user von FluxBB keine Benutzerkonten außer Gast und Administrator vorhanden sein.<br><br>
+  - Die Migration wird als Erstes alle Links zwischen Benutzerkonten in Piwigo und FluxBB entfernen.<br>
+  - Dann <b>WERDEN ALL FluxBB BENUTZERKONTEN GELÖSCHT</b> (mit Ausnahme der Konten Gast und Administrator).<br>
+  <br>
+  <div class="warning">WARNUNG SOLLTEN SIE SPEZIELLE BENUTZERKONTEN IN FluxBB HABEN == BENUTZEN SIE AUF KEINEN FALL DIESE FUNKTION !!!</div><br>
+  - Abschließend werden alle Piwigo Benutzerkonten bis auf Gast in FluxBB angelegt.<br>
+  <br>
+  Sollten Fehler auftreten müssen Sie die Ursachen beheben und die Migration erneut starten.<br>';
+$lang['Mig_Disclaimer'] = '<div class="warning"> FÜHREN SIE NIEMALS EINE MIGRATION ALS UPDATE DURCH !!!</div>';
+$lang['Mig_Start'] = '<b>Migration von Benutzerkonten von Piwigo nach FluxBB</b>';
+$lang['Mig_Del_Link'] = '<b>Links zwischen Benutzerkonten von Piwigo und FluxBB löschen</b>';
+$lang['Mig_Del_AllUsers'] = '<b>FluxBB Benutzerkonten löschen</b>';
+$lang['Mig_Del_User'] = '<b>Benutzerkonto löschen:</b> ';
+$lang['Mig_Add_AllUsers'] = '<b>Benutzerkonten von Piwigo werden übertragen</b>';
+$lang['Mig_Add_User'] = '<b>Übertragenes Benutzerkonto:</b> ';
+$lang['Mig_End'] = '<b>Migration abgeschlossen !</b>';
+$lang['Title_Tab'] = 'Register_FluxBB - Version: ';
+
+// --------- Starting below: New or revised $lang ---- from version 2.3.0
+/*TODO*/$lang['No_Reg_advise'] = '
+  For better integration, it is advisable to make the following changes to your FluxBB forum (<b>Warning: These changes will disappear when updating the forum</b>):
+<br><br>
+  <b>* In FluxBB\'s administration panel, change "Allow new registrations" to NO (in: Options - Registration)</b>
+<br><br>
+  <b>* Modify the file</b> : [FluxBBRoot]/lang/English/register.php by replacing the following line:
+  <div class="mod">\'No new regs\'				=>	\'This forum is not accepting new users.\'</div>
+  <b>with :</b>
+  <div class="info">\'No new regs\'				=>	\'&lt;a href=&quot;http://[YourPiwigoRoot]/register.php&quot; &gt; Go here to register &lt;/a&gt;&lt;br/&gt;&lt;br/&gt;\'</div>
+  <br>
+  Of course you should also make the same change for other languages of your FluxBB forum.
+<br><br>
+  <b>* Modify the file</b> : [FluxBBRoot]/login.php by replacing the line 69:
+  <div class="mod">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;login.php?action=forget&quot;&gt;</div>
+  <b>with :</b>
+  <div class="info">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;../[PiwigoRoot]/password.php&quot;&gt;</div>
+<br>
+  and at line 216:
+  <div class="mod">&lt;a href=&quot;login.php?action=forget&quot; tabindex=&quot;5&quot;><?php echo $lang_login[\'Forgotten pass\']</a></p></div>
+  <b>with :</b>
+  <div class="info">&lt;a href=&quot;../[PiwigoRoot]/password.php&quot; tabindex=&quot;5&quot;><?php echo $lang_login[\'Forgotten pass\']</a></p></div>
+  <br>';
+/*TODO*/$lang['About_Reg'] = 'About the registration of users on the forum FluxBB';
+/*TODO*/$lang['Bridge_UAM'] = 'Validation d\'accès au forum via le plugin UserAdvManager (UAM): Activez ici le pont entre les deux plugins qui vous permettra d\'interdir l\'accès à votre forum FluxBB tant que l\'utilisateur n\'a pas validé son inscription à la galerie (la fonction correspondante doit être active sur UAM). Access validation to the forum via UserAdvManager (UAM) plugin: Turn the bridge on between the two plugins that will allow you to prohibit the access to your FluxBB forum until the user has not validated its registration in the gallery (the function must be active on UAM).';
+/*TODO*/$lang['Bridge_UAM_true'] = ' --> Enable bridge Register_FluxBB / UAM';
+/*TODO*/$lang['Bridge_UAM_false'] = ' --> Disable bridge Register_FluxBB / UAM (default)';
+/*TODO*/$lang['FluxBB_Group'] = 'Précisez ici l\'ID du <b>groupe FluxBB</b> dans lequel les utilisateurs non validé doivent se trouver (à créer au préalable dans FluxBB). Pour être efficace, ce groupe ne doit avoir aucune permission sur le forum (voir à la fin de cette page pour les détails d\'utilisation de cette option).Specify the ID of <b>FluxBB\' group</b> in which non validated users must be (to be created in advance in FluxBB). To be effective, this group should have no permission on the forum (see the end of this page for details on using this option).';
+/*TODO*/$lang['About_Bridge'] = 'About Register_FluxBB / UAM bridge';
+/*TODO*/$lang['UAM_Bridge_advice'] = 'The UserAdvManager plugin allows forcing new registrants to confirm their registration before allowing them to access the entire gallery. The joint use of this plugin with Register_FluxBB can do the same on the forum linked: Registrants can not post until they have validated their registration in the gallery. <br>
+Here is the general procedure to apply:
+<br>
+- In the administration of your FluxBB forum, set at least 2 groups of users (for example: "validated" and "no_validated").<br>
+- Give the first group ("validated") access permissions you want on your forum and set it as the default group.<br>
+- Remove the second group ("no_validated") all permissions on your forum (the members of this group can only read public posts).<br>
+- Locate the ID of the second group "no_validated".<br>
+- Enter this ID in Register_FluxBB plugin, activate the bridge and save the settings.
+<br>
+<b class="mod"><u>Important notes:</u></b>
+<br>
+If you already use an earlier version of Register_FluxBB, Piwigo\'s accounts linked between your gallery and your FluxBB forum will not be impacted by the effects of the bridge. Only new registers will be impacted after activation of the bridge.<b><u>Accounts resynchronization function will be void.</u></b><br>
+Similarly, if you\'ve never used Register_FluxBB, the Piwigo\'s accounts migration phase from your gallery to your FluxBB forum will disregard the state validated or not for the accounts at the launch of the migration phase.';
+// --------- End: New or revised $lang ---- from version 2.3.0
+?>
Index: /extensions/Register_FluxBB/tags/2.3.0/language/en_UK/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/language/en_UK/index.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/language/en_UK/index.php	(revision 6817)
@@ -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.3.0/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/language/en_UK/plugin.lang.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/language/en_UK/plugin.lang.php	(revision 6817)
@@ -0,0 +1,159 @@
+<?php
+$lang['Tab_Info'] = 'Instructions';
+$lang['Tab_Manage'] = 'Step 1 : Plugin configuration';
+$lang['Tab_Migration'] = 'Step 2 : Accounts migration';
+$lang['Tab_Synchro'] = 'Maintenance : Accounts re-synchronization';
+
+$lang['Title'] = 'Register FluxBB';
+$lang['Disclaimer'] = '
+  *** To begin, follow this 2 steps ***<br>
+  Step 1 : Set plugin with the parameters of FluxBB.<br>
+  Step 2 : Migrate user accounts from Piwigo to FluxBB.<br><br>
+  After these 2 main steps, the plugin is fully functional and you will not have to return to this pages.<br><br>
+  *** For the maintenance of already active connections ***<br>
+  Maintenance : Synchronize tables (in case an addition, an update or a user deletion mismatched) allows to update passwords and email addresses and see users intruder (But you should not need to use ).<br><br>
+  <div class="warning">WARNING !! For safety, consider making a backup of your database, especially ###_user tables before any action.</div>';
+
+$lang['Config_Title'] = 'Plugin setup';
+$lang['Config_Disclaimer'] = '
+  Check the settings of your FluxBB installation and correct them if necessary. <br>
+  Change, if any, the behavior of the plugin at your convenience.';
+$lang['FluxBB_Prefix'] = 'FluxBB Prefix tables :';
+$lang['FluxBB_Admin'] = 'Username of the Piwigo administrator.';
+$lang['Guest'] = 'Username of the FluxBB Guest user.';
+$lang['User'] = '<div class="warning">FluxBB\'s administrator name must be the same</div>';
+$lang['Details'] = 'Level of detail in reports of operations.';
+$lang['Details_true'] = ' --&gt; View all details of the results of operations.';
+$lang['Details_false'] = ' --&gt; Shows that most of the results of operations';
+$lang['Del_Pt'] = 'Removal of topics and posts when the user is deleted.';
+$lang['Del_Pt_true'] = ' --&gt; Delete all';
+$lang['Del_Pt_false'] = ' --&gt; Don\'t delete topics and posts';
+$lang['Confirm'] = 'Delete confirmation on the administration actions in the audit.';
+$lang['Confirm_true'] = ' --&gt; Delete confirmation';
+$lang['Confirm_false'] = ' --&gt; Confirmation mandatory before actions in audit';
+
+$lang['save_config'] ='Settings saved';
+
+$lang['Audit_Btn'] = 'Audit';
+$lang['Sync_Btn'] = 'Synchronization';
+$lang['Sync_Title'] = 'Synchronize accounts from Piwigo to FluxBB';
+$lang['Sync_Text'] = '
+  <div class="warning">You\'ve already used the plugin to link your Piwigo (plugin update) and / or your FluxBB forum is not empty of users!</div>
+  <br> -> This means that your forum owns users.<br><br>
+  - Synchronization detect the data by comparing the usernames, passwords (encrypted) and their email address in both tables [PrefixPWG]_user and [PrefixFluxBB]_user.<br>
+  - Then update the table of correspondence as well as password and email address for each account from Piwigo to FluxBB except Piwigo Guest and FluxBB Anonymous.<br>
+  - Finally indicate mislead orphaned accounts that exist only in one of the 2 ###_user tables.<br>
+  <br>
+  At the end of the operation, launch an audit and check for possible duplicates users in FluxBB. If so, delete the oldest (sorting FluxBB users according to their date of registration).<br>';
+$lang['Sync_Check_Dup'] = '<b>Analyzing tables of user accounts of Piwigo and FluxBB to control duplicates</b>';
+$lang['Advise_Check_Dup'] = '<b>Impossible to continue the synchronization if you have duplicates in the User Account of Piwigo or FluxBB.</b><br><br>';
+$lang['Sync_Link_Break'] = '<b>Analysis of repairable links between accounts in Piwigo and FluxBB</b>';
+$lang['Sync_Link_Bad'] = '<b>Analysis of bad relationships between accounts in Piwigo and FluxBB</b>';
+$lang['Sync_DataUser'] = '<b>Analysis of passwords and email addresses between accounts in Piwigo and FluxBB</b>';
+$lang['Sync_PWG2FluxBB'] = '<b>Analysis of existing accounts in Piwigo and missing in FluxBB</b>';
+$lang['Sync_FluxBB2PWG'] = '<b>Analysis of existing accounts in FluxBB and missing in Piwigo</b>';
+$lang['Sync_OK'] = 'Synchronization OK<br><br>';
+
+$lang['Audit_PWG_Dup'] = '<b>Audit of Piwigo\'s accounts table</b>';
+$lang['Error_PWG_Dup'] = '<b>Error in Piwigo\'s accounts table, there are duplicates:</b> ';
+$lang['Advise_PWG_Dup'] = '<b>WARNING! You must make these corrections in Piwigo before continuing<br>use Piwigo\'s user manager to resolve the problem.</b>';
+
+$lang['Audit_FluxBB_Dup'] = '<b>Audit of FluxBB\'s accounts table</b>';
+$lang['Error_FluxBB_Dup'] = '<b>Error in FluxBB\'s accounts table, there are duplicates:</b> ';
+$lang['Advise_FluxBB_Dup'] = '<b>WARNING! You must make these corrections in FluxBB before continuing<br>use the icons to delete users from FluxBB and resolve the problem.</b>';
+
+$lang['Audit_Link_Break'] = '<b>Audit of repairable links between Piwigo and FluxBB accounts</b>';
+$lang['Error_Link_Break'] = '<b>Broken link between Piwigo and FluxBB accounts:</b> ';
+$lang['New_Link'] = 'Account linked: ';
+
+$lang['Audit_Link_Bad'] = '<b>Audit of bad links between Piwigo and FluxBB accounts</b>';
+$lang['Error_Link_Del'] = '<b>Error in the link table between 2 users:</b> ';
+$lang['Link_Del'] = 'Remove of link: ';
+$lang['Error_Link_Dead'] = '<b>Error in the link table, dead links:</b> ';
+$lang['Link_Dead'] = 'Remove of dead links ';
+$lang['Error_Link_Dup'] = '<b>Error in the link table, there are duplicates:</b> ';
+$lang['Link_Dup'] = 'Remove of duplicates ';
+
+$lang['Audit_Synchro'] = '<b>Audit of the synchronization of passwords and email addresses between Piwigo and FluxBB accounts</b>';
+$lang['Error_Synchro'] = '<b>Bad synchronization of account:</b> ';
+$lang['Error_Synchro_Pswd'] = 'on password';
+$lang['Error_Synchro_Mail'] = 'on email address';
+$lang['Audit_Synchro_OK'] = ' <b>: Data synchronization OK</b>';
+$lang['Sync_User'] = 'Account synchronization : ';
+
+$lang['Audit_PWG2FluxBB'] = '<b>Audit of the existing accounts in Piwigo and missing in FluxBB</b>';
+$lang['Error_PWG2FluxBB'] = '<b>The Piwigo account not in FluxBB:</b> ';
+$lang['Add_User'] = 'Adding in FluxBB of account: ';
+
+$lang['Audit_FluxBB2PWG'] = '<b>Audit of the existing accounts in FluxBB and missing in Piwigo</b>';
+$lang['Error_FluxBB2PWG'] = '<b>The FluxBB account not in Piwigo:</b> ';
+$lang['Del_User'] = 'Removal from FluxBB of account : ';
+
+$lang['Audit_OK'] = 'Audit OK<br><br>';
+
+$lang['Mig_Btn'] = 'Migration';
+$lang['Mig_Title'] = 'Migration of accounts from Piwigo to FluxBB';
+$lang['Mig_Text'] = '
+  <div class="warning"> USE ONLY IF you have never used the plugin to link Piwigo to FluxBB <u>AND IF</u> your forum is empty of users !!!</b></div><br>
+  		--> In this case, your table [PrefixFluxBB]_user of FluxBB must be empty of any account except the 2 accounts guest and administrator.<br><br>
+  - The migration will first remove the links between accounts of Piwigo and FluxBB.<br>
+  - Then <b>WILL DELETE ALL FluxBB ACCOUNTS</b> except the 2 accounts guest and administrator.<br>
+  <br>
+  <div class="warning">WARNING IF YOU HAVE ANY SPECIAL ACCOUNTS IN FluxBB == DO NOT USE THIS FUNCTION !!!</div><br>
+  - Finally, the migration will create all Piwigo\'s accounts in FluxBB, except the guest.<br>
+  <br>
+  If errors occur during operation, correct the cause of the problem and retry the operation of migration (at the time only you can renew the migration).<br>';
+$lang['Mig_Disclaimer'] = '<div class="warning"> NEVER PERFORM MIGRATION FOR UPDATING !!!</div>';
+$lang['Mig_Start'] = '<b>Migration of accounts from Piwigo to FluxBB</b>';
+$lang['Mig_Del_Link'] = '<b>Deleting links between accounts of Piwigo and FluxBB</b>';
+$lang['Mig_Del_AllUsers'] = '<b>Deleting FluxBB accounts</b>';
+$lang['Mig_Del_User'] = '<b>Deletion of the account:</b> ';
+$lang['Mig_Add_AllUsers'] = '<b>Transferring Piwigo accounts</b>';
+$lang['Mig_Add_User'] = '<b>Transfer of account:</b> ';
+$lang['Mig_End'] = '<b>Migration done !</b>';
+$lang['Title_Tab'] = 'Register_FluxBB - Version: ';
+
+// --------- Starting below: New or revised $lang ---- from version 2.3.0
+$lang['No_Reg_advise'] = '
+  For better integration, it is advisable to make the following changes to your FluxBB forum (<b>Warning: These changes will disappear when updating the forum</b>):
+<br><br>
+  <b>* In FluxBB\'s administration panel, change "Allow new registrations" to NO (in: Options - Registration)</b>
+<br><br>
+  <b>* Modify the file</b> : [FluxBBRoot]/lang/English/register.php by replacing the following line:
+  <div class="mod">\'No new regs\'				=>	\'This forum is not accepting new users.\'</div>
+  <b>with :</b>
+  <div class="info">\'No new regs\'				=>	\'&lt;a href=&quot;http://[YourPiwigoRoot]/register.php&quot; &gt; Go here to register &lt;/a&gt;&lt;br/&gt;&lt;br/&gt;\'</div>
+  <br>
+  Of course you should also make the same change for other languages of your FluxBB forum.
+<br><br>
+  <b>* Modify the file</b> : [FluxBBRoot]/login.php by replacing the line 69:
+  <div class="mod">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;login.php?action=forget&quot;&gt;</div>
+  <b>with :</b>
+  <div class="info">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;../[PiwigoRoot]/password.php&quot;&gt;</div>
+<br>
+  and at line 216:
+  <div class="mod">&lt;a href=&quot;login.php?action=forget&quot; tabindex=&quot;5&quot;><?php echo $lang_login[\'Forgotten pass\']</a></p></div>
+  <b>with :</b>
+  <div class="info">&lt;a href=&quot;../[PiwigoRoot]/password.php&quot; tabindex=&quot;5&quot;><?php echo $lang_login[\'Forgotten pass\']</a></p></div>
+  <br>';
+$lang['About_Reg'] = 'About the registration of users on the forum FluxBB';
+$lang['Bridge_UAM'] = 'Validation d\'accès au forum via le plugin UserAdvManager (UAM): Activez ici le pont entre les deux plugins qui vous permettra d\'interdir l\'accès à votre forum FluxBB tant que l\'utilisateur n\'a pas validé son inscription à la galerie (la fonction correspondante doit être active sur UAM). Access validation to the forum via UserAdvManager (UAM) plugin: Turn the bridge on between the two plugins that will allow you to prohibit the access to your FluxBB forum until the user has not validated its registration in the gallery (the function must be active on UAM).';
+$lang['Bridge_UAM_true'] = ' --> Enable bridge Register_FluxBB / UAM';
+$lang['Bridge_UAM_false'] = ' --> Disable bridge Register_FluxBB / UAM (default)';
+$lang['FluxBB_Group'] = 'Précisez ici l\'ID du <b>groupe FluxBB</b> dans lequel les utilisateurs non validé doivent se trouver (à créer au préalable dans FluxBB). Pour être efficace, ce groupe ne doit avoir aucune permission sur le forum (voir à la fin de cette page pour les détails d\'utilisation de cette option).Specify the ID of <b>FluxBB\' group</b> in which non validated users must be (to be created in advance in FluxBB). To be effective, this group should have no permission on the forum (see the end of this page for details on using this option).';
+$lang['About_Bridge'] = 'About Register_FluxBB / UAM bridge';
+$lang['UAM_Bridge_advice'] = 'The UserAdvManager plugin allows forcing new registrants to confirm their registration before allowing them to access the entire gallery. The joint use of this plugin with Register_FluxBB can do the same on the forum linked: Registrants can not post until they have validated their registration in the gallery. <br>
+Here is the general procedure to apply:
+<br>
+- In the administration of your FluxBB forum, set at least 2 groups of users (for example: "validated" and "no_validated").<br>
+- Give the first group ("validated") access permissions you want on your forum and set it as the default group.<br>
+- Remove the second group ("no_validated") all permissions on your forum (the members of this group can only read public posts).<br>
+- Locate the ID of the second group "no_validated".<br>
+- Enter this ID in Register_FluxBB plugin, activate the bridge and save the settings.
+<br>
+<b class="mod"><u>Important notes:</u></b>
+<br>
+If you already use an earlier version of Register_FluxBB, Piwigo\'s accounts linked between your gallery and your FluxBB forum will not be impacted by the effects of the bridge. Only new registers will be impacted after activation of the bridge.<b><u>Accounts resynchronization function will be void.</u></b><br>
+Similarly, if you\'ve never used Register_FluxBB, the Piwigo\'s accounts migration phase from your gallery to your FluxBB forum will disregard the state validated or not for the accounts at the launch of the migration phase.';
+// --------- End: New or revised $lang ---- from version 2.3.0
+?>
Index: /extensions/Register_FluxBB/tags/2.3.0/language/fr_FR/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/language/fr_FR/index.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/language/fr_FR/index.php	(revision 6817)
@@ -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.3.0/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/language/fr_FR/plugin.lang.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/language/fr_FR/plugin.lang.php	(revision 6817)
@@ -0,0 +1,160 @@
+<?php
+$lang['Tab_Info'] = 'Instructions';
+$lang['Tab_Manage'] = 'Etape 1 : Configuration du plugin';
+$lang['Tab_Migration'] = 'Etape 2 : Migration des comptes';
+$lang['Tab_Synchro'] = 'Maintenance : Resynchronisation des comptes';
+
+$lang['Title'] = 'Register FluxBB';
+$lang['Disclaimer'] = '
+  *** Pour débuter, 2 étapes à suivre ***<br>
+  1ère étape : Configurer les paramètres du plugin avec les paramètres de FluxBB.<br>
+  2ème étape : Migrer les comptes utilisateurs de Piwigo vers FluxBB.<br><br>
+  A l\'issue des 2 étapes principales, le plugin sera pleinement fonctionnel et vous n\'aurez plus à revenir sur cette page.<br><br>
+  *** Pour maintenir les liaisons déjà actives ***<br>
+  Maintenance : Synchroniser les tables (dans le cas où un ajout, une mise à jour ou une suppression d\'utilisateur s\'est mal déroulée) permet de remettre à jour mots de passe et adresses email et voir les utilisateurs intrus (Mais vous ne devriez pas avoir à l\'utiliser).<br><br>
+  <div class="warning">Pensez faire une sauvegarde de votre base et spécialement de vos tables ###_USERS avant toutes actions par mesure de sécurité.</div>';
+
+$lang['Config_Title'] = 'Configuration du plugin';
+$lang['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['Prefix'] = 'Préfixe des tables de FluxBB :';
+$lang['Admin'] = 'Nom d\'utilisateur de l\'administrateur de Piwigo.';
+$lang['Guest'] = 'Nom d\'utilisateur de l\'invité de FluxBB.';
+$lang['User'] = '<div class="warning">Le nom de l\'administrateur de FluxBB doit être identique</div>';
+$lang['Details'] = 'Niveau de détails dans les rapports d\'opérations.';
+$lang['Details_true'] = ' --&gt; Afficher tous les détails des résultats sur les opérations.';
+$lang['Details_false'] = ' --&gt; N\'affiche que l\'essentiel des résultats sur les opérations';
+$lang['Del_Pt'] = 'Suppression des topics et posts de l\'utilisateur lorsqu\'il est supprimé.';
+$lang['Del_Pt_true'] = ' --&gt; Supprime tout';
+$lang['Del_Pt_false'] = ' --&gt; Ne supprime pas les posts et les topics';
+$lang['Confirm'] = 'Suppression des confirmations sur les actions d\'administration dans l\'audit.';
+$lang['Confirm_true'] = ' --&gt; Supprime les confirmations';
+$lang['Confirm_false'] = ' --&gt; Confirmation obligatoire avant action dans l\'audit';
+
+$lang['save_config'] ='Configuration enregistrée.';
+
+$lang['Audit_Btn'] = 'Audit';
+$lang['Sync_Btn'] = 'Synchronisation';
+$lang['Sync_Title'] = 'Synchronisation des comptes Piwigo vers FluxBB';
+$lang['Sync_Text'] = '
+  <div class="warning">Vous avez déjà utilisé le plugin pour lier votre Piwigo (mise à jour du plugin) et/ou votre forum FluxBB n\'est pas vide d\'utilisateurs !!!</div><br>
+  <br> -> Ceci signifie que votre forum posséde des utilisateurs.<br><br>
+  - La synchronisation détectera les données présentes en comparant les noms des utilisateurs, leur mot de passe (crypté) et leur adresse email dans les deux tables [PrefixPWG]_users et [PrefixFluxBB]_users.<br>
+  - Puis mettra à jour cette table de correspondance ainsi que le mot de passe et l\'adresse email de chaque compte depuis Piwigo vers FluxBB sauf Piwigo Guest et FluxBB Anonymous.<br>
+  - Enfin indiquera en erreur les comptes orphelins qui n\'existent que dans l\'une des 2 tables ###_USERS.<br>
+  <br>
+  A l\'issue de l\'opération lancez un AUDIT et veuillez vérifier la présence de doublons éventuels dans les utilisateurs de FluxBB, si c\'est le cas, il faut supprimer les plus anciens (tri des utilisateurs FluxBB selon leur date d\'incription).<br>';
+$lang['Sync_Check_Dup'] = '<b>Analyse des tables des comptes utilisateurs de Piwigo et FluxBB pour contrôler les doublons</b>';
+$lang['Advise_Check_Dup'] = '<b>IMPOSSIBLE de continuer la synchronisation si vous avez des doublons dans les comptes utilisateurs de Piwigo ou FluxBB.</b><br><br>';
+$lang['Sync_Link_Break'] = '<b>Analyse des liens réparables entre les comptes Piwigo et FluxBB</b>';
+$lang['Sync_Link_Bad'] = '<b>Analyse des mauvais liens entre les comptes Piwigo et FluxBB</b>';
+$lang['Sync_DataUser'] = '<b>Analyse des mots de passe et des adresses emails entre les comptes Piwigo et FluxBB</b>';
+$lang['Sync_PWG2FluxBB'] = '<b>Analyse des comptes existants dans Piwigo et manquants dans FluxBB</b>';
+$lang['Sync_FluxBB2PWG'] = '<b>Analyse des comptes existants dans FluxBB et manquants dans Piwigo</b>';
+$lang['Sync_OK'] = 'Synchronisation OK<br><br>';
+
+$lang['Audit_PWG_Dup'] = '<b>Audit de la table des comptes de Piwigo</b>';
+$lang['Error_PWG_Dup'] = '<b>Erreur dans la table des comptes Piwigo, il y a des doublons :</b> ';
+$lang['Advise_PWG_Dup'] = '<b>ATTENTION ! Vous devez faire ces corrections dans Piwigo avant de continuer<br>utilisez le gestionnaires d\'utilisateurs de Piwigo pour régler le problème.</b>';
+
+$lang['Audit_FluxBB_Dup'] = '<b>Audit de la table des comptes FluxBB</b>';
+$lang['Error_FluxBB_Dup'] = '<b>Erreur dans la table des comptes FluxBB, il y a des doublons :</b> ';
+$lang['Advise_FluxBB_Dup'] = '<b>ATTENTION Vous devez faire ces corrections dans FluxBB avant de continuer<br>utilisez les icones pour supprimer les utilisateurs de FluxBB et régler le problème.</b>';
+
+$lang['Audit_Link_Break'] = '<b>Audit des liens réparables entre les comptes Piwigo et FluxBB</b>';
+$lang['Error_Link_Break'] = '<b>Lien brisé entre les comptes Piwigo et FluxBB :</b> ';
+$lang['New_Link'] = 'Liaison du compte : ';
+
+$lang['Audit_Link_Bad'] = '<b>Audit des mauvais liens entre les comptes Piwigo et FluxBB</b>';
+$lang['Error_Link_Del'] = '<b>Erreur dans la table de lien entre les 2 utilisateurs :</b> ';
+$lang['Link_Del'] = 'Suppression du lien : ';
+$lang['Error_Link_Dead'] = '<b>Erreur dans la table de lien, des liens morts existent :</b> ';
+$lang['Link_Dead'] = 'Suppression du liens morts ';
+$lang['Error_Link_Dup'] = '<b>Erreur dans la table de lien, il y a des doublons :</b> ';
+$lang['Link_Dup'] = 'Suppression des liens dupliqués ';
+
+$lang['Audit_Synchro'] = '<b>Audit de la synchronisation des mots de passe et des adresses emails entre les comptes Piwigo et FluxBB</b>';
+$lang['Error_Synchro'] = '<b>Mauvaise synchronisation du compte :</b> ';
+$lang['Error_Synchro_Pswd'] = 'pour le mot de passe';
+$lang['Error_Synchro_Mail'] = 'pour l\'adresse email';
+$lang['Audit_Synchro_OK'] = ' <b>: Synchro des données OK</b>';
+$lang['Sync_User'] = 'Synchronisation du compte : ';
+
+$lang['Audit_PWG2FluxBB'] = '<b>Audit des comptes existants dans Piwigo et manquants dans FluxBB</b>';
+$lang['Error_PWG2FluxBB'] = '<b>Le compte Piwigo n\'existe pas dans FluxBB :</b> ';
+$lang['Add_User'] = 'Ajout dans FluxBB du compte : ';
+
+$lang['Audit_FluxBB2PWG'] = '<b>Audit des comptes existants dans FluxBB et manquants dans Piwigo</b>';
+$lang['Error_FluxBB2PWG'] = '<b>Le compte FluxBB n\'existe pas dans Piwigo :</b> ';
+$lang['Del_User'] = 'Suppression de FluxBB du compte : ';
+
+$lang['Audit_OK'] = 'Audit OK<br><br>';
+
+$lang['Mig_Btn'] = 'Migration';
+$lang['Mig_Title'] = 'Migration des comptes de Piwigo vers FluxBB';
+$lang['Mig_Text'] = '
+  <div class="warning"> A N\'UTILISER QUE SI vous n\'avez jamais utilisé le plugin pour lier Piwigo à FluxBB <u>ET SI</u> votre forum est vide d\'utilisateurs !!!</div><br>
+  		--> Dans ce cas, votre table [PrefixFluxBB]_users de FluxBB doit être vide de tout compte sauf les 2 comptes d\'invité et d\'administrateur.<br><br>
+  - La migration va d\'abord supprimer les liens des comptes entre Piwigo et FluxBB.<br>
+  - Puis <b>SUPPRIMERA TOUS LES COMPTES FluxBB</b> sauf les 2 comptes d\'invité et d\'administrateur.<br>
+  <br>
+  <div class="warning">ATTENTION SI VOUS AVEZ DES COMPTES PARTICULIERS DANS FluxBB == NE SURTOUT PAS UTILISER CETTE FONCTION !!!</div><br>
+  - Enfin la migration va créer tout les comptes de Piwigo dans FluxBB sauf l\'invité.<br>
+  <br>
+  Si des erreurs se produisent pendant l\'opération, corrigez la cause du problème et recommencez l\'opération de migration (à ce moment là seulement vous pouvez renouveller la migration).<br>';
+$lang['Mig_Disclaimer'] = '<div class="warning"> NE JAMAIS EFFECTUER DE MIGRATION POUR METTRE A JOUR !!!</div>';
+$lang['Mig_Start'] = '<b>Migration des comptes Piwigo vers FluxBB</b>';
+$lang['Mig_Del_Link'] = '<b>Suppression des liens entre les comptes Piwigo et FluxBB</b>';
+$lang['Mig_Del_AllUsers'] = '<b>Suppression des comptes FluxBB</b>';
+$lang['Mig_Del_User'] = '<b>Suppression du compte :</b> ';
+$lang['Mig_Add_AllUsers'] = '<b>Transfert des comptes Piwigo</b>';
+$lang['Mig_Add_User'] = '<b>Transfert du compte :</b> ';
+$lang['Mig_End'] = '<b>Migration finie !</b>';
+$lang['Title_Tab'] = 'Register_FluxBB - Version: ';
+
+
+// --------- Starting below: New or revised $lang ---- from version 2.3.0
+$lang['No_Reg_advise'] = '
+  Pour une meilleur intégration, il est conseillé d\'apporter les modifications suivantes à votre forum FluxBB (<b>Attention! Ces modifications disparaitront en cas de mise à jour du forum</b>):
+<br><br>
+  <b>* Modifier dans l\'interface d\'administration de FluxBB l\'option "Autoriser les nouvelles inscriptions" à NON ( dans : Options - Inscriptions )</b>
+<br><br>
+  <b>* Modifier le fichier</b> : [RacineDeFluxBB]/lang/French/register.php en remplacant la ligne suivante:
+  <div class="mod">\'No new regs\'				=>	\'Ce forum n\\\'accepte pas de nouveaux utilisateurs.\'</div>
+  <b>par :</b>
+  <div class="info">\'No new regs\'				=>	\'&lt;a href=&quot;http://[VotreRacineDePiwigo]/register.php&quot; &gt; Cliquez ici pour vous inscrire &lt;/a&gt;&lt;br/&gt;&lt;br/&gt;\'</div>
+  <br>
+  Et reporter cette modification pour toutes les langues gérées sur votre forum.
+<br><br>
+  <b>* Modifier le fichier</b> : [RacineDeFluxBB]/login.php en remplacant à la ligne 69:
+  <div class="mod">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;login.php?action=forget&quot;&gt;</div>
+  <b>par :</b>
+  <div class="info">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;../[VotreRacineDePiwigo]/password.php&quot;&gt;</div>
+<br>
+  à la ligne 216:
+  <div class="mod">&lt;a href=&quot;login.php?action=forget&quot; tabindex=&quot;5&quot;&gt;&lt;?php echo $lang_login[\'Forgotten pass\']&lt;/a&gt;</div>
+  <b>par :</b>
+  <div class="info">&lt;a href=&quot;../[VotreRacineDePiwigo]/password.php&quot; tabindex=&quot;5&quot;&gt;&lt;?php echo $lang_login[\'Forgotten pass\']&lt;/a&gt;</div>
+  <br>';
+$lang['About_Reg'] = 'A propos de l\'enregistrement d\'utilisateur sur le forum FluxBB';
+$lang['Bridge_UAM'] = 'Validation d\'accès au forum via le plugin UserAdvManager (UAM): Activez ici le pont entre les deux plugins qui vous permettra d\'interdir l\'accès à votre forum FluxBB tant que l\'utilisateur n\'a pas validé son inscription à la galerie (la fonction correspondante doit être active sur UAM).';
+$lang['Bridge_UAM_true'] = ' --> Pont Register_FluxBB / UAM activé';
+$lang['Bridge_UAM_false'] = ' --> Pont Register_FluxBB / UAM désactivé (par défaut)';
+$lang['FluxBB_Group'] = 'Précisez ici l\'ID du <b>groupe FluxBB</b> dans lequel les utilisateurs non validé doivent se trouver (à créer au préalable dans FluxBB). Pour être efficace, ce groupe ne doit avoir aucune permission sur le forum (voir à la fin de cette page pour les détails d\'utilisation de cette option).';
+$lang['About_Bridge'] = 'A propos du pont Register_FluxBB / UAM';
+$lang['UAM_Bridge_advice'] = 'Le plugin UserAdvManager permet de forcer les nouveaux inscrits à valider leur inscription avant de leur permettre d\'accéder à la totalité de la galerie. L\'utilisation conjointe de ce plugin avec Register_FluxBB permet de faire de même sur le forum lié: Ils ne pourront pas poster tant qu\'ils n\'auront pas validé leur inscription à la galerie.<br>
+Voici la procédure générale à appliquer:
+<br><br>
+- Dans la partie d\'administration de votre forum FluxBB, établissez au minimum 2 groupes d\'utilisateurs (par exemple: "validés" et "non_validés").<br>
+- Attribuez au premier groupe ("validés") les permissions d\'accès souhaitées sur votre forum et définissez le comme groupe par défaut.<br>
+- Retirez au second groupe ("non_validés") toutes les permissions sur votre forum (les membres de ce groupe ne pourront que lire les posts publics).<br>
+- Repérez l\'ID du second groupe "non_validés".<br>
+- Notez l\'ID dans le plugin Register_FluxBB, activez le pont et sauvegardez les paramètres.
+<br><br>
+<b class="mod"><u>Notes importantes:</u></b>
+<br><br>
+Si vous utilisiez déjà Register_FluxBB dans une version antérieur, les comptes liés entre votre galerie Piwigo et votre forum FluxBB ne seront pas impactés par les effets du pont. Seuls les nouveaux inscrits après l\'activation du pont y seront soumis.<b><u>La fonction de resynchronisation des comptes sera sans effet.</u></b><br><br>
+De même, si vous n\'avez jamais utilisé Register_FluxBB, la phase de migration des comptes de votre galerie Piwigo vers votre forum FluxBB ne tiendra pas compte de l\'état validé ou non de vos inscrits au moment du lancement de la phase de migration.';
+// --------- End: New or revised $lang ---- from version 2.3.0
+?>
Index: /extensions/Register_FluxBB/tags/2.3.0/language/index.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/language/index.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/language/index.php	(revision 6817)
@@ -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.3.0/main.inc.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/main.inc.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/main.inc.php	(revision 6817)
@@ -0,0 +1,275 @@
+<?php
+/*
+Plugin Name: Register FluxBB
+Version: 2.3.0
+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
+
+2.2.0     - 03/04/10  - Piwigo 2.1 compatibility
+                      - Adding css file
+                      - Templates refactory: Moved with css in a "template" subdirectory of admin directory, Moving icons in template directory, using css rules to improve important text display
+                      - functions_Register_FluxBB.inc.php renamed in functions.inc.php
+                      - Language files revision
+                      - Obsolete files management
+
+2.2.1     - 04/04/10  - Bug 1577 fixed : Multiple database support
+
+2.2.2     - 23/05/10  - Bug 1674 fixed : Adding of mods for Fluxbb when users loose their password
+                      - Adding of German language (Thx to duke)
+
+2.2.3     - 23/05/10  - Bug 1674 re-fixed : Bad link fixed
+                      - Re-adding of German language that was missed at last release :-( (Thx to duke)
+
+2.2.4     - 22/08/10  - Bug 1812 fixed : Compliance with FluxBB 1.4
+
+2.3.0     - 01/09/10  - Bug 1434 fixed : Bridge between Register_FluxBB and UserAdvManager for new users validation
+--------------------------------------------------------------------------------
+*/
+
+// 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!');
+
+if (!defined('REGFLUXBB_DIR')) define('REGFLUXBB_DIR' , basename(dirname(__FILE__)));
+if (!defined('REGFLUXBB_PATH')) define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+
+include_once (REGFLUXBB_PATH.'include/constants.php');
+include_once (REGFLUXBB_PATH.'include/functions.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(REGFLUXBB_PATH.'admin/admin.php')));
+  return $menu;
+}
+
+
+/* user creation*/
+add_event_handler('register_user', 'Register_FluxBB_Adduser');
+
+function Register_FluxBB_Adduser($register_user)
+{
+  global $conf;
+	
+  include_once (REGFLUXBB_PATH.'include/functions.inc.php');
+
+  // Warning : FluxBB uses Sha1 hash instead of md5 for Piwigo!
+  FluxBB_Adduser($register_user['id'], $register_user['username'], sha1($_POST['password']), $register_user['email']);
+}
+
+
+/* user deletion */
+add_event_handler('delete_user', 'Register_FluxBB_Deluser');
+
+function Register_FluxBB_Deluser($user_id)
+{
+  include_once (REGFLUXBB_PATH.'include/functions.inc.php');
+
+  FluxBB_Deluser( FluxBB_Searchuser($user_id), true );
+}
+
+
+
+add_event_handler('init', 'Register_FluxBB_InitPage');
+ 
+function Register_FluxBB_InitPage()
+{
+  global $conf, $user ;
+  include_once (REGFLUXBB_PATH.'include/functions.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) = pwg_db_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 (REGFLUXBB_PATH.'include/functions.inc.php');
+      
+        $query = '
+SELECT '.$conf['user_fields']['username'].' AS username
+FROM '.USERS_TABLE.'
+WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+;';
+
+        list($username) = pwg_db_fetch_row(pwg_query($query));
+
+        FluxBB_Updateuser($user['id'], stripslashes($username), sha1($_POST['use_new_pwd']), $_POST['mail_address']);
+      }
+    }
+  }
+}
+
+
+/* Access validation in FluxBB when validated in Piwigo through UAM plugin */
+add_event_handler('login_success', 'UAM_Bridge');
+
+function UAM_Bridge()
+{
+  global $conf, $user;
+  
+  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+  
+  // Check if UAM is installed and if bridge is set - Exception for admins and webmasters
+  if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true' and !is_admin() and !is_webmaster())
+  {
+    $conf_UAM = unserialize($conf['UserAdvManager']);
+    
+    // Getting unvalidated users group else Piwigo's default group
+    if (isset($conf_UAM[2]) and $conf_UAM[2] != '-1')
+    {
+      $Waitingroup = $conf_UAM[2];
+    }
+    else
+    {
+      $query = '
+SELECT id
+FROM '.GROUPS_TABLE.'
+WHERE is_default = "true"
+LIMIT 1
+;';
+      $data = pwg_db_fetch_assoc(pwg_query($query));
+      $Waitingroup = $data['id'];
+    }
+    
+    // check if logged in user is in a Piwigo's validated or unvalidated users group
+    $query = '
+SELECT *
+FROM '.USER_GROUP_TABLE.'
+WHERE user_id = '.$user['id'].'
+AND group_id = '.$Waitingroup.'
+;';
+    $count = pwg_db_num_rows(pwg_query($query));
+
+    // Check if logged in user is in a FluxBB's unvalidated group
+    $query = "
+SELECT group_id
+FROM ".FluxBB_USERS_TABLE."
+WHERE id = ".FluxBB_Searchuser($user['id'])."
+;";
+
+    $data = pwg_db_fetch_assoc(pwg_query($query));
+
+    // Logged in user switch to the default FluxBB's group if he'is validated
+    if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB[7])
+    {
+      $query = "
+SELECT conf_value
+FROM ".FluxBB_CONFIG_TABLE."
+WHERE conf_name = 'o_default_user_group'
+;";
+
+      $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));
+      
+      $query = "
+UPDATE ".FluxBB_USERS_TABLE."
+SET group_id = ".$o_default_user_group['conf_value']." 
+WHERE id = ".FluxBB_Searchuser($user['id'])."
+;";
+      pwg_query($query);
+    }
+  }
+}
+?>
Index: /extensions/Register_FluxBB/tags/2.3.0/maintain.inc.php
===================================================================
--- /extensions/Register_FluxBB/tags/2.3.0/maintain.inc.php	(revision 6817)
+++ /extensions/Register_FluxBB/tags/2.3.0/maintain.inc.php	(revision 6817)
@@ -0,0 +1,80 @@
+<?php
+
+if(!defined("REGFLUXBB_DIR")) define('REGFLUXBB_DIR' , basename(dirname(__FILE__)));
+if(!defined("REGFLUXBB_PATH")) define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.REGFLUXBB_DIR.'/');
+//ini_set('error_reporting', E_ALL);
+//ini_set('display_errors', true);
+
+include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+include_once (REGFLUXBB_PATH.'include/constants.php');
+include_once (REGFLUXBB_PATH.'include/functions.inc.php');
+
+
+function plugin_install()
+{
+  global $prefixeTable;
+
+  $q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true;false;0","Parametres Register_FluxBB")
+;';
+    
+  pwg_query($q);
+  
+  $q = "
+CREATE TABLE IF NOT EXISTS ".Register_FluxBB_ID_TABLE." (
+  id_user_pwg smallint(5) NOT NULL default '0',
+  id_user_FluxBB int(10) NOT NULL default '0',
+PRIMARY KEY  (id_user_pwg),
+  KEY id_user_pwg (id_user_pwg, id_user_FluxBB)
+)
+;";
+
+  pwg_query($q);
+
+}
+
+function plugin_activate()
+{
+  global $conf;
+
+/* Cleaning obsolete files */
+/* *********************** */
+  regfluxbb_obsolete_files();
+
+/* Check version < 2.3.0 */
+  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+  
+  if (!isset($conf_Register_FluxBB[6]) and !isset($conf_Register_FluxBB[7]))
+  {
+    $upgrade_RFBB = $conf_Register_FluxBB[0].';'.$conf_Register_FluxBB[1].';'.$conf_Register_FluxBB[2].';'.$conf_Register_FluxBB[3].';'.$conf_Register_FluxBB[4].';'.$conf_Register_FluxBB[5].';false;0';
+		
+    $query = '
+UPDATE '.CONFIG_TABLE.'
+SET value="'.$upgrade_RFBB.'"
+WHERE param="Register_FluxBB"
+LIMIT 1
+;';
+		pwg_query($query);
+  }
+}
+
+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 );
+
+}
+?>
