Index: /extensions/Register_PunBB/admin/reg_punbb_admin.php
===================================================================
--- /extensions/Register_PunBB/admin/reg_punbb_admin.php	(revision 7809)
+++ /extensions/Register_PunBB/admin/reg_punbb_admin.php	(revision 7809)
@@ -0,0 +1,176 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Plugin Name : Register_PunBB                                          |
+// | Plugin Version : 1.3a                                                 |
+// | File Version : 0.2                                                    |
+// | Plugin Version author : Eric <lucifer@infernoweb.net>                 |
+// | Plugin description :                                                  |
+// | Ce plugin permet l'enregistrement d'un utilisateur directement dans   |
+// | PunBB (http://www.punbb.org) - This plugin allows to automatically    |
+// | register a PWG user in a PunBB forum (http://www.punbb.org)           |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// ***************************************
+// ** Plugin Administration panel setup **
+// ***************************************
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+/* ****************************************************** */
+/* Plugin template initialisation for admin panel display */
+/* ****************************************************** */
+
+$me = get_plugin_data($plugin_id);
+
+global $template;
+
+// Setup plugin Language
+  $RPlang = ( isset($user['language']) ) ?
+    $user['language'] : $conf['default_language']; // en_UK.iso-8859-1
+  $my_path = dirname(__FILE__).'/../';
+  $rp = array();
+  if ( !@file_exists($my_path."language/$RPlang/lang.admin.regpunbb.php") )
+  {
+    $SIElang = 'en_UK.iso-8859-1';
+  }
+// Include language
+  @include_once( $my_path."language/$RPlang/lang.admin.regpunbb.php" );
+
+// Load configuration settings from database
+load_conf_from_db('param like \'punbb\\_%\'');
+
+// Update configuration settings in database
+if ( isset($_POST['submit']) )
+{
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+  SET value="'.$_POST['punbb_status'].'"
+  WHERE param="punbb_status"
+  LIMIT 1';
+  pwg_query($query);
+
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+  SET value="'.$_POST['punbb_prefix'].'"
+  WHERE param="punbb_prefix"
+  LIMIT 1';
+  pwg_query($query);
+  
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+  SET value="'.$_POST['punbb_id_default_group'].'"
+  WHERE param="punbb_id_default_group"
+  LIMIT 1';
+  pwg_query($query);
+  
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+  SET value="'.$_POST['punbb_admin'].'"
+  WHERE param="punbb_admin"
+  LIMIT 1';
+  pwg_query($query);
+  
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+  SET value="'.$_POST['punbb_email_setting'].'"
+  WHERE param="punbb_email_setting"
+  LIMIT 1';
+  pwg_query($query);
+  
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+  SET value="'.$_POST['punbb_save_pass'].'"
+  WHERE param="punbb_save_pass"
+  LIMIT 1';
+  pwg_query($query);
+  
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+  SET value="'.$_POST['punbb_notify_with_post'].'"
+  WHERE param="punbb_notify_with_post"
+  LIMIT 1';
+  pwg_query($query);
+  
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+  SET value="'.$_POST['punbb_timezone'].'"
+  WHERE param="punbb_timezone"
+  LIMIT 1';
+  pwg_query($query);
+  
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+  SET value="'.$_POST['punbb_language'].'"
+  WHERE param="punbb_language"
+  LIMIT 1';
+  pwg_query($query);
+  
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+  SET value="'.$_POST['punbb_style'].'"
+  WHERE param="punbb_style"
+  LIMIT 1';
+  pwg_query($query);
+  
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+  SET value="'.$_POST['punbb_del_pt'].'"
+  WHERE param="punbb_del_pt"
+  LIMIT 1';
+  pwg_query($query);
+
+// Reload settings for correct display after update
+load_conf_from_db('param like \'punbb\\_%\'');
+}
+
+// Users migration from PWG to PunBB
+//TODO: How to insert migration results in pwg template or a new blank window ?
+if ( isset($_POST['Migration']) )
+{
+	include_once (PHPWG_ROOT_PATH.'plugins/Register_Punbb/include/constants.php');
+	include (PHPWG_ROOT_PATH.'plugins/Register_Punbb/reg_punbb_migration.php');
+}
+
+// Users table synchronization
+//TODO: How to insert synchronization results in pwg template or a new blank window ?
+if ( isset($_POST['Synchro']) )
+{
+	include_once (PHPWG_ROOT_PATH.'plugins/Register_Punbb/include/constants.php');
+	include (PHPWG_ROOT_PATH.'plugins/Register_Punbb/reg_punbb_synchro.php');
+}
+
+/* Template settings */
+$template->assign_vars(
+    array(
+      'PUNBB_STATUS' => $conf['punbb_status'],
+	  'PUNBB_PREFIX' => $conf['punbb_prefix'],
+      'PUNBB_ID_DEFAULT_GROUP' => $conf['punbb_id_default_group'],
+      'PUNBB_ADMIN' => $conf['punbb_admin'],
+      'PUNBB_EMAIL_SETTING' => $conf['punbb_email_setting'],
+      'PUNBB_SAVE_PASS' => $conf['punbb_save_pass'],
+      'PUNBB_NOTIFY_WITH_POST' => $conf['punbb_notify_with_post'],
+      'PUNBB_TIMEZONE' => $conf['punbb_timezone'],
+      'PUNBB_LANGUAGE' => $conf['punbb_language'],
+      'PUNBB_STYLE' => $conf['punbb_style'],
+      'PUNBB_DEL_PT' => $conf['punbb_del_pt'],
+    )
+  );
+
+$template->set_filenames( array('plugin_admin_content' => dirname(__FILE__).'/reg_punbb_admin.tpl') );
+
+$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/Register_PunBB/admin/reg_punbb_admin.tpl
===================================================================
--- /extensions/Register_PunBB/admin/reg_punbb_admin.tpl	(revision 7809)
+++ /extensions/Register_PunBB/admin/reg_punbb_admin.tpl	(revision 7809)
@@ -0,0 +1,82 @@
+<div class="titrePage">
+  <h2>{lang:Title}</h2>
+</div>
+
+<p>{lang:Howto}</p>
+
+<br />
+
+<div align="left" style="margin-left: 1em; margin-right: 1em;">{lang:Install_Disclaimer}</div>
+
+<br />
+
+<form method="post" action="{RegPunBB_F_ACTION}" class="general">
+<fieldset>
+	<legend>{lang:Update}</legend>
+	<div align="left">{lang:Update_Disclaimer}</div>
+</fieldset>
+</form>
+
+<br />
+
+<div align="left" style="margin-left: 1em; margin-right: 1em;">{lang:Install_Disclaimer2}</div>
+
+<br />
+
+<form method="post" action="{RegPunBB_F_ACTION}" class="general">
+<fieldset>
+	<legend>{lang:Step1_Title}</legend>
+<div align="left">{lang:Step1_Disclaimer}</div>
+<ul>
+	<li><label>{lang:Punbb_Prefix}</label><br />
+		<div align="center"><label><input type="text" name="punbb_prefix" value="{PUNBB_PREFIX}" size="8" style="text-align: center;"/></label></div><br /><br />
+	</li>
+	<li><label>{lang:Punbb_Default_Group}</label><br /><br />
+		<div align="center"><label><input type="text" name="punbb_id_default_group" value="{PUNBB_ID_DEFAULT_GROUP}" size="1" style="text-align: center;"/></label></div><br /><br />
+	</li>
+	<li><label>{lang:Punbb_Admin}</label><br /><br />
+		<div align="center"><label><input type="text" name="punbb_admin" value="{PUNBB_ADMIN}" size="12" style="text-align: center;"/></label></div><br /><br />
+	</li>
+	<li><label>{lang:Punbb_Email_Setting}</label>
+		<div align="center"><label><input type="text" name="punbb_email_setting" value="{PUNBB_EMAIL_SETTING}" size="1" style="text-align: center;"/></label></div><br /><br />
+	</li>
+	<li><label>{lang:Punbb_Save_Pass}</label>
+		<div align="center"><label><input type="text" name="punbb_save_pass" value="{PUNBB_SAVE_PASS}" size="1" style="text-align: center;"/></label></div><br /><br />
+	</li>
+	<li><label>{lang:Punbb_Notify_With_Post}</label>
+		<div align="center"><label><input type="text" name="punbb_notify_with_post" value="{PUNBB_NOTIFY_WITH_POST}" size="1" style="text-align: center;"/></label></div><br /><br />
+	</li>
+	<li><label>{lang:Punbb_Timezone}</label>
+		<div align="center"><label><input type="text" name="punbb_timezone" value="{PUNBB_TIMEZONE}" size="1" style="text-align: center;"/></label></div><br /><br />
+	</li>
+	<li><label>{lang:Punbb_Language}</label>
+		<div align="center"><label><input type="text" name="punbb_language" value="{PUNBB_LANGUAGE}" size="8" style="text-align: center;"/></label></div><br /><br />
+	</li>
+	<li><label>{lang:Punbb_Style}</label>
+		<div align="center"><label><input type="text" name="punbb_style" value="{PUNBB_STYLE}" size="8" style="text-align: center;"/></label></div><br /><br />
+	</li>
+	<li><label>{lang:Punbb_Del_Pt}</label>
+		<div align="center"><label><input type="text" name="punbb_del_pt" value="{PUNBB_DEL_PT}" size="1" style="text-align: center;"/></label></div><br /><br />
+	</li>
+	<li><label>{lang:PluginActivation}</label><br />
+		<div align="center"><label><input type="text" name="punbb_status" value="{PUNBB_STATUS}" style="text-align: center;"/></label></div><br /><br />
+	</li>
+</ul>
+	<div align="center"><input class="submit" type="submit" value="{lang:submit}" name="submit" /></div>
+</fieldset>
+</form>
+
+<form method="post" action="{RegPunBB_F_ACTION}" class="general">
+<fieldset>
+	<legend>{lang:Step2_Title}</legend>
+	<div align="left">{lang:Step2_Text}</div>
+<br/>
+	<div align="center">{lang:Step22_Text}</div>
+<br/>
+	<div align="center"><input class="submit" type="submit" value="{lang:Step2_Btn}" name="Migration" /></div>
+<br />
+	<div align="left">{lang:Step3_Text}</div>
+<br/>
+	<div align="center"><input class="submit" type="submit" value="{lang:Step3_Btn}" name="Synchro" /></div>
+</fieldset>
+</form>
Index: /extensions/Register_PunBB/include/constants.php
===================================================================
--- /extensions/Register_PunBB/include/constants.php	(revision 7809)
+++ /extensions/Register_PunBB/include/constants.php	(revision 7809)
@@ -0,0 +1,30 @@
+<?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: constants.php 2002 2007-05-04 22:43:06Z plg $
+// | last update   : $Date: 2007-05-05 00:43:06 +0200 (sam, 05 mai 2007) $
+// | last modifier : $Author: plg $
+// | revision      : $Revision: 2002 $
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+global $prefixeTable;
+
+define('PLUGIN_REGISTER_PUNBB_ID', $prefixeTable.'plugin_register_punbb_id_user');
+?>
Index: /extensions/Register_PunBB/language/en_UK.iso-8859-1/lang.admin.regpunbb.php
===================================================================
--- /extensions/Register_PunBB/language/en_UK.iso-8859-1/lang.admin.regpunbb.php	(revision 7809)
+++ /extensions/Register_PunBB/language/en_UK.iso-8859-1/lang.admin.regpunbb.php	(revision 7809)
@@ -0,0 +1,49 @@
+<?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 |
+// +-----------------------------------------------------------------------+
+//$lang_info['language_name'] = 'English';
+//$lang_info['country'] = ''Great Britain';
+//$lang_info['charset'] = 'iso-8859-1';
+//$lang_info['direction'] = 'ltr';
+//$lang_info['code'] = 'en';
+global $lang;
+$lang['Title'] = 'Register PunnBB';
+$lang['Howto'] = 'This plugin permits to record an user, registering on PWG, in a PunBB forum, automatically. It\'s based on the Mod Register_PunBB achieved by Flipflip that I thank, here, to have initialized the project. Special thanks to Rub (PWG Team) for his precious help.';
+$lang['Install_Disclaimer']='Warning ! After the complete activation of this plugin, all  users administrative manipulations  (manual addition, deletion, modification) for these two scripts (PWG and PunBB) should be achieved through the admin interface of PWG. It\'s counseled to disactivate the registering of PunBB but it is not obligatory. The two scripts can continue to function independently but the users who registers on the forum won\'t have a valid account to reach your gallery. On the contrary, an user who registers on the gallery becomes automatically member of the forum... That\'s the confessed goal of this plugin  ;-)';
+$lang['Update']='Update process';
+$lang['Update_Disclaimer']='<u>Only for those that used the Mod version of this plugin</u>, here are the steps to update :<br/><ol><li>Delete the whole code added to the source of PWG (refer to the Mod installation file)  in order to come back to a situation before application of the Mod.</li><li>Delete the PLUGIN_REGISTER_PUNBB_ID_USER table of the database. This table is created by the installation of the plugin, must be empty and won\'t be used.</li><li>Rename the MOD_REGISTER_PUNBB_ID_USER table in PLUGIN_REGISTER_PUNBB_ID_USER</li><li>Verify, correct and activate the behavior parameters of the plugin => <u>Go to step 1 - DO NOT PROCESS THE STEP 2 MIGRATION FUNCTIONS !</u></li><li>The resynchronisation is optional. It will put back in order table of correspondence.</li></ol>';
+$lang['Install_Disclaimer2']='In a first time, it is necessary to set the working parameters of the plugin with PunBB, then, to copy the  PWG users accounts toward PunBB. A third function is available in order to resynchronize the tables in the case where one addition or user\'s deletion took place badly. But you should not have to use it.<br/><br/>At the end of the 2 main steps, the plugin will be fully functional and you won\'t have to come back on this page anymore.';
+$lang['Step1_Title'] = 'Step 1 : Plugin settings';
+$lang['Step1_Disclaimer'] = 'Verify the parameters according to your PunBB installation and correct them if needed. Modify, if the case arises, the behavior of the plugin to your suitability. Finally, don\'t forget to pass the activation of the plugin to 1 before recording your parameters!';
+$lang['PluginActivation']='Activate or Disactivate the registration in PunBB<br/>
+0 --&gt; Disactivate (no automatic addition of the users in PunBB)<br/>
+1 --&gt; Activate<br/>';
+$lang['Punbb_Prefix']='PunBB tables prefix :';
+$lang['Punbb_Default_Group']='ID of the default group. If you didn\'t make modifications into PunBB, by default, 4 corresponds to the members group :';
+$lang['Punbb_Admin']='Username of the PWG administrator. <b><u>Must be identical to the PunBB adminnistrator username</u></b> :';
+$lang['Punbb_Email_Setting']='Parameter of emails visibility<br/>
+0 --&gt; To display your address e-mail.<br/>
+1 --&gt; Hide your e-mail address but to allow the form e-mail.<br/>
+2 --&gt; Hide your e-mail address and forbid the form e-mail.<br/>';
+$lang['Punbb_Save_Pass']='Parameter to save the password<br/>
+0 --&gt; Do not memorize the username and the password between visits.<br/>
+1 --&gt; Memorize the username and the password between the visits.<br/>';
+$lang['Punbb_Notify_With_Post']='While activating this option, a plain text e-mail will be included in the subscription e-mail.<br/>
+0 --&gt; Disactivate<br/>
+1 --&gt; Activate<br/>';
+$lang['Punbb_Timezone']='Time zone (de -12 à 14) :';
+$lang['Punbb_Language']='Language (French, English) :';
+$lang['Punbb_Style']='Forum style :';
+$lang['Punbb_Del_Pt']='Delete user topics and posts when user is deleted.<br/>
+0 --&gt; Delete all<br/>
+1 --&gt; Do not delete topics and posts<br/>';
+$lang['Step2_Btn']='Migration';
+$lang['Step2_Title']='Step 2 : Migration of the PWG accounts toward PunBB / Re synchronization of the accounts';
+$lang['Step2_Text']='Two cases here : <br/><br/><u>1) You never used the Mod Register_PunBB and even less the same named plugin</u> -> In this case, your PunBB table #_users must be empty of all account. You can then click <b>ONE TIME</b> on "Migration" button. If some mistakes occur during the operation, empty the tables [PunBB] _users and [PWG] _plugin_register_punbb_id_user (via PhpMyAdmin for example), correct the reason of the problem and restart the operation of migration (to that moment only you can click again on the "Migration" button).';
+$lang['Step22_Text']='<b>NEVER RE DO THIS OPERATION MORE THAN ONE TIME</b> !';
+$lang['Step3_Btn']='Resynch';
+$lang['Step3_Text']='<u>2) You already used the Mod / plugin (update of a previous version of PWG toward the present)</u> -> It means that you already have an ID correspondence table  between PWG and PunBB. The script of re synchronization will detect the present data while comparing the names of the users and their e-mail address in the two #_users tables (PWG and PunBB) and will put up to date this table of correspondence. At the end of the operation, please verify the presence of possible duplicated users in PunBB. If it is the case, it is necessary to suppress the oldest (sorting of the PunBB users according to their registration date).<br/><br/>';
+?>
Index: /extensions/Register_PunBB/language/fr_FR.iso-8859-1/lang.admin.regpunbb.php
===================================================================
--- /extensions/Register_PunBB/language/fr_FR.iso-8859-1/lang.admin.regpunbb.php	(revision 7809)
+++ /extensions/Register_PunBB/language/fr_FR.iso-8859-1/lang.admin.regpunbb.php	(revision 7809)
@@ -0,0 +1,49 @@
+<?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 |
+// +-----------------------------------------------------------------------+
+//$lang_info['language_name'] = 'Français';
+//$lang_info['country'] = 'France';
+//$lang_info['charset'] = 'iso-8859-1';
+//$lang_info['direction'] = 'ltr';
+//$lang_info['code'] = 'fr';
+global $lang;
+$lang['Title'] = 'Register PunnBB';
+$lang['Howto'] = 'Ce plugin permet d\'enregistrer automatiquement un utilisateur, s\'inscrivant sur PWG, dans un forum PunBB. Il est basé sur le Mod Register_PunBB réalisé par Flipflip que je remercie, ici, d\'avoir initialisé le projet. Remerciement spécial à Rub (PWG Team) pour son aide précieuse.';
+$lang['Install_Disclaimer']='Attention ! Après l\'activation complète de ce plugin, toutes les manipulations d\'administration des utilisateurs (ajout manuel, suppression, modification) des deux scripts (PWG et PunBB) devront être réalisées à travers l\'interface d\'administration de PWG. Il est conseillé de désactiver l\'inscription de PunBB mais ce n\'est pas obligatoire. Les deux scripts peuvent continuer à fonctionner indépendemment mais les utilisateurs s\'inscivant sur le forum n\'auront pas de compte valide pour accéder à votre galerie. Au contraire, un utilisateur qui s\'inscrit sur la galerie devient automatiquement membre du forum... C\'est le but avoué de ce plugin ;-)';
+$lang['Update']='Procédure pour mise à jour';
+$lang['Update_Disclaimer']='<u>Uniquement pour ceux qui utilisaient la version Mod de ce plugin</u>, voici les étapes pour mettre à jour :<br/><ol><li>Supprimez tout le code ajouté au source de PWG (se reporter au fichier d\'install accompagnant le Mod) afin de revenir à une situation avant application du Mod.</li><li>Supprimez la table PLUGIN_REGISTER_PUNBB_ID_USER de la base de donnée. Cette table est créée par l\'installation du plugin, doit être vide et ne sera pas utilisée.</li><li>Renommez la table MOD_REGISTER_PUNBB_ID_USER en PLUGIN_REGISTER_PUNBB_ID_USER</li><li>Vérifiez, corrigez et activez les paramètres de comportement du plugin => <u>Rendez vous à l\'étape 1 - NE FAITES PAS LA MIGRATION DE l\'ETAPE 2 !</u></li><li>La resynchronisation est optionnelle. Elle remettra à plat la table de correspondance.</li></ol>';
+$lang['Install_Disclaimer2']='Dans un premier temps, il faut configurer les paramètres de fonctionnement du plugin vis à vis de PunBB puis copier les comptes utilisateurs présents dans PWG vers PunBB. Une troisième fonction est disponible afin de resynchroniser les tables dans le cas où un ajout ou une suppression d\'utilisateur s\'est mal déroulée. Mais vous ne devriez pas avoir à l\'utiliser.<br/><br/>A l\'issue des 2 étapes principales, le plugin sera pleinement fonctionnel et vous n\'aurez plus à revenir sur cette page.';
+$lang['Step1_Title'] = 'Etape 1 : Configuration du plugin';
+$lang['Step1_Disclaimer'] = 'Vérifiez les paramètres relatifs à votre installation de PunBB et corrigez les au besoin. Modifiez, le cas échéant, le comportement du plugin à votre convenance. Enfin, n\'oubliez pas de passer l\'activation du plugin à 1 avant d\'enregistrer vos paramètres !';
+$lang['PluginActivation']='Activer ou Désactiver l\'enregistrement dans PunBB<br/>
+0 --&gt; Désactivé (pas d\'ajout automatique des utilisateurs dans PunBB)<br/>
+1 --&gt; Activé<br/>';
+$lang['Punbb_Prefix']='Préfixe des tables de punbb :';
+$lang['Punbb_Default_Group']='ID du group par défaut. Si vous n\'avez pas fait de modifications de PunBB, par défaut, 4 correspond au groupe members :';
+$lang['Punbb_Admin']='Nom d\'utilisateur de l\'administrateur de PWG. <b><u>Doit être identique à celui de PunBB</u></b> :';
+$lang['Punbb_Email_Setting']='Parametre de visibilité des emails<br/>
+0 --&gt; Afficher votre adresse e-mail.<br/>
+1 --&gt; Cacher votre adresse e-mail mais autoriser le formulaire e-mail.<br/>
+2 --&gt; Cacher votre adresse e-mail et interdire le formulaire e-mail.<br/>';
+$lang['Punbb_Save_Pass']='Parametre pour la sauvegarde du mot de passe<br/>
+0 --&gt; Ne pas mémoriser le nom d\'utilisateur et le mot de passe entre les visites.<br/>
+1 --&gt; Mémoriser le nom d\'utilisateur et le mot de passe entre les visites.<br/>';
+$lang['Punbb_Notify_With_Post']='En activant cette option, une version en texte brut du nouveau message sera incluse dans l\'avis d\'abonnement par e-mail.<br/>
+0 --&gt; Désactivé<br/>
+1 --&gt; Activé<br/>';
+$lang['Punbb_Timezone']='Zone de temps (de -12 à 14) :';
+$lang['Punbb_Language']='Langue (French, English) :';
+$lang['Punbb_Style']='Style du forum :';
+$lang['Punbb_Del_Pt']='Suppression des topics et posts de l\'utilisateur lorsqu\'il est supprimé.<br/>
+0 --&gt; Supprimer tout<br/>
+1 --&gt; Ne supprime pas les posts et les topics<br/>';
+$lang['Step2_Btn']='Migration';
+$lang['Step2_Title']='Etape 2 : Migration des comptes PWG vers PunBB / Resynchronisation des comptes';
+$lang['Step2_Text']='Deux cas de figure se présentent ici : <br/><br/><u>1) Vous n\'avez jamais utilisé le Mod Register_PunBB et encore moins le plugin du même nom</u> -> Dans ce cas, votre table #_users de PunBB doit être vide de tout compte. Vous pouvez alors cliquez <b>UNE FOIS</b> sur le bouton "Migration". Si des erreurs se produisent pendant l\'opération, videz les tables [PunBB]_users et [PWG]_plugin_register_punbb_id_user (via PhpMyAdmin par exemple), corrigez la cause du problème et recommencez l\'opération de migration (à ce moment là seulement vous pouvez recliquer sur le bouton "Migration").';
+$lang['Step22_Text']='<b>NE JAMAIS EFFECTUER CETTE OPERATION PLUS D\'UNE FOIS DE SUITE</b> !';
+$lang['Step3_Btn']='Resynch';
+$lang['Step3_Text']='<u>2) Vous avez déjà utilisé le Mod / plugin (mise à jour d\'une version précédentes de PWG vers l\'actuelle)</u> -> Ceci signifie que vous disposez déjà d\'une table de correspondance des Id entre PWG et PunBB. Le script de re synchronisation détectera les données présentes en comparant les noms des utilisateurs et leur adresse email dans les deux tables #_users (PWG et PunBB) et mettra à jour cette table de correspondance. A l\'issue de l\'opération, veuillez vérifier la présence de doublons éventuels dans les utilisateurs de PunBB. Si cela est le cas, il faut supprimer les plus anciens (tri des utilisateurs PunBB selon leur date d\'incription).<br/><br/>';
+?>
Index: /extensions/Register_PunBB/main.inc.php
===================================================================
--- /extensions/Register_PunBB/main.inc.php	(revision 7809)
+++ /extensions/Register_PunBB/main.inc.php	(revision 7809)
@@ -0,0 +1,58 @@
+<?php
+/*
+Plugin Name: Register PunBB
+Version: 1.3a
+Description: Ce plugin permet d'enregistrer automatiquement un utilisateur de PWG dans un forum PunBB. Rendez-vous dans le panneau d'administration du plugin pour finaliser les paramètres - This plugin allows to automatically register a PWG user in a PunBB forum. Go to plugin administration panel to finalize the settings. Based on original Mod by Flipflip.
+Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=126
+Author: Eric
+Author URI: http://www.infernoweb.net
+*/
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+/* ******************* */
+/* Class of the plugin */
+/* ******************* */
+class Register_PunBB
+{
+/* Set the administration panel of the plugin */
+  function plugin_admin_menu($menu)
+  {
+    array_push($menu,
+        array(
+          'NAME' => 'Register PunBB',
+          'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin/reg_punbb_admin.php')
+        )
+      );
+    return $menu;
+  }
+
+/* User adding */
+  function PunBB_Adduser($register_user)
+  {
+  	include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+  	include_once (dirname(__FILE__).'/include/constants.php');
+  	global $conf;
+	load_conf_from_db('param like \'punbb\\_%\'');
+	if ($conf['punbb_status'])
+		include (dirname(__FILE__).'/reg_punbb_adduser.php');
+  }
+
+/* User deletion */
+   function PunBB_Deluser($user_id)
+  {
+  	include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+  	include_once (dirname(__FILE__).'/include/constants.php');
+  	global $conf;
+	load_conf_from_db('param like \'punbb\\_%\'');
+	if ($conf['punbb_status'])
+		include (dirname(__FILE__).'/reg_punbb_deluser.php');
+  }
+}
+
+$obj = new Register_PunBB(); /* class loading */
+
+add_event_handler( 'register_user', array(&$obj, 'PunBB_Adduser') );
+add_event_handler( 'delete_user', array(&$obj, 'PunBB_Deluser') );
+add_event_handler('get_admin_plugin_menu_links', array(&$obj, 'plugin_admin_menu') );
+set_plugin_data($plugin['id'], $obj);
+?>
Index: /extensions/Register_PunBB/maintain.inc.php
===================================================================
--- /extensions/Register_PunBB/maintain.inc.php	(revision 7809)
+++ /extensions/Register_PunBB/maintain.inc.php	(revision 7809)
@@ -0,0 +1,173 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Plugin Name : Register_PunBB                                          |
+// | Plugin Version : 1.3a                                                 |
+// | File Version : 0.3                                                    |
+// | Plugin Version author : Eric <lucifer@infernoweb.net>                 |
+// | Plugin description :                                                  |
+// | Ce plugin permet l'enregistrement d'un utilisateur directement dans   |
+// | PunBB (http://www.punbb.org) - This plugin allows to automatically    |
+// | register a PWG user in a PunBB forum (http://www.punbb.org)           |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// ******************************************
+// ** Database install - uninstall queries **
+// ******************************************
+
+  define('REGISTER_PUNBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+  include_once(REGISTER_PUNBB_PATH.'include/constants.php');
+
+function plugin_install()
+{
+	$q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+	VALUES
+	("punbb_status","0","Activation of Register_PunBB plugin");';
+
+  pwg_query($q);
+
+	$q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+	VALUES
+	("punbb_prefix","forum_","Préfixe des tables de punbb");';
+
+  pwg_query($q);
+
+	$q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+	VALUES
+	("punbb_id_default_group","4","ID du groupe par défaut dans PunBB");';
+
+  pwg_query($q);
+
+	$q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+	VALUES
+	("punbb_admin","admin","Nom d\'utilisateur de l\'administrateur de PWG. Doit être identique à celui de PunBB");';
+
+  pwg_query($q);
+
+	$q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+	VALUES
+	("punbb_email_setting","1","Parametre de visibilité des emails");';
+
+  pwg_query($q);
+
+	$q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+	VALUES
+	("punbb_save_pass","0","Parametre pour la sauvegarde du mot de passe");';
+
+  pwg_query($q);
+
+	$q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+	VALUES
+	("punbb_notify_with_post","1","En activant cette option, une version en texte brut du nouveau message sera incluse dans l\'avis d\abonnement par e-mail");';
+
+  pwg_query($q);
+
+	$q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+	VALUES
+	("punbb_timezone","1","Zone de temps");';
+
+  pwg_query($q);
+
+	$q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+	VALUES
+	("punbb_language","English","Parametre de langue");';
+
+  pwg_query($q);
+
+	$q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+	VALUES
+	("punbb_style","Cobalt","Style du forum");';
+
+  pwg_query($q);
+
+	$q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+	VALUES
+	("punbb_del_pt","1","Suppression des topics et post de l\'utilisateur");';
+
+  pwg_query($q);
+
+	$q = '
+CREATE TABLE IF NOT EXISTS '.PLUGIN_REGISTER_PUNBB_ID.' (
+  id_user_pwg smallint(5) NOT NULL default "0",
+  id_user_punbb int(10) NOT NULL default "0",
+  KEY id_user_pwg (id_user_pwg,id_user_punbb));';
+
+  pwg_query($q);
+}
+
+
+function plugin_uninstall()
+{
+  $q = '
+DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_status" LIMIT 1;';
+  pwg_query( $q );
+
+  $q = '
+DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_prefix" LIMIT 1;';
+  pwg_query( $q );
+
+  $q = '
+DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_id_default_group" LIMIT 1;';
+  pwg_query( $q );
+
+  $q = '
+DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_admin" LIMIT 1;';
+  pwg_query( $q );
+
+  $q = '
+DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_email_setting" LIMIT 1;';
+  pwg_query( $q );
+
+  $q = '
+DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_save_pass" LIMIT 1;';
+  pwg_query( $q );
+
+  $q = '
+DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_notify_with_post" LIMIT 1;';
+  pwg_query( $q );
+
+  $q = '
+DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_timezone" LIMIT 1;';
+  pwg_query( $q );
+
+  $q = '
+DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_language" LIMIT 1;';
+  pwg_query( $q );
+
+  $q = '
+DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_style" LIMIT 1;';
+  pwg_query( $q );
+
+  $q = '
+DELETE FROM '.CONFIG_TABLE.' WHERE param="punbb_del_pt" LIMIT 1;';
+  pwg_query( $q );
+
+  $q = 'DROP TABLE '.PLUGIN_REGISTER_PUNBB_ID.';';
+  pwg_query( $q );
+}
+
+?>
Index: /extensions/Register_PunBB/reg_punbb_adduser.php
===================================================================
--- /extensions/Register_PunBB/reg_punbb_adduser.php	(revision 7809)
+++ /extensions/Register_PunBB/reg_punbb_adduser.php	(revision 7809)
@@ -0,0 +1,86 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Plugin Name : Register_PunBB                                          |
+// | Plugin Version : 1.3a                                                 |
+// | File Version : 0.3                                                    |
+// | Plugin Version author : Eric <lucifer@infernoweb.net>                 |
+// | Plugin description :                                                  |
+// | Ce plugin permet l'enregistrement d'un utilisateur directement dans   |
+// | PunBB (http://www.punbb.org) - This plugin allows to automatically    |
+// | register a PWG user in a PunBB forum (http://www.punbb.org)           |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// *****************************************
+// ** Add user to the PunBB #_users table **
+// *****************************************
+
+// Load Plugin settings from database
+load_conf_from_db('param like \'punbb\\_%\'');
+
+global $conf;
+
+// Password hashing method
+if (function_exists('sha1'))	// Only in PHP 4.3.0+
+	{
+    	$password = sha1($_POST['password']);
+	}
+else if (function_exists('mhash'))	// Only if Mhash library is loaded
+	{
+    	$password =  bin2hex(mhash(MHASH_SHA1, $_POST['password']));
+	}
+else
+	{
+    	$password =  md5($_POST['password']);
+	}
+
+
+$registred = time();
+$registred_ip = $_SERVER['REMOTE_ADDR'];
+// Check wich email var is used
+if (defined('IN_ADMIN') and IN_ADMIN) /* This is for adding a user in admin panel */
+	{
+		$mail = $_POST['email'];
+		$query = "
+        	INSERT INTO ".$conf['punbb_prefix']."users (username, group_id, password, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit)
+        	VALUES('".$_POST['login']."', '".$conf['punbb_id_default_group']."', 
+        	'".$password."', '".$mail."', '".$conf['punbb_email_setting']."', 
+        	'".$conf['punbb_save_pass']."', '".$conf['punbb_timezone']."', '".$conf['punbb_language']."', 
+        	'".$conf['punbb_style']."','".$registred."', '".$registred_ip."', '".$registred."');";
+		$result = pwg_query($query);
+	}
+else /* This is when a user registered himself with the register form */
+	{
+		$query = "
+        	INSERT INTO ".$conf['punbb_prefix']."users (username, group_id, password, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit)
+        	VALUES('".$_POST['login']."', '".$conf['punbb_id_default_group']."', 
+        	'".$password."', '".$_POST['mail_address']."', '".$conf['punbb_email_setting']."', 
+        	'".$conf['punbb_save_pass']."', '".$conf['punbb_timezone']."', '".$conf['punbb_language']."', 
+        	'".$conf['punbb_style']."','".$registred."', '".$registred_ip."', '".$registred."');";
+		$result = pwg_query($query);
+	}
+// Retrieve user ID in PunBB user table
+$id_user_punbb = mysql_insert_id();
+
+// Retrieve user ID in PWG user table
+$user_id_pwg = get_userid($_POST['login']);
+
+// Insertion of the ID in the pwg/punbb correspondence table
+$query = "
+        INSERT INTO ".PLUGIN_REGISTER_PUNBB_ID." (id_user_pwg, id_user_punbb)
+        VALUES('".$user_id_pwg."', '".$id_user_punbb."');";
+$result = pwg_query($query);
+?>
Index: /extensions/Register_PunBB/reg_punbb_deluser.php
===================================================================
--- /extensions/Register_PunBB/reg_punbb_deluser.php	(revision 7809)
+++ /extensions/Register_PunBB/reg_punbb_deluser.php	(revision 7809)
@@ -0,0 +1,93 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Plugin Name : Register_PunBB                                          |
+// | Plugin Version : 1.3a                                                 |
+// | File Version : 0.2                                                    |
+// | Plugin Version author : Eric <lucifer@infernoweb.net>                 |
+// | Plugin description :                                                  |
+// | Ce plugin permet l'enregistrement d'un utilisateur directement dans   |
+// | PunBB (http://www.punbb.org) - This plugin allows to automatically    |
+// | register a PWG user in a PunBB forum (http://www.punbb.org)           |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// ********************************************
+// ** Delete user from the PunBB users table **
+// ********************************************
+
+// Load Plugin settings from database
+load_conf_from_db('param like \'punbb\\_%\'');
+
+global $conf;
+
+// ID selection in the pwg/punbb correspondence table
+$query = "
+        SELECT id_user_punbb, id_user_pwg FROM ".PLUGIN_REGISTER_PUNBB_ID."
+        WHERE id_user_pwg = ".$user_id.";
+    ";
+$result = pwg_query($query);
+
+while($data = mysql_fetch_array($result))
+{
+    // If equal to 0 then all posts and topics from deleted user will be deleted too
+    if ($conf['punbb_del_pt'] == 0)
+    {
+        // Deletion of user's posts
+        $query_1 = "
+                DELETE FROM ".$conf['punbb_prefix']."posts
+                WHERE poster_id = ".$data['id_user_punbb'].";
+            ";
+        $result_1 = pwg_query($query_1);
+
+        // Username selection
+        $query_2 = "
+                SELECT username FROM ".USERS_TABLE."
+                WHERE id = ".$data['id_user_pwg'].";
+            ";
+        $result_2 = pwg_query($query_2);
+        while ($data_1 = mysql_fetch_array($result_2))
+        {
+            // Deletion of user's topics
+            $query_3 = "
+                    DELETE FROM ".$conf['punbb_prefix']."topics
+                    WHERE poster = '".$data_1['username']."';
+                ";
+            $result_3 = pwg_query($query_3);
+        }
+    }
+
+    // Deletion of user's subscriptions
+    $query_4 = "
+            DELETE FROM ".$conf['punbb_prefix']."subscriptions
+            WHERE user_id = ".$data['id_user_punbb'].";
+        ";
+    $result_4 = pwg_query($query_4);
+
+    // Deletion of user's account
+    $query_5 = "
+            DELETE FROM ".$conf['punbb_prefix']."users
+            WHERE id = ".$data['id_user_punbb'].";
+        ";
+    $result_5 = pwg_query($query_5);
+
+    // Deletion of user's correspondence in pwg/punbb correspondence table
+    $query_6 = "
+            DELETE FROM ".PLUGIN_REGISTER_PUNBB_ID."
+            WHERE id_user_pwg = ".$user_id.";
+        ";
+    $result_6 = pwg_query($query_6);
+}
+?>
Index: /extensions/Register_PunBB/reg_punbb_migration.php
===================================================================
--- /extensions/Register_PunBB/reg_punbb_migration.php	(revision 7809)
+++ /extensions/Register_PunBB/reg_punbb_migration.php	(revision 7809)
@@ -0,0 +1,71 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Plugin Name : Register_PunBB                                          |
+// | Plugin Version : 1.3a                                                 |
+// | File Version : 0.2                                                    |
+// | Plugin Version author : Eric <lucifer@infernoweb.net>                 |
+// | Plugin description :                                                  |
+// | Ce plugin permet l'enregistrement d'un utilisateur directement dans   |
+// | PunBB (http://www.punbb.org) - This plugin allows to automatically    |
+// | register a PWG user in a PunBB forum (http://www.punbb.org)           |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// **************************************
+// ** User migration from PWG to PunBB **
+// **************************************
+
+include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
+
+echo '<h2>Migration des comptes PhpWebGallery vers PunBB</h2>';
+
+// Select of PWG users
+$query = 'SELECT username, password, mail_address FROM '.USERS_TABLE.';';
+$result = pwg_query($query);
+
+$registred = time();
+$registred_ip = '127.0.0.1';
+
+while ($row = mysql_fetch_array($result))
+{
+    if(($row['username'] != 'guest') AND ($row['username'] != $conf['punbb_admin']))
+    {
+        echo '<b>Transfert du compte :</b> '.$row['username'].' --> ';
+        $query_1 = "
+            INSERT INTO ".$conf['punbb_prefix']."users (username, group_id, password, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit)
+            VALUES('".$row['username']."', '".$conf['punbb_id_default_group']."',
+            '".$row['password']."', '".$row['mail_address']."', '".$conf['punbb_email_setting']."',
+            '".$conf['punbb_save_pass']."', '".$conf['punbb_timezone']."', '".$conf['punbb_language']."',
+            '".$conf['punbb_style']."','".$registred."', '".$registred_ip."', '".$registred."');";
+        $result_1 = pwg_query($query_1);
+
+        // Get PunBB user Id
+        $id_user_punbb = mysql_insert_id();
+
+        // Get PWG user Id
+        $user_id_pwg = get_userid($row['username']);
+
+        // Insert of PWG user id and PunBB user id on correspondence table
+        $query_2 = "
+                INSERT INTO ".PLUGIN_REGISTER_PUNBB_ID." (id_user_pwg, id_user_punbb)
+                VALUES('".$user_id_pwg."', '".$id_user_punbb."');";
+        $result_2 = pwg_query($query_2);
+        echo '<b>Migration done !</b><br>';
+    }
+}
+
+//TODO: Get the migration result into a template
+?>
Index: /extensions/Register_PunBB/reg_punbb_synchro.php
===================================================================
--- /extensions/Register_PunBB/reg_punbb_synchro.php	(revision 7809)
+++ /extensions/Register_PunBB/reg_punbb_synchro.php	(revision 7809)
@@ -0,0 +1,66 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Plugin Name : Register_PunBB                                          |
+// | Plugin Version : 1.3a                                                 |
+// | File Version : 0.2                                                    |
+// | Plugin Version author : Eric <lucifer@infernoweb.net>                 |
+// | Plugin description :                                                  |
+// | Ce plugin permet l'enregistrement d'un utilisateur directement dans   |
+// | PunBB (http://www.punbb.org) - This plugin allows to automatically    |
+// | register a PWG user in a PunBB forum (http://www.punbb.org)           |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// *********************************************
+// ** Correspondence table re synchronization **
+// *********************************************
+
+include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
+
+// Empty the ids from table
+$query_1 = "TRUNCATE ".PLUGIN_REGISTER_PUNBB_ID.";";
+$result_1 = pwg_query($query_1);
+
+// Selection of all PWG accounts
+$query = "
+        SELECT id AS id_pwg, username
+		FROM ".USERS_TABLE.";
+	";
+$result = pwg_query($query);
+
+while($data = mysql_fetch_array($result))
+{
+    // Selection of PunBB user's id in relation with PWG user's id
+    $query_2 = "
+            SELECT id AS id_punbb
+			FROM ".$conf['punbb_prefix']."users
+			WHERE username = '".$data['username']."';
+		";
+    $result_2 = pwg_query($query_2);
+
+    while($data_1 = mysql_fetch_array($result_2))
+    {
+        // Insert PWG id and PunBB id in correspondence table
+        $query_3 = "
+                INSERT INTO ".PLUGIN_REGISTER_PUNBB_ID." (id_user_pwg, id_user_punbb)
+                VALUES (".$data['id_pwg'].", ".$data_1['id_punbb'].");";
+        $result_3 = pwg_query($query_3);
+    }
+}
+echo 'Re synchronization done !';
+
+//TODO: Get re synchro result into a template
+?>
Index: /extensions/Register_PunBB/reg_punbb_update_profile.php
===================================================================
--- /extensions/Register_PunBB/reg_punbb_update_profile.php	(revision 7809)
+++ /extensions/Register_PunBB/reg_punbb_update_profile.php	(revision 7809)
@@ -0,0 +1,67 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Plugin Name : Register_PunBB                                          |
+// | Plugin Version : 1.3a                                                 |
+// | File Version : 0.2                                                    |
+// | Plugin Version author : Eric <lucifer@infernoweb.net>                 |
+// | Plugin description :                                                  |
+// | Ce plugin permet l'enregistrement d'un utilisateur directement dans   |
+// | PunBB (http://www.punbb.org) - This plugin allows to automatically    |
+// | register a PWG user in a PunBB forum (http://www.punbb.org)           |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Password hashing method
+if (function_exists('sha1'))	// Only in PHP 4.3.0+
+{
+    $password = sha1($_POST['use_new_pwd']);
+}
+else if (function_exists('mhash'))	// Only if Mhash library is loaded
+{
+    $password =  bin2hex(mhash(MHASH_SHA1, $_POST['use_new_pwd']));
+}
+else
+{
+    $password =  md5($_POST['use_new_pwd']);
+}
+
+// Retrieve user ID in PunBB user table
+$query = '
+        SELECT id_user_punbb
+        FROM '.PLUGIN_REGISTER_PUNBB_ID
+        .' WHERE id_user_pwg = '.$userdata['id'].';
+    ';
+$result = pwg_query($query);
+
+while($row = mysql_fetch_array($result))
+{
+    // Email modification
+    $query = '
+            UPDATE '.$conf['punbb_prefix'].'users 
+            SET email = \''.$_POST['mail_address'].'\'';
+
+            // If new password field is empty
+            // the change is set in the PunBB
+            // users table with password hashing.
+            if (!empty($_POST['use_new_pwd']))
+            {
+                $query.= ', password = \''.$password.'\'';
+            }
+            $query.= ' WHERE id = '.$row['id_user_punbb'].';
+        ';
+    $result = pwg_query($query);
+}
+?>
