Index: /extensions/Register_PhpBB/admin/admin.php
===================================================================
--- /extensions/Register_PhpBB/admin/admin.php	(revision 7795)
+++ /extensions/Register_PhpBB/admin/admin.php	(revision 7795)
@@ -0,0 +1,1148 @@
+<?php
+
+global $user, $lang, $conf, $template, $errors;
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+if (!defined('REGPHPBB_PATH')) define('REGPHPBB_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', REGPHPBB_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 =  RegPhpBB_Infos(REGPHPBB_PATH);
+$version = $plugin['version'] ;
+
+// +-----------------------------------------------------------------------+
+// |                            Functions
+// +-----------------------------------------------------------------------+
+function Audit_PWG_PhpBB()
+{
+  global $page, $conf, $errors;
+
+  $conf_Register_PhpBB = isset($conf['Register_PhpBB']) ? explode(";" , $conf['Register_PhpBB']) : array();
+
+  $page_Register_PhpBB_admin = get_admin_plugin_menu_link(__FILE__);
+
+
+
+  $msg_error_PWG_Dup = '';
+  $msg_error_PhpBB_Dup = '';
+  $msg_error_Link_Break = '';
+  $msg_error_Link_Bad = '';
+  $msg_error_Synchro = '';
+  $msg_ok_Synchro = '';
+  $msg_error_PWG2PhpBB = '';
+  $msg_error_PhpBB2PWG = '';
+
+
+
+  $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 ".PhpBB_USERS_TABLE."
+GROUP BY BINARY username
+HAVING COUNT(*) > 1
+;";
+  $result = pwg_query($query);
+
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    $msg_error_PhpBB_Dup .= '<br>'.l10n('Error_PhpBB_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']);
+
+    $subquery = "
+SELECT user_id, username, user_email
+FROM ".PhpBB_USERS_TABLE."
+WHERE BINARY username = BINARY '".$row['username']."'
+;";
+    $subresult = pwg_query($subquery);
+
+    while($subrow = pwg_db_fetch_assoc($subresult))
+    {
+      $msg_error_PhpBB_Dup .= '<br>id:'.$subrow['user_id'].'='.stripslashes($subrow['username']).' ('.$subrow['user_email'].')';
+
+      if ( !is_adviser() )
+      {
+        $msg_error_PhpBB_Dup .= ' <a href="';
+
+        $msg_error_PhpBB_Dup .= add_url_params($page_Register_PhpBB_admin, array(
+          'action' => 'del_user',
+          'user_id' => $subrow['user_id'],
+        ));
+
+        $msg_error_PhpBB_Dup .= '" title="'.l10n('Del_User').stripslashes($subrow['username']).'"';
+
+        $msg_error_PhpBB_Dup .= $conf_Register_PhpBB[3]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+        $msg_error_PhpBB_Dup .= '><img src="'.REGPHPBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').$subrow['username'].'" /></a>';
+      }
+    }
+  }
+
+  if ($msg_error_PhpBB_Dup == '')
+    array_push($page['infos'], l10n('Audit_PhpBB_Dup').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_PhpBB_Dup = l10n('Audit_PhpBB_Dup').$msg_error_PhpBB_Dup.'<br>'.l10n('Advise_PhpBB_Dup');
+
+
+
+  $query = "
+SELECT pwg.id as pwg_id, bb.user_id as bb_id, pwg.username as pwg_user, pwg.mail_address as pwg_mail
+FROM ".PhpBB_USERS_TABLE." AS bb, ".USERS_TABLE." as pwg
+WHERE bb.user_id NOT in (
+  SELECT id_user_PhpBB
+  FROM ".Register_PhpBB_ID_TABLE."
+  )
+AND pwg.id NOT in (
+  SELECT id_user_pwg
+  FROM ".Register_PhpBB_ID_TABLE."
+  )
+AND pwg.username = bb.username
+AND pwg.mail_address = bb.user_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_PhpBB_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_PhpBB[3]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+      $msg_error_Link_Break .= '><img src="'.REGPHPBB_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.user_id as bb_id, bb.username as bb_user, bb.user_email as bb_mail
+FROM ".PhpBB_USERS_TABLE." AS bb
+INNER JOIN ".Register_PhpBB_ID_TABLE." AS link ON link.id_user_PhpBB = bb.user_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_PhpBB_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_PhpBB[3]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+      $msg_error_Link_Bad .= '><img src="'.REGPHPBB_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_PhpBB_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_PhpBB[3]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+      $msg_error_Link_Bad .= '><img src="'.REGPHPBB_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_PhpBB_ID_TABLE." AS Link
+WHERE id_user_PhpBB NOT IN (
+  SELECT user_id
+  FROM ".PhpBB_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_PhpBB_admin, array(
+        'action'   => 'link_dead',
+      ));
+
+      $msg_error_Link_Bad .= '" title="'.l10n('Link_Dead').$Compteur['nbr_dead'].'"';
+
+      $msg_error_Link_Bad .= $conf_Register_PhpBB[3]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+      $msg_error_Link_Bad .= '><img src="'.REGPHPBB_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.user_id AS bb_id
+FROM ".PhpBB_USERS_TABLE." AS bb
+INNER JOIN ".Register_PhpBB_ID_TABLE." AS link ON link.id_user_PhpBB = bb.user_id
+INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
+GROUP BY link.id_user_pwg, link.id_user_PhpBB
+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_PhpBB_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_PhpBB[3]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+      $msg_error_Link_Bad .= '><img src="'.REGPHPBB_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, PhpBB.user_password as bb_pwd, PhpBB.user_email as bb_eml
+FROM ".PhpBB_USERS_TABLE." AS PhpBB
+INNER JOIN ".Register_PhpBB_ID_TABLE." AS link ON link.id_user_PhpBB = PhpBB.user_id
+INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
+AND BINARY pwg.username = BINARY PhpBB.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_PhpBB_admin, array(
+          'action' => 'sync_user',
+          'username' => stripslashes($row['username']),
+        ));
+
+        $msg_error_Synchro .= '" title="'.l10n('Sync_User').stripslashes($row['username']).'"';
+
+        $msg_error_Synchro .= $conf_Register_PhpBB[3]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+        $msg_error_Synchro .= '><img src="'.REGPHPBB_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>-- PhpBB = '.$row['bb_eml'];
+    }
+    else if ($conf_Register_PhpBB[4] == '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_PhpBB_ID_TABLE."
+  )
+AND BINARY username not in (
+  SELECT username FROM ".PhpBB_USERS_TABLE."
+  )
+ORDER BY LOWER(username)
+;";
+
+  $result = pwg_query($query);
+
+  while($row = pwg_db_fetch_assoc($result))
+  {
+    $msg_error_PWG2PhpBB .= '<br>'.l10n('Error_PWG2PhpBB').stripslashes($row['username']).' ('.$row['mail_address'].')';
+
+    if ( !is_adviser() )
+    {
+      $msg_error_PWG2PhpBB .= ' <a href="';
+
+      $msg_error_PWG2PhpBB .= add_url_params($page_Register_PhpBB_admin, array(
+        'action' => 'add_user',
+        'username' => stripslashes($row['username']),
+      ));
+
+      $msg_error_PWG2PhpBB .= '" title="'.l10n('Add_User').stripslashes($row['username']).'" ';
+
+      $msg_error_PWG2PhpBB .= $conf_Register_PhpBB[3]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+      $msg_error_PWG2PhpBB .= '><img src="'.REGPHPBB_PATH.'/admin/template/icon/user_add.png" alt="'.l10n('Add_User').stripslashes($row['username']).'" /></a>';
+    }
+  }
+
+  if ($msg_error_PWG2PhpBB == '')
+    array_push($page['infos'], l10n('Audit_PWG2PhpBB').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_PWG2PhpBB = l10n('Audit_PWG2PhpBB').$msg_error_PWG2PhpBB;
+
+
+
+  $query = "
+SELECT user_id, username, user_email FROM ".PhpBB_USERS_TABLE."
+WHERE BINARY username <> BINARY '".$conf_Register_PhpBB[2]."'
+AND user_id not in (
+  SELECT id_user_PhpBB FROM ".Register_PhpBB_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_PhpBB2PWG .= '<br>'.l10n('Error_PhpBB2PWG').stripslashes($row['username']).' ('.$row['user_email'].')';
+
+    if ( !is_adviser() )
+    {
+      $msg_error_PhpBB2PWG .= ' <a href="';
+
+      $msg_error_PhpBB2PWG .= add_url_params($page_Register_PhpBB_admin, array(
+        'action' => 'del_user',
+        'user_id' => $row['user_id'],
+      ));
+
+      $msg_error_PhpBB2PWG .= '" title="'.l10n('Del_User').stripslashes($row['username']).'"';
+
+      $msg_error_PhpBB2PWG .= $conf_Register_PhpBB[3]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+      $msg_error_PhpBB2PWG .= '><img src="'.REGPHPBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($row['username']).'" /></a>';
+    }
+  }
+
+  if ($msg_error_PhpBB2PWG == '')
+    array_push($page['infos'], l10n('Audit_PhpBB2PWG').'<br>'.l10n('Audit_OK'));
+  else
+    $msg_error_PhpBB2PWG = l10n('Audit_PhpBB2PWG').$msg_error_PhpBB2PWG;
+
+
+
+  if ($msg_error_PWG_Dup <> '')
+    $errors[] = $msg_error_PWG_Dup . ( ($msg_error_PhpBB_Dup == '' and $msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>' );
+
+  if ($msg_error_PhpBB_Dup <> '')
+    $errors[] = $msg_error_PhpBB_Dup . ( ($msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>' );
+
+  if ($msg_error_Link_Break <> '')
+    $errors[] = $msg_error_Link_Break . ( ($msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>' );
+
+  if ($msg_error_Link_Bad <> '')
+    $errors[] = $msg_error_Link_Bad . ( ($msg_error_Synchro == '' and $msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>' );
+
+  if ($msg_error_Synchro <> '')
+    $errors[] = $msg_error_Synchro . ( ($msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>' );
+
+  if ($msg_error_PWG2PhpBB <> '')
+    $errors[] = $msg_error_PWG2PhpBB . ( ($msg_error_PhpBB2PWG == '') ? '' : '<br><br>' );
+
+  if ($msg_error_PhpBB2PWG <> '')
+    $errors[] = $msg_error_PhpBB2PWG;
+}
+
+
+
+
+// +-----------------------------------------------------------------------+
+// |                            Actions process
+// +-----------------------------------------------------------------------+
+
+if ( isset($_GET['action']) and ($_GET['action']=='link_dead') and !is_adviser() )
+{
+  $query = "
+DELETE FROM ".Register_PhpBB_ID_TABLE."
+WHERE id_user_PhpBB NOT IN (
+  SELECT user_id
+  FROM ".PhpBB_USERS_TABLE."
+  )
+OR id_user_pwg NOT IN (
+  SELECT id
+  FROM ".USERS_TABLE."
+  )
+;";
+
+  $result = pwg_query($query);
+
+  Audit_PWG_PhpBB();
+}
+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_PhpBB_ID_TABLE."
+WHERE id_user_pwg = ".$_GET['pwg_id']."
+AND id_user_PhpBB = ".$_GET['bb_id']."
+;";
+
+  $result = pwg_query($query);
+
+  Audit_PWG_PhpBB();
+}
+else if ( isset($_GET['action']) and ($_GET['action']=='new_link') and isset($_GET['pwg_id']) and isset($_GET['bb_id']) and !is_adviser() )
+{
+  PhpBB_Linkuser($_GET['pwg_id'], $_GET['bb_id']);
+
+  Audit_PWG_PhpBB();
+}
+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))
+  {
+    PhpBB_Updateuser($data['id_pwg'], stripslashes($data['username']), $data['password'], $data['mail_address']);
+  }
+
+  Audit_PWG_PhpBB();
+}
+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))
+    PhpBB_Adduser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']);
+
+    Audit_PWG_PhpBB();
+}
+else if ( isset($_GET['action']) and ($_GET['action']=='del_user') and isset($_GET['id']) and !is_adviser() )
+{
+  PhpBB_Deluser( $_GET['id'], true );
+
+  Audit_PWG_PhpBB();
+}
+
+
+// +-----------------------------------------------------------------------+
+// |                            Tabssheet select                           |
+// +-----------------------------------------------------------------------+
+
+switch ($page['tab'])
+{
+  case 'info':
+
+  $template->assign(
+    array(
+      'REGPHPBB_PATH'    => REGPHPBB_PATH,
+      'REGPHPBB_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['PhpBB_prefix']) and isset($_POST['PhpBB_admin']) and isset($_POST['PhpBB_guest']) and isset($_POST['PhpBB_confirm']) and isset($_POST['PhpBB_details']))
+  {
+
+/* Configuration controls */
+// Piwigo's admin username control
+    $query1 = "
+SELECT username, id
+FROM ".USERS_TABLE."
+WHERE id = ".$conf['webmaster_id']."
+;";
+
+    $pwgadmin = pwg_db_fetch_assoc(pwg_query($query1));
+
+// PhpBB's admin username control
+    $query2 = "
+SELECT username, user_id
+FROM ".PhpBB_USERS_TABLE."
+WHERE user_id = 2
+;";
+
+    $fbbadmin = pwg_db_fetch_assoc(pwg_query($query2));
+
+// PhpBB's Anonymous username control
+    $query3 = "
+SELECT username, user_id
+FROM ".PhpBB_USERS_TABLE."
+WHERE user_id = 1
+;";
+
+    $fbbguest = pwg_db_fetch_assoc(pwg_query($query3));
+
+// Compute configuration errors
+    if (stripslashes($pwgadmin['username']) != stripslashes($_POST['PhpBB_admin']))
+    {
+      array_push($page['errors'], l10n('error_config_admin1'));
+    }
+    if (stripslashes($pwgadmin['username']) != stripslashes($fbbadmin['username']))
+    {
+      array_push($page['errors'], l10n('error_config_admin2'));
+    }
+    if (stripslashes($fbbguest['username']) != stripslashes($_POST['PhpBB_guest']))
+    {
+      array_push($page['errors'], l10n('error_config_guest'));
+    }
+    elseif (count($page['errors']) == 0)
+    {
+      if (!function_exists('FindAvailableConfirmMailID'))
+      {
+      $conf['Register_PhpBB'] = $_POST['PhpBB_prefix'].';'.addslashes($_POST['PhpBB_admin']).';'.addslashes($_POST['PhpBB_guest']).';'.$_POST['PhpBB_confirm'].';'.$_POST['PhpBB_details'].';false;REGISTERED';
+      }
+      elseif (function_exists('FindAvailableConfirmMailID'))
+      {
+        $conf_UAM = unserialize($conf['UserAdvManager']);
+
+        if (isset($conf_UAM[1]) and ($conf_UAM[1] == 'true' or $conf_UAM[1] == 'local') and isset($conf_UAM[2]) and $conf_UAM[2] != '-1')
+        {
+          $conf['Register_PhpBB'] = $_POST['PhpBB_prefix'].';'.addslashes($_POST['PhpBB_admin']).';'.addslashes($_POST['PhpBB_guest']).';'.$_POST['PhpBB_confirm'].';'.$_POST['PhpBB_details'].';'.$_POST['PhpBB_UAM'].';'.$_POST['PhpBB_group'];
+        }
+        else
+        {
+          $conf['Register_PhpBB'] = $_POST['PhpBB_prefix'].';'.addslashes($_POST['PhpBB_admin']).';'.addslashes($_POST['PhpBB_guest']).';'.$_POST['PhpBB_confirm'].';'.$_POST['PhpBB_details'].';false;REGISTERED';
+        }
+      }
+
+      $query = '
+UPDATE '.CONFIG_TABLE.'
+SET value="'.$conf['Register_PhpBB'].'"
+WHERE param="Register_PhpBB"
+LIMIT 1
+;';
+
+      pwg_query($query);
+
+      array_push($page['infos'], l10n('save_config'));
+    }
+  }
+
+  $conf_Register_PhpBB = isset($conf['Register_PhpBB']) ? explode(";" , $conf['Register_PhpBB']) : array();
+
+  $template->assign(
+    array
+    (
+      'REGPHPBB_PATH'       => REGPHPBB_PATH,
+      'REGPHPBB_VERSION'    => $version,
+      'PhpBB_PREFIX'        => $conf_Register_PhpBB[0],
+      'PhpBB_ADMIN'         => stripslashes($conf_Register_PhpBB[1]),
+      'PhpBB_GUEST'         => stripslashes($conf_Register_PhpBB[2]),
+      'PhpBB_CONFIRM_TRUE'  => (isset($conf_Register_PhpBB[3]) and $conf_Register_PhpBB[3] == 'true') ? 'checked="checked"' : '',
+      'PhpBB_CONFIRM_FALSE' => (isset($conf_Register_PhpBB[3]) and $conf_Register_PhpBB[3] == 'false') ? 'checked="checked"' : '',
+      'PhpBB_DETAILS_TRUE'  => (isset($conf_Register_PhpBB[4]) and $conf_Register_PhpBB[4] == 'true') ? 'checked="checked"' : '',
+      'PhpBB_DETAILS_FALSE' => (isset($conf_Register_PhpBB[4]) and $conf_Register_PhpBB[4] == '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,
+        'PhpBB_UAM_LINK_TRUE'  => (isset($conf_Register_PhpBB[5]) and $conf_Register_PhpBB[5] == 'true') ? 'checked="checked"' : '',
+        'PhpBB_UAM_LINK_FALSE' => (isset($conf_Register_PhpBB[5]) and $conf_Register_PhpBB[5] == 'false') ? 'checked="checked"' : '',
+        'PhpBB_GROUP'          => $conf_Register_PhpBB[6],
+      )
+    );
+  }
+
+  $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/manage.tpl');
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
+	break;
+
+	case 'Migration':
+
+  $conf_Register_PhpBB = isset($conf['Register_PhpBB']) ? explode(";" , $conf['Register_PhpBB']) : array();
+
+  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_PhpBB_ID_TABLE.";";
+    $result = pwg_query($query);
+
+
+    $msg_Mig_Del_AllUsers = '';
+
+    $query = "
+SELECT username, user_id, group_id
+FROM ".PhpBB_USERS_TABLE."
+WHERE group_id != '6'
+;";
+
+    $result = pwg_query($query);
+
+    while ($row = pwg_db_fetch_assoc($result))
+    {
+      if((stripslashes($row['username']) != stripslashes($conf_Register_PhpBB[2])) and (stripslashes($row['username']) != stripslashes($conf_Register_PhpBB[1])))
+      {
+        $msg_Mig_Del_AllUsers .= '<br> - '.l10n('Mig_Del_User').stripslashes($row['username']);
+
+        PhpBB_Deluser($row['user_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_PhpBB[1])))
+      {
+        $msg_Mig_Add_AllUsers .= '<br> - '.l10n('Mig_Add_User').stripslashes($row['username']);
+
+        PhpBB_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_PhpBB[1]."'
+;";
+
+    $row = pwg_db_fetch_assoc(pwg_query($query));
+
+    if (!empty($row))
+    {
+      array_push($page['infos'], l10n('Sync_User').stripslashes($row['username']).'<br><br>');
+
+      PhpBB_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_PhpBB();
+  }
+
+  $template->assign(
+    array
+    (
+      'REGPHPBB_PATH'    => REGPHPBB_PATH,
+      'REGPHPBB_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_PhpBB = isset($conf['Register_PhpBB']) ? explode(";" , $conf['Register_PhpBB']) : array();
+
+    $page_Register_PhpBB_admin = get_admin_plugin_menu_link(__FILE__);
+
+
+    $msg_error_PWG_Dup = '';
+    $msg_error_PhpBB_Dup = '';
+    $msg_error_Link_Break = '';
+    $msg_error_Link_Bad = '';
+    $msg_error_Synchro = '';
+    $msg_ok_Synchro = '';
+    $msg_error_PhpBB2PWG = '';
+    $msg_error_PWG2PhpBB = '';
+
+
+    $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 ".PhpBB_USERS_TABLE."
+GROUP BY BINARY username
+HAVING COUNT(*) > 1
+;";
+
+    $result = pwg_query($query);
+
+    while($row = pwg_db_fetch_assoc($result))
+    {
+      $msg_error_PhpBB_Dup .= '<br>'.l10n('Error_PhpBB_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']);
+
+      $subquery = "
+SELECT user_id, username, user_email
+FROM ".PhpBB_USERS_TABLE."
+WHERE BINARY username = BINARY '".$row['username']."'
+;";
+
+      $subresult = pwg_query($subquery);
+
+      while($subrow = pwg_db_fetch_assoc($subresult))
+      {
+        $msg_error_PhpBB_Dup .= '<br>id:'.$subrow['user_id'].'='.stripslashes($subrow['username']).' ('.$subrow['user_email'].')';
+
+        if ( !is_adviser() )
+        {
+          $msg_error_PhpBB_Dup .= ' <a href="';
+
+          $msg_error_PhpBB_Dup .= add_url_params($page_Register_PhpBB_admin, array(
+            'action' => 'del_user',
+            'user_id' => $subrow['user_id'],
+          ));
+
+          $msg_error_PhpBB_Dup .= '" title="'.l10n('Del_User').stripslashes($subrow['username']).'"';
+
+          $msg_error_PhpBB_Dup .= $conf_Register_PhpBB[3]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+          $msg_error_PhpBB_Dup .= '><img src="'.REGPHPBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($subrow['username']).'" /></a>';
+        }
+      }
+    }
+
+    if ($msg_error_PhpBB_Dup <> '')
+      $msg_error_PhpBB_Dup = l10n('Sync_Check_Dup').$msg_error_PhpBB_Dup.'<br>'.l10n('Advise_PhpBB_Dup');
+
+
+    if ($msg_error_PhpBB_Dup == '' and $msg_error_PWG_Dup == '')
+    {
+      $query = "
+SELECT pwg.id as pwg_id, bb.user_id as bb_id, pwg.username as pwg_user, pwg.mail_address as pwg_mail
+FROM ".PhpBB_USERS_TABLE." AS bb, ".USERS_TABLE." as pwg
+WHERE bb.user_id NOT in (
+  SELECT id_user_PhpBB
+  FROM ".Register_PhpBB_ID_TABLE."
+  )
+AND pwg.id NOT in (
+  SELECT id_user_pwg
+  FROM ".Register_PhpBB_ID_TABLE."
+  )
+AND pwg.username = bb.username
+AND pwg.mail_address = bb.user_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'].')';
+
+        PhpBB_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.user_id as bb_id, bb.username as bb_user, bb.user_email as bb_mail
+FROM ".PhpBB_USERS_TABLE." AS bb
+INNER JOIN ".Register_PhpBB_ID_TABLE." AS link ON link.id_user_PhpBB = bb.user_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_PhpBB_ID_TABLE."
+WHERE id_user_pwg = ".$row['pwg_id']."
+AND id_user_PhpBB = ".$row['bb_id']."
+;";
+
+        $subresult = pwg_query($subquery);
+      }
+
+
+      $query = "
+SELECT COUNT(*) as nbr_dead
+FROM ".Register_PhpBB_ID_TABLE." AS Link
+WHERE id_user_PhpBB NOT IN (
+  SELECT user_id
+  FROM ".PhpBB_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_PhpBB_ID_TABLE."
+WHERE id_user_PhpBB NOT IN (
+  SELECT user_id
+  FROM ".PhpBB_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.user_id AS bb_id
+FROM ".PhpBB_USERS_TABLE." AS bb
+INNER JOIN ".Register_PhpBB_ID_TABLE." AS link ON link.id_user_PhpBB = bb.user_id
+INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
+GROUP BY link.id_user_pwg, link.id_user_PhpBB
+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']).')';
+
+        PhpBB_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, PhpBB.user_id as bb_id, PhpBB.user_password as bb_pwd, PhpBB.user_email as bb_eml
+FROM ".PhpBB_USERS_TABLE." AS PhpBB
+INNER JOIN ".Register_PhpBB_ID_TABLE." AS link ON link.id_user_PhpBB = PhpBB.user_id
+INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id
+AND BINARY pwg.username = BINARY PhpBB.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))
+            PhpBB_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_PhpBB_ID_TABLE."
+  )
+AND BINARY username not in (
+  SELECT username FROM ".PhpBB_USERS_TABLE."
+  )
+ORDER BY LOWER(username)
+;";
+
+      $result = pwg_query($query);
+
+      while($row = pwg_db_fetch_assoc($result))
+      {
+        $msg_error_PWG2PhpBB .= '<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))
+          PhpBB_Adduser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']);
+      }
+
+      if ($msg_error_PWG2PhpBB == '')
+        array_push($page['infos'], l10n('Sync_PWG2PhpBB').'<br>'.l10n('Sync_OK'));
+      else
+        $msg_error_PWG2PhpBB = l10n('Sync_PWG2PhpBB').$msg_error_PWG2PhpBB;
+
+
+      $query = "
+SELECT user_id, username, group_id, user_email FROM ".PhpBB_USERS_TABLE."
+WHERE BINARY username <> BINARY '".$conf_Register_PhpBB[2]."'
+AND user_id not in (
+  SELECT id_user_PhpBB FROM ".Register_PhpBB_ID_TABLE."
+  )
+AND BINARY username not in (
+  SELECT username FROM ".USERS_TABLE."
+  )
+AND group_id <> '6'
+ORDER BY LOWER(username)
+;";
+
+      $result = pwg_query($query);
+
+      while($row = pwg_db_fetch_assoc($result))
+      {
+        $msg_error_PhpBB2PWG .= '<br>'.l10n('Error_PhpBB2PWG').stripslashes($row['username']).' ('.$row['user_email'].')';
+
+        if ( !is_adviser() )
+        {
+          $msg_error_PhpBB2PWG .= ' <a href="';
+
+          $msg_error_PhpBB2PWG .= add_url_params($page_Register_PhpBB_admin, array(
+            'action' => 'del_user',
+            'user_id' => $row['user_id'],
+          ));
+
+          $msg_error_PhpBB2PWG .= '" title="'.l10n('Del_User').stripslashes($row['username']).'"';
+
+          $msg_error_PhpBB2PWG .= $conf_Register_PhpBB[3]=='false' ?  ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' ';
+
+          $msg_error_PhpBB2PWG .= '><img src="'.REGPHPBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($row['username']).'" /></a>';
+        }
+      }
+
+      if ($msg_error_PhpBB2PWG == '')
+        array_push($page['infos'], l10n('Sync_PhpBB2PWG').'<br>'.l10n('Sync_OK'));
+      else
+        $msg_error_PhpBB2PWG = l10n('Sync_PhpBB2PWG').$msg_error_PhpBB2PWG;
+    }
+    else
+      $errors[] = l10n('Advise_Check_Dup');
+
+
+    if ($msg_error_PWG_Dup <> '')
+      $errors[] = $msg_error_PWG_Dup . ( ($msg_error_PhpBB_Dup == '' and $msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>' );
+
+    if ($msg_error_PhpBB_Dup <> '')
+      $errors[] = $msg_error_PhpBB_Dup . ( ($msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>' );
+
+    if ($msg_error_Link_Break <> '')
+      $errors[] = $msg_error_Link_Break . ( ($msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>' );
+
+    if ($msg_error_Link_Bad <> '')
+      $errors[] = $msg_error_Link_Bad . ( ($msg_error_Synchro == '' and $msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>' );
+
+    if ($msg_error_Synchro <> '')
+      $errors[] = $msg_error_Synchro . ( ($msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>' );
+
+    if ($msg_error_PWG2PhpBB <> '')
+      $errors[] = $msg_error_PWG2PhpBB . ( ($msg_error_PhpBB2PWG == '') ? '' : '<br><br>' );
+
+    if ($msg_error_PhpBB2PWG <> '')
+      $errors[] = $msg_error_PhpBB2PWG;
+  }
+  else if ( isset($_POST['Audit']))
+  {
+    Audit_PWG_PhpBB();
+  }
+
+  $template->assign(
+    array
+    (
+      'REGPHPBB_PATH'    => REGPHPBB_PATH,
+      'REGPHPBB_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_PhpBB/admin/index.php
===================================================================
--- /extensions/Register_PhpBB/admin/index.php	(revision 7795)
+++ /extensions/Register_PhpBB/admin/index.php	(revision 7795)
@@ -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_PhpBB/admin/template/icon/index.php
===================================================================
--- /extensions/Register_PhpBB/admin/template/icon/index.php	(revision 7795)
+++ /extensions/Register_PhpBB/admin/template/icon/index.php	(revision 7795)
@@ -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_PhpBB/admin/template/index.php
===================================================================
--- /extensions/Register_PhpBB/admin/template/index.php	(revision 7795)
+++ /extensions/Register_PhpBB/admin/template/index.php	(revision 7795)
@@ -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_PhpBB/admin/template/info.tpl
===================================================================
--- /extensions/Register_PhpBB/admin/template/info.tpl	(revision 7795)
+++ /extensions/Register_PhpBB/admin/template/info.tpl	(revision 7795)
@@ -0,0 +1,7 @@
+{html_head}<link rel="stylesheet" type="text/css" href="{$REGPHPBB_PATH}admin/template/register_phpbb.css">{/html_head}
+
+<div class="titrePage">
+  <h2>{'Title_Tab'|@translate} {$REGPHPBB_VERSION}<br>{'Tab_Info'|@translate}</h2>
+</div>
+
+<div align="left" style="margin-left: 1em; margin-right: 1em;">{'Disclaimer'|@translate}</div>
Index: /extensions/Register_PhpBB/admin/template/manage.tpl
===================================================================
--- /extensions/Register_PhpBB/admin/template/manage.tpl	(revision 7795)
+++ /extensions/Register_PhpBB/admin/template/manage.tpl	(revision 7795)
@@ -0,0 +1,100 @@
+{html_head}<link rel="stylesheet" type="text/css" href="{$REGPHPBB_PATH}admin/template/register_phpbb.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} {$REGPHPBB_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="PhpBB_prefix" value={$PhpBB_PREFIX} size="20" style="text-align: center;"><br>
+      <br>
+    	</li>
+    	<li><label>{'Admin'|@translate}</label><br>
+    		<input type="text" name="PhpBB_admin" value={$PhpBB_ADMIN} size="20" style="text-align: center;"><br>
+      <br>
+    	</li>
+    	<li><label>{'Guest'|@translate}</label><br>
+    		<input type="text" name="PhpBB_guest" value={$PhpBB_GUEST} size="20" style="text-align: center;"><br>
+      <br>
+    	</li>
+    	<li><label>{'Confirm'|@translate}</label><br>
+        <input type="radio" value="true" {$PhpBB_CONFIRM_TRUE} name="PhpBB_confirm">{'Confirm_true'|@translate}<br>
+        <input type="radio" value="false" {$PhpBB_CONFIRM_FALSE} name="PhpBB_confirm">{'Confirm_false'|@translate}<br>
+      <br>
+    	</li>
+    	<li><label>{'Details'|@translate}</label><br>
+        <input type="radio" value="true" {$PhpBB_DETAILS_TRUE} name="PhpBB_details">{'Details_true'|@translate}<br>
+        <input type="radio" value="false" {$PhpBB_DETAILS_FALSE} name="PhpBB_details">{'Details_false'|@translate}<br>
+      <br>
+    	</li>
+      {if $UAM_BRIDGE}
+    	<li><label>{'Bridge_UAM'|@translate}</label><br>
+        <input type="radio" value="true" {$PhpBB_UAM_LINK_TRUE} name="PhpBB_UAM">{'Bridge_UAM_true'|@translate}<br>
+        <input type="radio" value="false" {$PhpBB_UAM_LINK_FALSE} name="PhpBB_UAM">{'Bridge_UAM_false'|@translate}<br>
+      <br>
+      </li>
+    	<li><label>{'PhpBB_Group'|@translate}</label><br>
+    		<input type="text" name="PhpBB_group" value={$PhpBB_GROUP} size="20" 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_PhpBB/admin/template/migration.tpl
===================================================================
--- /extensions/Register_PhpBB/admin/template/migration.tpl	(revision 7795)
+++ /extensions/Register_PhpBB/admin/template/migration.tpl	(revision 7795)
@@ -0,0 +1,16 @@
+{html_head}<link rel="stylesheet" type="text/css" href="{$REGPHPBB_PATH}admin/template/register_phpbb.css">{/html_head}
+
+<div class="titrePage">
+  <h2>{'Title_Tab'|@translate} {$REGPHPBB_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_PhpBB/admin/template/register_phpbb.css
===================================================================
--- /extensions/Register_PhpBB/admin/template/register_phpbb.css	(revision 7795)
+++ /extensions/Register_PhpBB/admin/template/register_phpbb.css	(revision 7795)
@@ -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_PhpBB/admin/template/synchro.tpl
===================================================================
--- /extensions/Register_PhpBB/admin/template/synchro.tpl	(revision 7795)
+++ /extensions/Register_PhpBB/admin/template/synchro.tpl	(revision 7795)
@@ -0,0 +1,14 @@
+{html_head}<link rel="stylesheet" type="text/css" href="{$REGPHPBB_PATH}admin/template/register_phpbb.css">{/html_head}
+
+<div class="titrePage">
+  <h2>{'Title_Tab'|@translate} {$REGPHPBB_VERSION}<br>{'Tab_Synchro'|@translate}</h2>
+</div>
+
+<form method="post" action="">
+  <fieldset>
+  	<legend>{'Sync_Title'|@translate}</legend>
+  	{'Sync_Text'|@translate}
+    <br>
+  	<p><input {$PhpBB_CONFIRM_ENABLE} class="submit" type="submit" value="{'Audit_Btn'|@translate}" name="Audit"> <input onclick="return confirm('{'Are you sure?'|@translate}');" {$PhpBB_CONFIRM_ENABLE} class="submit" type="submit" value="{'Sync_Btn'|@translate}" name="Synchro" {$TAG_INPUT_ENABLED}></p>
+  </fieldset>
+</form>
Index: /extensions/Register_PhpBB/include/constants.php
===================================================================
--- /extensions/Register_PhpBB/include/constants.php	(revision 7795)
+++ /extensions/Register_PhpBB/include/constants.php	(revision 7795)
@@ -0,0 +1,23 @@
+<?php
+
+global $prefixeTable, $conf;
+
+$conf_Register_PhpBB = isset($conf['Register_PhpBB']) ? explode(";" , $conf['Register_PhpBB']) : array();
+
+define('Register_PhpBB_ID_TABLE', $prefixeTable.'Register_PhpBB_id');
+
+if (isset($conf_Register_PhpBB[0]))
+{
+  define('PhpBB_CONFIG_TABLE', $conf_Register_PhpBB[0].'config');
+  define('PhpBB_USERS_TABLE', $conf_Register_PhpBB[0].'users');
+  define('PhpBB_POSTS_TABLE', $conf_Register_PhpBB[0].'posts');
+  define('PhpBB_TOPICS_TABLE', $conf_Register_PhpBB[0].'topics');
+  define('PhpBB_SUBSCRIPTIONS_TABLE', $conf_Register_PhpBB[0].'topics_watch');
+  define('PhpBB_GROUPS_TABLE', $conf_Register_PhpBB[0].'groups');
+  define('PhpBB_SUBFORUMS_TABLE', $conf_Register_PhpBB[0].'forums_watch');
+  define('PhpBB_USERGROUP_TABLE', $conf_Register_PhpBB[0].'user_group');
+  define('PhpBB_FORUMS_TABLE', $conf_Register_PhpBB[0].'forums');
+  define('PhpBB_TOPICSPOSTED_TABLE', $conf_Register_PhpBB[0].'topics_posted');
+  define('PhpBB_FORUMSTRACK_TABLE', $conf_Register_PhpBB[0].'forums_track');
+}
+?>
Index: /extensions/Register_PhpBB/include/functions.inc.php
===================================================================
--- /extensions/Register_PhpBB/include/functions.inc.php	(revision 7795)
+++ /extensions/Register_PhpBB/include/functions.inc.php	(revision 7795)
@@ -0,0 +1,465 @@
+<?php
+
+include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+include_once (REGPHPBB_PATH.'include/constants.php');
+
+function PhpBB_Linkuser($pwg_id, $bb_id)
+{
+	$query = "
+SELECT pwg.id as pwg_id, bb.user_id as bb_id
+FROM ".USERS_TABLE." pwg, ".PhpBB_USERS_TABLE." bb
+WHERE pwg.id = ".$pwg_id."
+AND bb.user_id = ".$bb_id."
+AND pwg.username = bb.username
+;";
+
+	$data = pwg_db_fetch_row(pwg_query($query));
+
+	if (!empty($data))
+	{
+		$subquery = "
+DELETE FROM ".Register_PhpBB_ID_TABLE."
+WHERE id_user_pwg = '".$pwg_id."'
+OR id_user_PhpBB = '".$bb_id."'
+;";
+
+		$subresult = pwg_query($subquery);
+
+		$subquery = "
+INSERT INTO ".Register_PhpBB_ID_TABLE."
+  (id_user_pwg, id_user_PhpBB)
+VALUES (".$pwg_id.", ".$bb_id.")
+;";
+
+		$subresult = pwg_query($subquery);
+	}
+}
+
+
+
+function PhpBB_Unlinkuser($bb_id)
+{
+	$query = "
+DELETE FROM ".Register_PhpBB_ID_TABLE."
+WHERE id_user_PhpBB = ".$bb_id."
+;";
+
+	$result = pwg_query($query);
+}
+
+
+
+function PhpBB_Adduser($pwg_id, $login, $password, $adresse_mail)
+{
+	global $conf;
+
+	$conf_Register_PhpBB = isset($conf['Register_PhpBB']) ? explode(";" , $conf['Register_PhpBB']) : 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_PhpBB[5]) and $conf_Register_PhpBB[5] == 'true')
+	{
+		$default_user_group = '7';
+	}
+	else
+	{
+		$query = "
+SELECT group_id
+FROM ".PhpBB_GROUPS_TABLE."
+WHERE group_name = 'REGISTERED'
+;";
+
+		$default_user_group = pwg_db_fetch_assoc(pwg_query($query));
+	}
+
+	$query = "
+UPDATE ".PhpBB_CONFIG_TABLE."
+SET config_value = config_value+1
+WHERE config_name = 'num_users'
+;";
+
+	$result = pwg_query($query);
+
+	$query = "
+UPDATE ".PhpBB_CONFIG_TABLE."
+SET config_value = '".pwg_db_real_escape_string($login)."'
+WHERE config_name = 'newest_username'
+;";
+	$result = pwg_query($query);
+
+	$query = "
+SELECT config_value
+FROM ".PhpBB_CONFIG_TABLE."
+WHERE config_name = 'board_timezone'
+;";
+
+	$board_timezone = pwg_db_fetch_assoc(pwg_query($query));
+
+	$query = "
+SELECT config_value
+FROM ".PhpBB_CONFIG_TABLE."
+WHERE config_name = 'default_dateformat'
+;";
+
+	$default_dateformat = pwg_db_fetch_assoc(pwg_query($query));
+
+	$query = "
+SELECT config_value
+FROM ".PhpBB_CONFIG_TABLE."
+WHERE config_name = 'default_lang'
+;";
+
+	$default_lang = pwg_db_fetch_assoc(pwg_query($query));
+
+	$query = "
+SELECT config_value
+FROM ".PhpBB_CONFIG_TABLE."
+WHERE config_name = 'default_style'
+;";
+
+	$default_style = pwg_db_fetch_assoc(pwg_query($query));
+
+	$query = "
+SELECT group_colour
+FROM ".PhpBB_GROUPS_TABLE."
+WHERE group_id = '".$default_user_group."'
+;";
+	$default_colour = pwg_db_fetch_assoc(pwg_query($query));
+
+	$query = '
+INSERT INTO '.PhpBB_USERS_TABLE." (
+    username,
+    username_clean,
+    ". ( isset($default_user_group['group_id']) ? 'group_id' : '' ) .",
+	user_password,
+	user_email,
+	". ( isset($board_timezone['config_value']) ? 'user_timezone' : '' ) .",
+	". ( isset($default_lang['config_value']) ? 'user_lang' : '' ) .",
+	". ( isset($default_dateformat['config_value']) ? 'user_dateformat' : '' ) .",
+	". ( isset($default_style['config_value']) ? 'user_style' : '' ) .",
+	user_colour,
+	user_regdate,
+	user_ip,
+	user_lastvisit,
+	user_new
+	)
+VALUES(
+	'".pwg_db_real_escape_string($login)."',
+	'".strtolower(pwg_db_real_escape_string($login))."',
+	". ( isset($default_user_group['group_id']) ? "'".$default_user_group['group_id']."'" : '' ) .",
+	'".$password."',
+	'".$adresse_mail."',
+	". ( isset($board_timezone['config_value']) ? "'".$board_timezone['config_value']."'" : '' ) .",
+	". ( isset($default_lang['config_value']) ? "'".$default_lang['config_value']."'" : '' ) .",
+	". ( isset($default_dateformat['config_value']) ? "'".$default_dateformat['config_value']."'" : '' ) .",
+	". ( isset($default_style['config_value']) ? "'".$default_style['config_value']."'" : '' ) .",
+	'".$default_colour['group_colour']."',
+	'".$registred."',
+	'".$registred_ip."',
+	'".$registred."',
+	'0'
+	)
+;";
+
+	$result = pwg_query($query);
+
+	$bb_id = pwg_db_insert_id();
+
+	PhpBB_Linkuser($pwg_id, $bb_id);
+
+	$query = "
+SELECT user_id
+FROM ".PhpBB_USERS_TABLE."
+WHERE username = '".pwg_db_real_escape_string($login)."'
+;";
+
+	$userid = pwg_db_fetch_assoc(pwg_query($query));
+
+	$query = "
+UPDATE ".PhpBB_CONFIG_TABLE."
+SET config_value = '".$userid."'
+WHERE config_name = 'newest_user_id'
+;";
+	$result = pwg_query($query);
+
+	$query = '
+INSERT INTO '.PhpBB_USERGROUP_TABLE." (
+    ". ( isset($default_user_group['group_id']) ? 'group_id' : '' ) .",
+	user_id,
+	group_leader,
+	user_pending
+	)
+VALUES(
+	". ( isset($default_user_group['group_id']) ? "'".$default_user_group['group_id']."'" : '' ) .",
+	". ( isset($userid['user_id']) ? "'".$userid['user_id']."'" : '' ) .",
+	'0',
+	'0'
+	)
+;";
+
+	$result = pwg_query($query);
+
+	$query = "
+UPDATE ".PhpBB_CONFIG_TABLE."
+SET config_value = '".$default_colour."'
+WHERE config_name = 'newest_user_colour'
+;";
+	$result = pwg_query($query);
+}
+
+
+
+function PhpBB_Searchuser($id_user_pwg)
+{
+	$query = "
+SELECT id_user_PhpBB, id_user_pwg FROM ".Register_PhpBB_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_PhpBB'];
+	else
+		return '0';
+}
+
+
+
+function PhpBB_Deluser($id_user_PhpBB, $SuppTopicsPosts)
+{
+	global $conf;
+
+	$conf_Register_PhpBB = isset($conf['Register_PhpBB']) ? explode(";" , $conf['Register_PhpBB']) : array();
+
+	$query0 = "
+SELECT username, user_id FROM ".PhpBB_USERS_TABLE."
+WHERE user_id = ".$id_user_PhpBB."
+LIMIT 1
+;";
+
+	$data0 = pwg_db_fetch_assoc(pwg_query($query0));
+
+
+	$subquery = "
+UPDATE ".PhpBB_POSTS_TABLE."
+SET post_username = '".pwg_db_real_escape_string($data0['username'])."', poster_id = '1'
+WHERE poster_id = ".$id_user_PhpBB."
+;";
+
+		$subresult = pwg_query($subquery);
+
+		$subquery = "
+UPDATE ".PhpBB_TOPICS_TABLE."
+SET topic_poster = '1'
+WHERE BINARY topic_poster = ".$id_user_PhpBB."
+;";
+
+		$subresult = pwg_query($subquery);
+
+		$subquery = "
+UPDATE ".PhpBB_TOPICS_TABLE."
+SET topic_last_poster_id = '1'
+WHERE topic_last_poster_id = ".$id_user_PhpBB."
+;";
+		$subresult = pwg_query($subquery);
+
+		$subquery = "
+UPDATE ".PhpBB_FORUMS_TABLE."
+SET forum_last_poster_id = '1'
+WHERE forum_last_poster_id = ".$id_user_PhpBB."
+;";
+		$subresult = pwg_query($subquery);
+
+
+	$subquery = "
+DELETE FROM ".PhpBB_TOPICSPOSTED_TABLE."
+WHERE user_id = ".$id_user_PhpBB."
+;";
+
+	$subresult = pwg_query($subquery);
+
+	$subquery = "
+DELETE FROM ".PhpBB_FORUMSTRACK_TABLE."
+WHERE user_id = ".$id_user_PhpBB."
+;";
+
+	$subresult = pwg_query($subquery);
+
+	// Suppression des abonnements aux topics de l'utilisateur
+	$subquery = "
+DELETE FROM ".PhpBB_SUBSCRIPTIONS_TABLE."
+WHERE user_id = ".$id_user_PhpBB."
+;";
+
+	$subresult = pwg_query($subquery);
+
+	//Suppression des abonnements aux forums de l'utilisateur
+	$subquery = "
+DELETE FROM ".PhpBB_SUBFORUMS_TABLE."
+WHERE user_id = ".$id_user_PhpBB."
+;";
+
+	$subresult = pwg_query($subquery);
+
+	$subquery = "
+UPDATE ".PhpBB_CONFIG_TABLE."
+SET config_value = config_value-1
+WHERE config_name = 'num_users'
+;";
+
+	$subresult = pwg_query($subquery);
+
+	// Suppression du compte utilisateur
+	$subquery = "
+DELETE FROM ".PhpBB_USERS_TABLE."
+WHERE user_id = ".$id_user_PhpBB."
+;";
+
+	$subresult = pwg_query($subquery);
+
+	$subquery = "
+DELETE FROM ".PhpBB_USERGROUP_TABLE."
+WHERE user_id = ".$id_user_PhpBB."
+;";
+
+	$subresult = pwg_query($subquery);
+
+	$subquery = "
+UPDATE ".PhpBB_CONFIG_TABLE."
+SET config_value = (SELECT username FROM ".PhpBB_USERS_TABLE." WHERE user_regdate = (SELECT MAX(user_regdate) FROM ".PhpBB_USERS_TABLE." WHERE ((group_id <> 6) AND (username <> 'Anonymous'))
+LIMIT 1) LIMIT 1)
+WHERE config_name = 'newest_username'
+;";
+
+	$subresult = pwg_query($subquery);
+
+	$subquery = "
+UPDATE ".PhpBB_CONFIG_TABLE."
+SET config_value = (SELECT user_id FROM ".PhpBB_USERS_TABLE." WHERE user_regdate = (SELECT MAX(user_regdate) FROM ".PhpBB_USERS_TABLE." WHERE ((group_id <> 6) AND (username <> 'Anonymous'))
+LIMIT 1) LIMIT 1)
+WHERE config_name = 'newest_user_id'
+;";
+
+	$subresult = pwg_query($subquery);
+
+	PhpBB_Unlinkuser($id_user_PhpBB);
+}
+
+
+
+function PhpBB_Updateuser($pwg_id, $username, $password, $adresse_mail)
+{
+	include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
+
+	$query = "
+SELECT id_user_PhpBB as PhpBB_id
+FROM ".Register_PhpBB_ID_TABLE."
+WHERE id_user_pwg = ".$pwg_id."
+;";
+
+	$row = pwg_db_fetch_assoc(pwg_query($query));
+
+	if (!empty($row))
+	{
+		$query = "
+UPDATE ".PhpBB_USERS_TABLE."
+SET username = '".pwg_db_real_escape_string($username)."', username_clean = '".strtolower(pwg_db_real_escape_string($username))."', user_email = '".$adresse_mail."', user_password = '".$password."'
+WHERE user_id = ".$row['PhpBB_id']."
+;";
+
+		$result = pwg_query($query);
+
+		PhpBB_Linkuser($pwg_id, $row['PhpBB_id']);
+	}
+	else
+	{
+		$query = "
+SELECT user_id as PhpBB_id
+FROM ".PhpBB_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 ".PhpBB_USERS_TABLE."
+SET username = '".pwg_db_real_escape_string($username)."', username_clean = '".strtolower(pwg_db_real_escape_string($username))."', user_email = '".$adresse_mail."', user_password = '".$password."'
+WHERE user_id = ".$row['PhpBB_id']."
+;";
+
+			$result = pwg_query($query);
+
+			PhpBB_Linkuser($pwg_id, $row['PhpBB_id']);
+		}
+	}
+}
+
+
+function RegPhpBB_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 regphpbb_obsolete_files()
+{
+	if (file_exists(REGPHPBB_PATH.'obsolete.list')
+		and $old_files = file(REGPHPBB_PATH.'obsolete.list', FILE_IGNORE_NEW_LINES)
+		and !empty($old_files))
+	{
+		array_push($old_files, 'obsolete.list');
+		foreach($old_files as $old_file)
+		{
+			$path = REGPHPBB_PATH.$old_file;
+			if (is_file($path))
+			{
+				@unlink($path);
+			}
+		}
+	}
+}
+?>
Index: /extensions/Register_PhpBB/include/index.php
===================================================================
--- /extensions/Register_PhpBB/include/index.php	(revision 7795)
+++ /extensions/Register_PhpBB/include/index.php	(revision 7795)
@@ -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_PhpBB/index.php
===================================================================
--- /extensions/Register_PhpBB/index.php	(revision 7795)
+++ /extensions/Register_PhpBB/index.php	(revision 7795)
@@ -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_PhpBB/language/de_DE/index.php
===================================================================
--- /extensions/Register_PhpBB/language/de_DE/index.php	(revision 7795)
+++ /extensions/Register_PhpBB/language/de_DE/index.php	(revision 7795)
@@ -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_PhpBB/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/Register_PhpBB/language/de_DE/plugin.lang.php	(revision 7795)
+++ /extensions/Register_PhpBB/language/de_DE/plugin.lang.php	(revision 7795)
@@ -0,0 +1,154 @@
+<?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 PhpBB';
+$lang['Disclaimer'] = '
+  *** Befolgen Sie bitte die folgenden zwei Schritte, um zu beginnen ***<br>
+  Step 1 : Konfigurieren Sie den Plugin für den Zugriff auf PhpBB.<br>
+  Step 2 : Migrieren Sie die Benutzerkonten von Piwigo nach PhpBB.<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 PhpBB Installation und korrigieren Sie sie gegebenenfalls. <br>
+  Passen Sie das Verhalten des Plugins nach Ihren Wünschen an.';
+$lang['Prefix'] = 'PhpBB Tabellenpräfix :';
+$lang['Guest'] = 'Benutzername des PhpBB Gast-benutzers (Wenn Sie nicht wissen, änderte sich nichts).';
+$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 PhpBB';
+$lang['Sync_Text'] = '
+  <div class="warning">Sie haben diesen Plugin bereits benutzt, um Piwigo mit PhpBB zu verbinden und/oder Ihr PhpBB 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 [PrefixPhpBB]_user.<br>
+  - Anschliessend müssen Sie diese Daten fuer jedes Benutzerkonto von Piwigo nach PhpBB in die entsprechende Tabelle übertragen (außer für die Benutzer Piwigo Gast und PhpBB 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 PhpBB. Sollten Sie einen ausfindig machen, dann löschen Sie den Ältesten, indemSie die PhpBB Benutzerkonten nach dem Datum der Registrierung sortieren.<br>';
+$lang['Sync_Check_Dup'] = '<b>Analyse der Tabellen für Benutzerkonten von Piwigo und PhpBB, 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 PhpBB haben.</b><br><br>';
+$lang['Sync_Link_Break'] = '<b>Analyse von reparierbaren Links von Benutzerkonten in Piwigo und PhpBB</b>';
+$lang['Sync_Link_Bad'] = '<b>Analyse von falschen Beziehungen von Benutzerkonten in Piwigo und PhpBB</b>';
+$lang['Sync_DataUser'] = '<b>Analyse von Passwörtern und e-mail Adressen von Benutzerkonten in Piwigo und PhpBB</b>';
+$lang['Sync_PWG2PhpBB'] = '<b>Analyse von bestehenden Benutzerkonten in Piwigo und fehlenden Benutzerkonten in PhpBB</b>';
+$lang['Sync_PhpBB2PWG'] = '<b>Analyse von bestehenden Benutzerkonten in PhpBB 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_PhpBB_Dup'] = '<b>Audit der Kontentabelle von PhpBB</b>';
+$lang['Error_PhpBB_Dup'] = '<b>Fehler in PhpBBs Kontentabelle - Duplikate gefunden:</b> ';
+$lang['Advise_PhpBB_Dup'] = '<b>WARNUNG! Sie müssen diese Änderungen in PhpBB vornehmen bevor sie fortfahren<br>Benutzen Sie die Icons, um die Benutzerkonten in PhpBB zu löschen und damit das Problem zu beheben.</b>';
+
+$lang['Audit_Link_Break'] = '<b>Audit von reparierbaren Links von Benutzerkonten in Piwigo und PhpBB</b>';
+$lang['Error_Link_Break'] = '<b>Fehlerhafter Link von Benutzerkonten in Piwigo und PhpBB:</b> ';
+$lang['New_Link'] = 'Verbundene Benutzerkonten: ';
+
+$lang['Audit_Link_Bad'] = '<b>Audit von fehlerhaften Links von Benutzerkonten in Piwigo und PhpBB</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 PhpBB</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_PWG2PhpBB'] = '<b>Audit von vorhandenen Benutzerkonten in Piwigo und fehlenden Benutzerkonten in PhpBB</b>';
+$lang['Error_PWG2PhpBB'] = '<b>In PhpBB nicht vorhandene Piwigo Benutzerkonten:</b> ';
+$lang['Add_User'] = 'Benutzerkonto in PhpBB hinzufügen: ';
+
+$lang['Audit_PhpBB2PWG'] = '<b>Audit von vorhandenen Benutzerkonten in PhpBB und fehlenden Benutzerkonten in Piwigo</b>';
+$lang['Error_PhpBB2PWG'] = '<b>In Piwigo nicht vorhandene PhpBB Benutzerkonten:</b> ';
+$lang['Del_User'] = 'Benutzerkonto in PhpBB löschen: ';
+
+$lang['Audit_OK'] = 'Audit OK<br><br>';
+
+$lang['Mig_Btn'] = 'Migration';
+$lang['Mig_Title'] = 'Migration von Benutzerkonten von Piwigo nach PhpBB';
+$lang['Mig_Text'] = '
+  <div class="warning"> NUR BENUTZEN wenn Sie diesen Plugin noch nie benutzt haben, um Piwigo mit PhpBB zu verbinden <u>UND</u> wenn es in Ihrem Forum keine Benutzerkonten gibt !!!</b></div><br>
+  		--> In diesem Fall dürfen in der Tabelle [PrefixPhpBB]_user von PhpBB keine Benutzerkonten außer Gast und Administrator vorhanden sein.<br><br>
+  - Die Migration wird als Erstes alle Links zwischen Benutzerkonten in Piwigo und PhpBB entfernen.<br>
+  - Dann <b>WERDEN ALL PhpBB BENUTZERKONTEN GELÖSCHT</b> (mit Ausnahme der Konten Gast und Administrator, sowie Such-Roboter).<br>
+  <br>
+  <div class="warning">WARNUNG SOLLTEN SIE SPEZIELLE BENUTZERKONTEN IN PhpBB HABEN == BENUTZEN SIE AUF KEINEN FALL DIESE FUNKTION !!!</div><br>
+  - Abschließend werden alle Piwigo Benutzerkonten bis auf Gast in PhpBB 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 PhpBB</b>';
+$lang['Mig_Del_Link'] = '<b>Links zwischen Benutzerkonten von Piwigo und PhpBB löschen</b>';
+$lang['Mig_Del_AllUsers'] = '<b>PhpBB 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_PhpBB - 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 PhpBB forum (<b>Warning: These changes will disappear when updating the forum</b>):
+<br><br>
+  <b>* Modify the file</b> : [PhpBBRoot]/ucp.php by searching the following line :
+  <div class="mod">case \'sendpassword\':</div>
+  <b>and replace the 2 following lines (to break) by :</b>
+  <div class="info">redirect(\'http://[PiwigoRoot]/password.php\', false, true);</div>
+  <br><br>
+  <b>* Modify the same file</b> : Search the following line :
+  <div class="mod">case \'register\':</div>
+  <b>and replace the 7 following lines (to break) by :</b>
+  <div class="info">redirect(\'http://[PiwigoRoot]/register.php\', false, true);</div>
+  <br><br>
+  * In the <b>Control Panel</b>, go to the permissions of the groups and change the line "Can change password" to <b>No</b>.
+  <br>';
+/*TODO*/$lang['About_Reg'] = 'About the registration of users on the forum PhpBB';
+/*TODO*/$lang['Bridge_UAM'] = 'Access validation to the forum via UserAdvManager (UAM) plugin: Turn the bridge on between the two plugins that will allow you to prohibit the access to your PhpBB 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_PhpBB / UAM';
+/*TODO*/$lang['Bridge_UAM_false'] = ' --> Disable bridge Register_PhpBB / UAM (default)';
+/*TODO*/$lang['PhpBB_Group'] = 'Specify the name of <b>PhpBB\' group</b> in which validated users must be (to be created in advance in PhpBB). By default, type "REGISTERED" (registered users). For more information, see end of this page.';
+/*TODO*/$lang['About_Bridge'] = 'About Register_PhpBB / 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_PhpBB 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><br>
+- Several groups are created by default when creating your forum. Two of them are called "New registered users" and "Registered Users". The first group has very limited permissions that are adjustable in the Control Panel. It is in this group that not validated users are sent in the case where the bridge is active. Otherwise, users are assigned by default to the second group, which has more rights, also modifiable. <br>
+- You can choose to create a new group for your validated users, or simply use "Registered Users" and change some settings.<br>
+- Then simply type above the group name chosen for validated users: "REGISTERED" if you keep the one created at the beginning or "Members" or "VIP" ... if you have created your own group. The syntax should be the same as chosen in phpBB when creating the group (uppercase, lowercase ...).<br>
+<br><br>
+<b class="mod"><u>Important notes:</u></b>
+<br><br>
+If you\'ve never used Register_PhpBB, the Piwigo\'s accounts migration phase from your gallery to your PhpBB 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
+
+// --------- Starting below: New or revised $lang ---- from version 2.3.3
+/*TODO*/$lang['Admin'] = 'Piwigo\'s administrator username. <b style="color: red">The username of PhpBB\'s administrator account has to be the same!</b>';
+/*TODO*/$lang['error_config_admin1'] = 'ERROR : Piwigo\'s admin username is wrong!';
+/*TODO*/$lang['error_config_admin2'] = 'ERROR : The name of the PhpBB\'s administrator account is different from that of Piwigo ! Check the configuration of your PhpBB forum and rename the administrator account in the same name as that of Piwigo.';
+/*TODO*/$lang['error_config_guest'] = 'ERROR : The name of the PhpBB\'s guest account is wrong!';
+// --------- End: New or revised $lang ---- from version 2.3.3
+?>
Index: /extensions/Register_PhpBB/language/en_UK/index.php
===================================================================
--- /extensions/Register_PhpBB/language/en_UK/index.php	(revision 7795)
+++ /extensions/Register_PhpBB/language/en_UK/index.php	(revision 7795)
@@ -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_PhpBB/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Register_PhpBB/language/en_UK/plugin.lang.php	(revision 7795)
+++ /extensions/Register_PhpBB/language/en_UK/plugin.lang.php	(revision 7795)
@@ -0,0 +1,154 @@
+<?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 PhpBB';
+$lang['Disclaimer'] = '
+  *** To begin, follow this 2 steps ***<br>
+  Step 1 : Set plugin with the parameters of PhpBB.<br>
+  Step 2 : Migrate user accounts from Piwigo to PhpBB.<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 PhpBB installation and correct them if necessary. <br>
+  Change, if any, the behavior of the plugin at your convenience.';
+$lang['Prefix'] = 'PhpBB Prefix tables :';
+$lang['Guest'] = 'Username of the PhpBB Guest user. (If you do not know, leave as is).';
+$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 PhpBB';
+$lang['Sync_Text'] = '
+  <div class="warning">You\'ve already used the plugin to link your Piwigo (plugin update) and / or your PhpBB 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 [PrefixPhpBB]_user.<br>
+  - Then update the table of correspondence as well as password and email address for each account from Piwigo to PhpBB except Piwigo Guest and PhpBB 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 PhpBB. If so, delete the oldest (sorting PhpBB users according to their date of registration).<br>';
+$lang['Sync_Check_Dup'] = '<b>Analyzing tables of user accounts of Piwigo and PhpBB 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 PhpBB.</b><br><br>';
+$lang['Sync_Link_Break'] = '<b>Analysis of repairable links between accounts in Piwigo and PhpBB</b>';
+$lang['Sync_Link_Bad'] = '<b>Analysis of bad relationships between accounts in Piwigo and PhpBB</b>';
+$lang['Sync_DataUser'] = '<b>Analysis of passwords and email addresses between accounts in Piwigo and PhpBB</b>';
+$lang['Sync_PWG2PhpBB'] = '<b>Analysis of existing accounts in Piwigo and missing in PhpBB</b>';
+$lang['Sync_PhpBB2PWG'] = '<b>Analysis of existing accounts in PhpBB 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_PhpBB_Dup'] = '<b>Audit of PhpBB\'s accounts table</b>';
+$lang['Error_PhpBB_Dup'] = '<b>Error in PhpBB\'s accounts table, there are duplicates:</b> ';
+$lang['Advise_PhpBB_Dup'] = '<b>WARNING! You must make these corrections in PhpBB before continuing<br>use the icons to delete users from PhpBB and resolve the problem.</b>';
+
+$lang['Audit_Link_Break'] = '<b>Audit of repairable links between Piwigo and PhpBB accounts</b>';
+$lang['Error_Link_Break'] = '<b>Broken link between Piwigo and PhpBB accounts:</b> ';
+$lang['New_Link'] = 'Account linked: ';
+
+$lang['Audit_Link_Bad'] = '<b>Audit of bad links between Piwigo and PhpBB 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 PhpBB 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_PWG2PhpBB'] = '<b>Audit of the existing accounts in Piwigo and missing in PhpBB</b>';
+$lang['Error_PWG2PhpBB'] = '<b>The Piwigo account not in PhpBB:</b> ';
+$lang['Add_User'] = 'Adding in PhpBB of account: ';
+
+$lang['Audit_PhpBB2PWG'] = '<b>Audit of the existing accounts in PhpBB and missing in Piwigo</b>';
+$lang['Error_PhpBB2PWG'] = '<b>The PhpBB account not in Piwigo:</b> ';
+$lang['Del_User'] = 'Removal from PhpBB of account : ';
+
+$lang['Audit_OK'] = 'Audit OK<br><br>';
+
+$lang['Mig_Btn'] = 'Migration';
+$lang['Mig_Title'] = 'Migration of accounts from Piwigo to PhpBB';
+$lang['Mig_Text'] = '
+  <div class="warning"> USE ONLY IF you have never used the plugin to link Piwigo to PhpBB <u>AND IF</u> your forum is empty of users !!!</b></div><br>
+  		--> In this case, your table [PrefixPhpBB]_user of PhpBB must be empty of any account except the 2 accounts guest and administrator, as well as search bots.<br><br>
+  - The migration will first remove the links between accounts of Piwigo and PhpBB.<br>
+  - Then <b>WILL DELETE ALL PhpBB ACCOUNTS</b> except the 2 accounts guest and administrator.<br>
+  <br>
+  <div class="warning">WARNING IF YOU HAVE ANY SPECIAL ACCOUNTS IN PhpBB == DO NOT USE THIS FUNCTION !!!</div><br>
+  - Finally, the migration will create all Piwigo\'s accounts in PhpBB, 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 PhpBB</b>';
+$lang['Mig_Del_Link'] = '<b>Deleting links between accounts of Piwigo and PhpBB</b>';
+$lang['Mig_Del_AllUsers'] = '<b>Deleting PhpBB 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_PhpBB - 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 PhpBB forum (<b>Warning: These changes will disappear when updating the forum</b>):
+<br><br>
+  <b>* Modify the file</b> : [PhpBBRoot]/ucp.php by searching the following line :
+  <div class="mod">case \'sendpassword\':</div>
+  <b>and replace the 2 following lines (to break) by :</b>
+  <div class="info">redirect(\'http://[PiwigoRoot]/password.php\', false, true);</div>
+  <br><br>
+  <b>* Modify the same file</b> : Search the following line :
+  <div class="mod">case \'register\':</div>
+  <b>and replace the 7 following lines (to break) by :</b>
+  <div class="info">redirect(\'http://[PiwigoRoot]/register.php\', false, true);</div>
+  <br><br>
+  * In the <b>Control Panel</b>, go to the permissions of the groups and change the line "Can change password" to <b>No</b>.
+  <br>';
+$lang['About_Reg'] = 'About the registration of users on the forum PhpBB';
+$lang['Bridge_UAM'] = 'Access validation to the forum via UserAdvManager (UAM) plugin: Turn the bridge on between the two plugins that will allow you to prohibit the access to your PhpBB 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_PhpBB / UAM';
+$lang['Bridge_UAM_false'] = ' --> Disable bridge Register_PhpBB / UAM (default)';
+$lang['PhpBB_Group'] = 'Specify the name of <b>PhpBB\' group</b> in which validated users must be (to be created in advance in PhpBB). By default, type "REGISTERED" (registered users). For more information, see end of this page.';
+$lang['About_Bridge'] = 'About Register_PhpBB / 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_PhpBB 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><br>
+- Several groups are created by default when creating your forum. Two of them are called "New registered users" and "Registered Users". The first group has very limited permissions that are adjustable in the Control Panel. It is in this group that not validated users are sent in the case where the bridge is active. Otherwise, users are assigned by default to the second group, which has more rights, also modifiable. <br>
+- You can choose to create a new group for your validated users, or simply use "Registered Users" and change some settings.<br>
+- Then simply type above the group name chosen for validated users: "REGISTERED" if you keep the one created at the beginning or "Members" or "VIP" ... if you have created your own group. The syntax should be the same as chosen in phpBB when creating the group (uppercase, lowercase ...).<br>
+<br><br>
+<b class="mod"><u>Important notes:</u></b>
+<br><br>
+If you\'ve never used Register_PhpBB, the Piwigo\'s accounts migration phase from your gallery to your PhpBB 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
+
+// --------- Starting below: New or revised $lang ---- from version 2.3.3
+$lang['Admin'] = 'Piwigo\'s administrator username. <b style="color: red">The username of PhpBB\'s administrator account has to be the same!</b>';
+$lang['error_config_admin1'] = 'ERROR : Piwigo\'s admin username is wrong!';
+$lang['error_config_admin2'] = 'ERROR : The name of the PhpBB\'s administrator account is different from that of Piwigo ! Check the configuration of your PhpBB forum and rename the administrator account in the same name as that of Piwigo.';
+$lang['error_config_guest'] = 'ERROR : The name of the PhpBB\'s guest account is wrong!';
+// --------- End: New or revised $lang ---- from version 2.3.3
+?>
Index: /extensions/Register_PhpBB/language/fr_FR/index.php
===================================================================
--- /extensions/Register_PhpBB/language/fr_FR/index.php	(revision 7795)
+++ /extensions/Register_PhpBB/language/fr_FR/index.php	(revision 7795)
@@ -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_PhpBB/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Register_PhpBB/language/fr_FR/plugin.lang.php	(revision 7795)
+++ /extensions/Register_PhpBB/language/fr_FR/plugin.lang.php	(revision 7795)
@@ -0,0 +1,155 @@
+<?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 PhpBB';
+$lang['Disclaimer'] = '
+  *** Pour débuter, 2 étapes à suivre ***<br>
+  1ère étape : Configurer les paramètres du plugin avec les paramètres de PhpBB.<br>
+  2ème étape : Migrer les comptes utilisateurs de Piwigo vers PhpBB.<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 PhpBB et corrigez les au besoin.<br>
+  Modifiez, le cas échéant, le comportement du plugin à votre convenance.';
+$lang['Prefix'] = 'Préfixe des tables de PhpBB :';
+$lang['Guest'] = 'Nom d\'utilisateur de l\'invité de PhpBB (Si vous ne savez pas, laissez tel quel).';
+$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 PhpBB';
+$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 PhpBB 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 [PrefixPhpBB]_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 PhpBB sauf Piwigo Guest et PhpBB 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 PhpBB, si c\'est le cas, il faut supprimer les plus anciens (tri des utilisateurs PhpBB selon leur date d\'incription).<br>';
+$lang['Sync_Check_Dup'] = '<b>Analyse des tables des comptes utilisateurs de Piwigo et PhpBB 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 PhpBB.</b><br><br>';
+$lang['Sync_Link_Break'] = '<b>Analyse des liens réparables entre les comptes Piwigo et PhpBB</b>';
+$lang['Sync_Link_Bad'] = '<b>Analyse des mauvais liens entre les comptes Piwigo et PhpBB</b>';
+$lang['Sync_DataUser'] = '<b>Analyse des mots de passe et des adresses emails entre les comptes Piwigo et PhpBB</b>';
+$lang['Sync_PWG2PhpBB'] = '<b>Analyse des comptes existants dans Piwigo et manquants dans PhpBB</b>';
+$lang['Sync_PhpBB2PWG'] = '<b>Analyse des comptes existants dans PhpBB 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_PhpBB_Dup'] = '<b>Audit de la table des comptes PhpBB</b>';
+$lang['Error_PhpBB_Dup'] = '<b>Erreur dans la table des comptes PhpBB, il y a des doublons :</b> ';
+$lang['Advise_PhpBB_Dup'] = '<b>ATTENTION Vous devez faire ces corrections dans PhpBB avant de continuer<br>utilisez les icones pour supprimer les utilisateurs de PhpBB et régler le problème.</b>';
+
+$lang['Audit_Link_Break'] = '<b>Audit des liens réparables entre les comptes Piwigo et PhpBB</b>';
+$lang['Error_Link_Break'] = '<b>Lien brisé entre les comptes Piwigo et PhpBB :</b> ';
+$lang['New_Link'] = 'Liaison du compte : ';
+
+$lang['Audit_Link_Bad'] = '<b>Audit des mauvais liens entre les comptes Piwigo et PhpBB</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 PhpBB</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_PWG2PhpBB'] = '<b>Audit des comptes existants dans Piwigo et manquants dans PhpBB</b>';
+$lang['Error_PWG2PhpBB'] = '<b>Le compte Piwigo n\'existe pas dans PhpBB :</b> ';
+$lang['Add_User'] = 'Ajout dans PhpBB du compte : ';
+
+$lang['Audit_PhpBB2PWG'] = '<b>Audit des comptes existants dans PhpBB et manquants dans Piwigo</b>';
+$lang['Error_PhpBB2PWG'] = '<b>Le compte PhpBB n\'existe pas dans Piwigo :</b> ';
+$lang['Del_User'] = 'Suppression de PhpBB du compte : ';
+
+$lang['Audit_OK'] = 'Audit OK<br><br>';
+
+$lang['Mig_Btn'] = 'Migration';
+$lang['Mig_Title'] = 'Migration des comptes de Piwigo vers PhpBB';
+$lang['Mig_Text'] = '
+  <div class="warning"> A N\'UTILISER QUE SI vous n\'avez jamais utilisé le plugin pour lier Piwigo à PhpBB <u>ET SI</u> votre forum est vide d\'utilisateurs !!!</div><br>
+  		--> Dans ce cas, votre table [PrefixPhpBB]_users de PhpBB 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 PhpBB.<br>
+  - Puis <b>SUPPRIMERA TOUS LES COMPTES PhpBB</b> sauf les 2 comptes d\'invité et d\'administrateur, ainsi que ceux des robots de recherche.<br>
+  <br>
+  <div class="warning">ATTENTION SI VOUS AVEZ DES COMPTES PARTICULIERS DANS PhpBB == NE SURTOUT PAS UTILISER CETTE FONCTION !!!</div><br>
+  - Enfin la migration va créer tout les comptes de Piwigo dans PhpBB 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 PhpBB</b>';
+$lang['Mig_Del_Link'] = '<b>Suppression des liens entre les comptes Piwigo et PhpBB</b>';
+$lang['Mig_Del_AllUsers'] = '<b>Suppression des comptes PhpBB</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_PhpBB - 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 PhpBB (<b>Attention! Ces modifications disparaitront en cas de mise à jour du forum</b>):
+<br><br>
+  <b>* Modifier le fichier</b> : [RacineDePhpBB]/ucp.php en cherchant la ligne suivante :
+  <div class="mod">case \'sendpassword\':</div>
+  <b>et remplacez les 2 lignes qui suivent (jusqu\'à break) par :</b>
+  <div class="info">redirect(\'http://[VotreracinedePiwigo]/password.php\', false, true);</div>
+  <br><br>
+  <b>* De même juste en dessous</b> : Cherchez la ligne suivante :
+  <div class="mod">case \'register\':</div>
+  <b>et remplacez les 7 lignes qui suivent (jusqu\'à break) par :</b>
+  <div class="info">redirect(\'http://[VotreracinedePiwigo]/register.php\', false, true);</div>
+  <br><br>
+  <b>* Dans le panneau de configuration</b> : allez dans les permissions des groupes et changez la ligne "Peut modifier son mot de passe" à <b>Non</b>.
+  <br>';
+$lang['About_Reg'] = 'A propos de l\'enregistrement d\'utilisateur sur le forum PhpBB';
+$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 PhpBB 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_PhpBB / UAM activé';
+$lang['Bridge_UAM_false'] = ' --> Pont Register_PhpBB / UAM désactivé (par défaut)';
+$lang['PhpBB_Group'] = 'Précisez ici le nom du <b>groupe PhpBB</b> dans lequel les utilisateurs validés doivent se trouver (à créer au préalable dans PhpBB). Par défaut rentrez "REGISTERED" (Utilisateurs enregistrés). Pour plus d\'infos, voir à la fin de cette page.';
+$lang['About_Bridge'] = 'A propos du pont Register_PhpBB / 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_PhpBB 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>
+- Plusieurs groupes sont créés par défaut lors de la création de votre forum. Deux d\'entre eux se nomment "Nouveaux utilisateurs enregistrés" et "Utilisateurs enregistrés". Le premier groupe dispose d\'autorisations très limitées qui sont ajustables dans le panneau de configuration. C\'est dans ce groupe que les utilisateurs non validés sont envoyés dans le cas où le pont est actif. Dans le cas contraire, les utilisateurs sont assignés par défaut au second groupe, qui dispose de droits beaucoup plus larges, modifiables également.<br>
+- Vous pouvez choisir de créer un nouveau groupe pour vos utilisateurs validés, ou bien vous contenter de celui "Utilisateurs enregistrés" et en modifier certains paramètres.<br>
+- Il vous suffit ensuite de rentrer ci-dessus le nom de groupe choisi pour les utilisateurs validés : "REGISTERED" si vous gardez celui créé au début ou "Membres" ou "VIP"... si vous avez créé votre propre groupe. La syntaxe doit être identique à celle rentrée dans PhpBB lors de la création du groupe (majuscules, minuscules...).<br>
+<br><br>
+<b class="mod"><u>Notes importantes:</u></b>
+<br><br>
+Si vous n\'avez jamais utilisé Register_PhpBB, la phase de migration des comptes de votre galerie Piwigo vers votre forum PhpBB ne tiendra pas compte de l\'état validé ou non de vos inscrits au moment du lancement de la phase de migration.';
+// --------- End: New or revised $lang ---- from version 2.3.0
+
+// --------- Starting below: New or revised $lang ---- from version 2.3.3
+$lang['Admin'] = 'Nom d\'utilisateur de l\'administrateur de Piwigo. <b style="color: red">Le nom de l\'administrateur de PhpBB doit être identique !</b>';
+$lang['error_config_admin1'] = 'ERREUR : Le nom du compte administrateur de Piwigo est incorrect !';
+$lang['error_config_admin2'] = 'ERREUR : Le nom du compte administrateur de PhpBB est différent de celui de Piwigo ! Vérifiez la configuration de votre forum PhpBB et nommez le compte administrateur de la même manière que celui de Piwigo.';
+$lang['error_config_guest'] = 'ERREUR : Le nom du compte visiteur (guest) de PhpBB est incorrect !';
+// --------- End: New or revised $lang ---- from version 2.3.3
+?>
Index: /extensions/Register_PhpBB/language/index.php
===================================================================
--- /extensions/Register_PhpBB/language/index.php	(revision 7795)
+++ /extensions/Register_PhpBB/language/index.php	(revision 7795)
@@ -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_PhpBB/main.inc.php
===================================================================
--- /extensions/Register_PhpBB/main.inc.php	(revision 7795)
+++ /extensions/Register_PhpBB/main.inc.php	(revision 7795)
@@ -0,0 +1,200 @@
+<?php
+/*
+Plugin Name: Register PhpBB
+Version: 2.1.a
+Description: Link user registration from Piwigo to PhpBB forum (registration, password changing, deletion) - Original Eric's Register_FluxBB plugin adapted to PhpBB. / Liez l'inscription des utilisateurs de Piwigo avec votre forum PhpBB - Adaptation du plugin Register_FluxBB d'Eric.
+Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=129
+Author: Pierric, Eric
+Author URI: http://www.infernoweb.net
+*/
+
+/*
+--------------------------------------------------------------------------------
+  Author     : Pierric, Eric
+    email    : pierrot007@gmail.com, lucifer@infernoweb.net
+    website  : http://www.infernoweb.net
+    PWG user : http://fr.piwigo.org/forum/profile.php?id=5784, http://forum.phpwebgallery.net/profile.php?id=1106
+--------------------------------------------------------------------------------
+
+:: HISTORY
+
+2.1.a		- 15/11/2010 - Initial release.
+--------------------------------------------------------------------------------
+*/
+
+// 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('REGPHPBB_DIR')) define('REGPHPBB_DIR' , basename(dirname(__FILE__)));
+if (!defined('REGPHPBB_PATH')) define('REGPHPBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+
+include_once (REGPHPBB_PATH.'include/constants.php');
+include_once (REGPHPBB_PATH.'include/functions.inc.php');
+
+
+/* plugin administration */
+add_event_handler('get_admin_plugin_menu_links', 'Register_PhpBB_admin_menu');
+
+function Register_PhpBB_admin_menu($menu)
+{
+  array_push($menu, array(
+    'NAME' => 'Register PhpBB',
+    'URL'  => get_admin_plugin_menu_link(REGPHPBB_PATH.'admin/admin.php')));
+  return $menu;
+}
+
+
+/* user creation*/
+add_event_handler('register_user', 'Register_PhpBB_Adduser');
+
+function Register_PhpBB_Adduser($register_user)
+{
+  global $conf;
+
+  // Exclusion of Adult_Content users
+  if ($register_user['username'] != "16" and $register_user['username'] != "18")
+  {
+    include_once (REGPHPBB_PATH.'include/functions.inc.php');
+
+    // Warning : PhpBB uses md5 hash like Piwigo, but not like PhpBB !
+    PhpBB_Adduser($register_user['id'], $register_user['username'], md5($_POST['password']), $register_user['email']);
+  }
+}
+
+
+/* user deletion */
+add_event_handler('delete_user', 'Register_PhpBB_Deluser');
+
+function Register_PhpBB_Deluser($user_id)
+{
+  include_once (REGPHPBB_PATH.'include/functions.inc.php');
+
+  PhpBB_Deluser( PhpBB_Searchuser($user_id), true );
+}
+
+
+/* Profile management */
+if (script_basename() == 'profile')
+{
+  add_event_handler('loc_begin_profile', 'Register_PhpBB_InitPage', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
+
+  function Register_PhpBB_InitPage()
+  {
+    global $conf, $user;
+    include_once (REGPHPBB_PATH.'include/functions.inc.php');
+
+    if (isset($_POST['validate']) and !is_admin())
+    {
+    if (!empty($_POST['use_new_pwd']))
+      {
+      $query = '
+SELECT '.$conf['user_fields']['username'].' AS username
+FROM '.USERS_TABLE.'
+WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+;';
+
+      list($username) = pwg_db_fetch_row(pwg_query($query));
+
+      PhpBB_Updateuser($user['id'], stripslashes($username), md5($_POST['use_new_pwd']), $_POST['mail_address']);
+      }
+    }
+  }
+}
+
+
+/* Access validation in PhpBB when validated in Piwigo through UAM plugin */
+add_event_handler('login_success', 'UAM_Bridge', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
+
+function UAM_Bridge()
+{
+  global $conf, $user;
+
+  $conf_Register_PhpBB = isset($conf['Register_PhpBB']) ? explode(";" , $conf['Register_PhpBB']) : array();
+
+  // Check if UAM is installed and if bridge is set - Exception for admins and webmasters
+  $query ='
+SELECT user_id, status
+FROM '.USER_INFOS_TABLE.'
+WHERE user_id = '.$user['id'].'
+;';
+  $data = pwg_db_fetch_assoc(pwg_query($query));
+
+  if ($data['status'] <> "admin" and $data['status'] <> "webmaster")
+  {
+    if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_PhpBB[5]) and $conf_Register_PhpBB[5] == 'true')
+    {
+      $conf_UAM = unserialize($conf['UserAdvManager']);
+
+      // Getting unvalidated users group else Piwigo's default group
+      if (isset($conf_UAM[2]) and $conf_UAM[2] != '-1')
+      {
+        $Waitingroup = $conf_UAM[2];
+      }
+      else
+      {
+        $query = '
+SELECT id
+FROM '.GROUPS_TABLE.'
+WHERE is_default = "true"
+LIMIT 1
+;';
+        $data = pwg_db_fetch_assoc(pwg_query($query));
+        $Waitingroup = $data['id'];
+      }
+
+      // check if logged in user is in a Piwigo's validated or unvalidated users group
+      $query = '
+SELECT *
+FROM '.USER_GROUP_TABLE.'
+WHERE user_id = '.$user['id'].'
+AND group_id = '.$Waitingroup.'
+;';
+      $count = pwg_db_num_rows(pwg_query($query));
+
+      // Check if logged in user is in a PhpBB's unvalidated group
+      $query = "
+SELECT group_id
+FROM ".PhpBB_USERS_TABLE."
+WHERE user_id = ".PhpBB_Searchuser($user['id'])."
+;";
+
+      $data = pwg_db_fetch_assoc(pwg_query($query));
+
+      $query = "
+SELECT group_id
+FROM ".PhpBB_GROUPS_TABLE."
+WHERE group_name = '".$conf_Register_PhpBB[6]."'
+;";
+      $data1 = pwg_db_fetch_assoc(pwg_query($query));
+
+      // Logged in user switch to the default PhpBB's group if he'is validated
+      if ($count == 0 and $data['group_id'] != $data1['group_id'])
+      {
+        $query = "
+SELECT group_id, group_colour
+FROM ".PhpBB_GROUPS_TABLE."
+WHERE group_name = '".$conf_Register_PhpBB[6]."'
+;";
+        $default_user = pwg_db_fetch_assoc(pwg_query($query));
+
+        $query = "
+UPDATE ".PhpBB_USERS_TABLE."
+SET group_id = '".$default_user['group_id']."', user_colour = '".$default_user['group_colour']."'
+WHERE user_id = ".PhpBB_Searchuser($user['id'])."
+;";
+        $result = pwg_query($query);
+
+      	$query = "
+UPDATE ".PhpBB_USERGROUP_TABLE."
+SET group_id = '".$default_user['group_id']."'
+WHERE user_id = ".PhpBB_Searchuser($user['id'])."
+;";
+      	$result = pwg_query($query);
+      }
+    }
+  }
+}
+?>
Index: /extensions/Register_PhpBB/maintain.inc.php
===================================================================
--- /extensions/Register_PhpBB/maintain.inc.php	(revision 7795)
+++ /extensions/Register_PhpBB/maintain.inc.php	(revision 7795)
@@ -0,0 +1,80 @@
+<?php
+
+if(!defined("REGPHPBB_DIR")) define('REGPHPBB_DIR' , basename(dirname(__FILE__)));
+if(!defined("REGPHPBB_PATH")) define('REGPHPBB_PATH' , PHPWG_PLUGINS_PATH.REGPHPBB_DIR.'/');
+//ini_set('error_reporting', E_ALL);
+//ini_set('display_errors', true);
+
+include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+include_once (REGPHPBB_PATH.'include/constants.php');
+include_once (REGPHPBB_PATH.'include/functions.inc.php');
+
+
+function plugin_install()
+{
+  global $prefixeTable;
+
+  $q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+VALUES ("Register_PhpBB","phpbb_;admin;Anonymous;false;true;false;REGISTERED","Parametres Register_PhpBB")
+;';
+
+  pwg_query($q);
+
+  $q = "
+CREATE TABLE IF NOT EXISTS ".Register_PhpBB_ID_TABLE." (
+  id_user_pwg smallint(5) NOT NULL default '0',
+  id_user_PhpBB int(10) NOT NULL default '0',
+PRIMARY KEY  (id_user_pwg),
+  KEY id_user_pwg (id_user_pwg, id_user_PhpBB)
+)
+;";
+
+  pwg_query($q);
+
+}
+
+function plugin_activate()
+{
+  global $conf;
+
+/* Cleaning obsolete files */
+/* *********************** */
+  regphpbb_obsolete_files();
+
+/* Check version < 2.3.0 */
+  $conf_Register_PhpBB = isset($conf['Register_PhpBB']) ? explode(";" , $conf['Register_PhpBB']) : array();
+
+  if (!isset($conf_Register_PhpBB[5]) and !isset($conf_Register_PhpBB[6]))
+  {
+    $upgrade_RFBB = $conf_Register_PhpBB[0].';'.$conf_Register_PhpBB[1].';'.$conf_Register_PhpBB[2].';'.$conf_Register_PhpBB[3].';'.$conf_Register_PhpBB[4].';false;REGISTERED';
+
+    $query = '
+UPDATE '.CONFIG_TABLE.'
+SET value="'.$upgrade_RFBB.'"
+WHERE param="Register_PhpBB"
+LIMIT 1
+;';
+		pwg_query($query);
+  }
+}
+
+function plugin_uninstall()
+{
+  global $conf;
+
+  if (isset($conf['Register_PhpBB']))
+  {
+    $q = '
+DELETE FROM '.CONFIG_TABLE.'
+WHERE param="Register_PhpBB" LIMIT 1
+;';
+
+    pwg_query($q);
+  }
+
+  $q = 'DROP TABLE '.Register_PhpBB_ID_TABLE.';';
+  pwg_query( $q );
+
+}
+?>
