Index: extensions/Register_FluxBB/index.php
===================================================================
--- extensions/Register_FluxBB/index.php	(revision 3351)
+++ 	(revision )
@@ -1,33 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | PhpWebGallery - a PHP based picture gallery                           |
-// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
-// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
-// +-----------------------------------------------------------------------+
-// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
-// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
-// | last modifier : $Author: rub $
-// | revision      : $Revision: 1912 $
-// +-----------------------------------------------------------------------+
-// | This program is free software; you can redistribute it and/or modify  |
-// | it under the terms of the GNU General Public License as published by  |
-// | the Free Software Foundation                                          |
-// |                                                                       |
-// | This program is distributed in the hope that it will be useful, but   |
-// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
-// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
-// | General Public License for more details.                              |
-// |                                                                       |
-// | You should have received a copy of the GNU General Public License     |
-// | along with this program; if not, write to the Free Software           |
-// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
-// | USA.                                                                  |
-// +-----------------------------------------------------------------------+
-
-// Recursive call
-$url = '../';
-header( 'Request-URI: '.$url );
-header( 'Content-Location: '.$url );
-header( 'Location: '.$url );
-exit();
-?>
Index: extensions/Register_FluxBB/main.inc.php
===================================================================
--- extensions/Register_FluxBB/main.inc.php	(revision 3351)
+++ 	(revision )
@@ -1,179 +1,0 @@
-<?php
-/*
-Plugin Name: Register FluxBB
-Version: 2.1.1
-Description: Link user registration from Piwigo to FluxBB forum (registration, password changing, deletion) - Original Nicco's NBC_LinkUser2PunBB plugin upgraded to Piwigo / Liez l'inscription des utilisateurs de Piwigo avec votre forum FluxBB - Portage du plugin NBC_LinkUser2PunBB de Nicco vers Piwigo
-Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=252
-Author: Eric
-Author URI: http://www.infernoweb.net
-*/
-
-/*
---------------------------------------------------------------------------------
-  Author     : Eric
-    email    : lucifer@infernoweb.net
-    website  : http://www.infernoweb.net
-    PWG user : http://forum.phpwebgallery.net/profile.php?id=1106
---------------------------------------------------------------------------------
-
-:: HISTORY
-
-2.0.0b			- 23/11/08  - Initial release. Basic changes to be available for Piwigo 2.0RC4
-
-2.0.1b 			- 24/11/08  - Small bug correction on submit button display
-
-2.0.2			- 19/02/09	- Language pack correction
-
-2.1.0			- 25/04/09  - Admin panel with tabsheets
-							- Radio buttons functionnalities corrections (now radio buttons show the configuration saved in database)
-							- Language files (fr - en) improvement
-
-2.1.1			- 30/04/09	- Bux fixed on profile update
-
---------------------------------------------------------------------------------
-*/
-
-// pour faciliter le debug - make debug easier :o)
-//ini_set('error_reporting', E_ALL);
-//ini_set('display_errors', true);
-
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-
-define('Register_FluxBB_DIR' , basename(dirname(__FILE__)));
-define('Register_FluxBB_PATH' , PHPWG_PLUGINS_PATH . Register_FluxBB_DIR . '/');
-include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
-
-/* plugin administration */
-add_event_handler('get_admin_plugin_menu_links', 'Register_FluxBB_admin_menu');
-
-function Register_FluxBB_admin_menu($menu)
-{
-  array_push($menu, array(
-      'NAME' => 'Register FluxBB',
-      'URL'  => get_admin_plugin_menu_link(Register_FluxBB_PATH.'admin/Register_FluxBB_admin.php')));
-      return $menu;
-}
-
-
-/* user creation*/
-add_event_handler('register_user', 'Register_FluxBB_Adduser');
-
-function Register_FluxBB_Adduser($register_user)
-{
-	global $conf;
-	
-  include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
-
-  FluxBB_Adduser($register_user['id'], $register_user['username'], $conf['pass_convert']($_POST['password']), $register_user['email']);
-}
-
-
-/* user deletion */
-add_event_handler('delete_user', 'Register_FluxBB_Deluser');
-
-function Register_FluxBB_Deluser($user_id)
-{
-	include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
-
-  FluxBB_Deluser( FluxBB_Searchuser($user_id), true );
-}
-
-
-
-add_event_handler('init', 'Register_FluxBB_InitPage');
- 
-function Register_FluxBB_InitPage()
-{
-  global $conf, $user ;
-  include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
-
-/* user update */
-  if (script_basename() == 'profile')
-  {
-    if (isset($_POST['validate']))
-    {
-      $errors = array();
-
-      $int_pattern = '/^\d+$/';
-      if (empty($_POST['nb_image_line'])
-          or (!preg_match($int_pattern, $_POST['nb_image_line'])))
-      {
-        $errors[] = l10n('nb_image_line_error');
-      }
-    
-      if (empty($_POST['nb_line_page'])
-          or (!preg_match($int_pattern, $_POST['nb_line_page'])))
-      {
-        $errors[] = l10n('nb_line_page_error');
-      }
-    
-      if ($_POST['maxwidth'] != ''
-          and (!preg_match($int_pattern, $_POST['maxwidth'])
-               or $_POST['maxwidth'] < 50))
-      {
-        $errors[] = l10n('maxwidth_error');
-      }
-      if ($_POST['maxheight']
-           and (!preg_match($int_pattern, $_POST['maxheight'])
-                 or $_POST['maxheight'] < 50))
-      {
-        $errors[] = l10n('maxheight_error');
-      }
-      // periods must be integer values, they represents number of days
-      if (!preg_match($int_pattern, $_POST['recent_period'])
-          or $_POST['recent_period'] <= 0)
-      {
-        $errors[] = l10n('periods_error') ;
-      }
-    
-      if (isset($_POST['mail_address']))
-      {
-        $mail_error = validate_mail_address($user['id'],$_POST['mail_address']);
-        if (!empty($mail_error))
-        {
-          $errors[] = $mail_error;
-        }
-      }
-    
-      if (!empty($_POST['use_new_pwd']))
-      {
-        // password must be the same as its confirmation
-        if ($_POST['use_new_pwd'] != $_POST['passwordConf'])
-        {
-          $errors[] = l10n('New password confirmation does not correspond');
-        }
-    
-        if ( !defined('IN_ADMIN') )
-        {// changing password requires old password
-          $query = '
-            SELECT '.$conf['user_fields']['password'].' AS password
-            FROM '.USERS_TABLE.'
-            WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
-          ;';
-          list($current_password) = mysql_fetch_row(pwg_query($query));
-      
-          if ($conf['pass_convert']($_POST['password']) != $current_password)
-          {
-            $errors[] = l10n('Current password is wrong');
-          }
-        }
-      }
-    
-      if (count($errors) == 0)
-      {
-      	include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
-      
-        $query = '
-          SELECT '.$conf['user_fields']['username'].' AS username
-          FROM '.USERS_TABLE.'
-          WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
-        ;';
-        list($username) = mysql_fetch_row(pwg_query($query));
-
-        FluxBB_Updateuser($user['id'], $username, $conf['pass_convert']($_POST['use_new_pwd']), $_POST['mail_address']);
-      }
-    }
-  }
-}
-
-?>
Index: extensions/Register_FluxBB/maintain.inc.php
===================================================================
--- extensions/Register_FluxBB/maintain.inc.php	(revision 3351)
+++ 	(revision )
@@ -1,62 +1,0 @@
-<?php
-
-define('Register_FluxBB_DIR' , basename(dirname(__FILE__)));
-define('Register_FluxBB_PATH' , PHPWG_PLUGINS_PATH . Register_FluxBB_DIR . '/');
-
-//ini_set('error_reporting', E_ALL);
-//ini_set('display_errors', true);
-
-include_once (PHPWG_ROOT_PATH.'/include/constants.php');
-include_once (Register_FluxBB_PATH.'include/constants.php');
-
-
-
-function plugin_install()
-{
-  global $prefixeTable;
-
-  $q = '
-    INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
-    VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true","Parametres Register_FluxBB")
-  ;';
-    
-  pwg_query($q);
-  
-	$q = "
-    CREATE TABLE IF NOT EXISTS ".Register_FluxBB_ID_TABLE." (
-      id_user_pwg smallint(5) NOT NULL default '0',
-      id_user_FluxBB int(10) NOT NULL default '0',
-      PRIMARY KEY  (id_user_pwg),
-      KEY id_user_pwg (id_user_pwg, id_user_FluxBB)
-    )
-  ;";
-
-  pwg_query($q);
-
-}
-
-function plugin_activate()
-{
-
-}
-
-function plugin_uninstall()
-{
-  global $conf;
-
-  if (isset($conf['Register_FluxBB']))
-  {
-    $q = '
-      DELETE FROM '.CONFIG_TABLE.'
-      WHERE param="Register_FluxBB" LIMIT 1
-    ;';
-
-    pwg_query($q);
-  }
-  
-  $q = 'DROP TABLE '.Register_FluxBB_ID_TABLE.';';
-  pwg_query( $q );
-
-}
-
-?>
Index: extensions/Register_FluxBB/tags/2.1.1/index.php
===================================================================
--- extensions/Register_FluxBB/tags/2.1.1/index.php	(revision 3738)
+++ extensions/Register_FluxBB/tags/2.1.1/index.php	(revision 3738)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/Register_FluxBB/tags/2.1.1/main.inc.php
===================================================================
--- extensions/Register_FluxBB/tags/2.1.1/main.inc.php	(revision 3738)
+++ extensions/Register_FluxBB/tags/2.1.1/main.inc.php	(revision 3738)
@@ -0,0 +1,179 @@
+<?php
+/*
+Plugin Name: Register FluxBB
+Version: 2.1.1
+Description: Link user registration from Piwigo to FluxBB forum (registration, password changing, deletion) - Original Nicco's NBC_LinkUser2PunBB plugin upgraded to Piwigo / Liez l'inscription des utilisateurs de Piwigo avec votre forum FluxBB - Portage du plugin NBC_LinkUser2PunBB de Nicco vers Piwigo
+Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=252
+Author: Eric
+Author URI: http://www.infernoweb.net
+*/
+
+/*
+--------------------------------------------------------------------------------
+  Author     : Eric
+    email    : lucifer@infernoweb.net
+    website  : http://www.infernoweb.net
+    PWG user : http://forum.phpwebgallery.net/profile.php?id=1106
+--------------------------------------------------------------------------------
+
+:: HISTORY
+
+2.0.0b			- 23/11/08  - Initial release. Basic changes to be available for Piwigo 2.0RC4
+
+2.0.1b 			- 24/11/08  - Small bug correction on submit button display
+
+2.0.2			- 19/02/09	- Language pack correction
+
+2.1.0			- 25/04/09  - Admin panel with tabsheets
+							- Radio buttons functionnalities corrections (now radio buttons show the configuration saved in database)
+							- Language files (fr - en) improvement
+
+2.1.1			- 30/04/09	- Bux fixed on profile update
+
+--------------------------------------------------------------------------------
+*/
+
+// pour faciliter le debug - make debug easier :o)
+//ini_set('error_reporting', E_ALL);
+//ini_set('display_errors', true);
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+define('Register_FluxBB_DIR' , basename(dirname(__FILE__)));
+define('Register_FluxBB_PATH' , PHPWG_PLUGINS_PATH . Register_FluxBB_DIR . '/');
+include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+
+/* plugin administration */
+add_event_handler('get_admin_plugin_menu_links', 'Register_FluxBB_admin_menu');
+
+function Register_FluxBB_admin_menu($menu)
+{
+  array_push($menu, array(
+      'NAME' => 'Register FluxBB',
+      'URL'  => get_admin_plugin_menu_link(Register_FluxBB_PATH.'admin/Register_FluxBB_admin.php')));
+      return $menu;
+}
+
+
+/* user creation*/
+add_event_handler('register_user', 'Register_FluxBB_Adduser');
+
+function Register_FluxBB_Adduser($register_user)
+{
+	global $conf;
+	
+  include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+
+  FluxBB_Adduser($register_user['id'], $register_user['username'], $conf['pass_convert']($_POST['password']), $register_user['email']);
+}
+
+
+/* user deletion */
+add_event_handler('delete_user', 'Register_FluxBB_Deluser');
+
+function Register_FluxBB_Deluser($user_id)
+{
+	include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+
+  FluxBB_Deluser( FluxBB_Searchuser($user_id), true );
+}
+
+
+
+add_event_handler('init', 'Register_FluxBB_InitPage');
+ 
+function Register_FluxBB_InitPage()
+{
+  global $conf, $user ;
+  include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+
+/* user update */
+  if (script_basename() == 'profile')
+  {
+    if (isset($_POST['validate']))
+    {
+      $errors = array();
+
+      $int_pattern = '/^\d+$/';
+      if (empty($_POST['nb_image_line'])
+          or (!preg_match($int_pattern, $_POST['nb_image_line'])))
+      {
+        $errors[] = l10n('nb_image_line_error');
+      }
+    
+      if (empty($_POST['nb_line_page'])
+          or (!preg_match($int_pattern, $_POST['nb_line_page'])))
+      {
+        $errors[] = l10n('nb_line_page_error');
+      }
+    
+      if ($_POST['maxwidth'] != ''
+          and (!preg_match($int_pattern, $_POST['maxwidth'])
+               or $_POST['maxwidth'] < 50))
+      {
+        $errors[] = l10n('maxwidth_error');
+      }
+      if ($_POST['maxheight']
+           and (!preg_match($int_pattern, $_POST['maxheight'])
+                 or $_POST['maxheight'] < 50))
+      {
+        $errors[] = l10n('maxheight_error');
+      }
+      // periods must be integer values, they represents number of days
+      if (!preg_match($int_pattern, $_POST['recent_period'])
+          or $_POST['recent_period'] <= 0)
+      {
+        $errors[] = l10n('periods_error') ;
+      }
+    
+      if (isset($_POST['mail_address']))
+      {
+        $mail_error = validate_mail_address($user['id'],$_POST['mail_address']);
+        if (!empty($mail_error))
+        {
+          $errors[] = $mail_error;
+        }
+      }
+    
+      if (!empty($_POST['use_new_pwd']))
+      {
+        // password must be the same as its confirmation
+        if ($_POST['use_new_pwd'] != $_POST['passwordConf'])
+        {
+          $errors[] = l10n('New password confirmation does not correspond');
+        }
+    
+        if ( !defined('IN_ADMIN') )
+        {// changing password requires old password
+          $query = '
+            SELECT '.$conf['user_fields']['password'].' AS password
+            FROM '.USERS_TABLE.'
+            WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+          ;';
+          list($current_password) = mysql_fetch_row(pwg_query($query));
+      
+          if ($conf['pass_convert']($_POST['password']) != $current_password)
+          {
+            $errors[] = l10n('Current password is wrong');
+          }
+        }
+      }
+    
+      if (count($errors) == 0)
+      {
+      	include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+      
+        $query = '
+          SELECT '.$conf['user_fields']['username'].' AS username
+          FROM '.USERS_TABLE.'
+          WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+        ;';
+        list($username) = mysql_fetch_row(pwg_query($query));
+
+        FluxBB_Updateuser($user['id'], $username, $conf['pass_convert']($_POST['use_new_pwd']), $_POST['mail_address']);
+      }
+    }
+  }
+}
+
+?>
Index: extensions/Register_FluxBB/tags/2.1.1/maintain.inc.php
===================================================================
--- extensions/Register_FluxBB/tags/2.1.1/maintain.inc.php	(revision 3738)
+++ extensions/Register_FluxBB/tags/2.1.1/maintain.inc.php	(revision 3738)
@@ -0,0 +1,62 @@
+<?php
+
+define('Register_FluxBB_DIR' , basename(dirname(__FILE__)));
+define('Register_FluxBB_PATH' , PHPWG_PLUGINS_PATH . Register_FluxBB_DIR . '/');
+
+//ini_set('error_reporting', E_ALL);
+//ini_set('display_errors', true);
+
+include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+include_once (Register_FluxBB_PATH.'include/constants.php');
+
+
+
+function plugin_install()
+{
+  global $prefixeTable;
+
+  $q = '
+    INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+    VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true","Parametres Register_FluxBB")
+  ;';
+    
+  pwg_query($q);
+  
+	$q = "
+    CREATE TABLE IF NOT EXISTS ".Register_FluxBB_ID_TABLE." (
+      id_user_pwg smallint(5) NOT NULL default '0',
+      id_user_FluxBB int(10) NOT NULL default '0',
+      PRIMARY KEY  (id_user_pwg),
+      KEY id_user_pwg (id_user_pwg, id_user_FluxBB)
+    )
+  ;";
+
+  pwg_query($q);
+
+}
+
+function plugin_activate()
+{
+
+}
+
+function plugin_uninstall()
+{
+  global $conf;
+
+  if (isset($conf['Register_FluxBB']))
+  {
+    $q = '
+      DELETE FROM '.CONFIG_TABLE.'
+      WHERE param="Register_FluxBB" LIMIT 1
+    ;';
+
+    pwg_query($q);
+  }
+  
+  $q = 'DROP TABLE '.Register_FluxBB_ID_TABLE.';';
+  pwg_query( $q );
+
+}
+
+?>
Index: extensions/Register_FluxBB/trunk/index.php
===================================================================
--- extensions/Register_FluxBB/trunk/index.php	(revision 3738)
+++ extensions/Register_FluxBB/trunk/index.php	(revision 3738)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: extensions/Register_FluxBB/trunk/main.inc.php
===================================================================
--- extensions/Register_FluxBB/trunk/main.inc.php	(revision 3738)
+++ extensions/Register_FluxBB/trunk/main.inc.php	(revision 3738)
@@ -0,0 +1,179 @@
+<?php
+/*
+Plugin Name: Register FluxBB
+Version: 2.1.1
+Description: Link user registration from Piwigo to FluxBB forum (registration, password changing, deletion) - Original Nicco's NBC_LinkUser2PunBB plugin upgraded to Piwigo / Liez l'inscription des utilisateurs de Piwigo avec votre forum FluxBB - Portage du plugin NBC_LinkUser2PunBB de Nicco vers Piwigo
+Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=252
+Author: Eric
+Author URI: http://www.infernoweb.net
+*/
+
+/*
+--------------------------------------------------------------------------------
+  Author     : Eric
+    email    : lucifer@infernoweb.net
+    website  : http://www.infernoweb.net
+    PWG user : http://forum.phpwebgallery.net/profile.php?id=1106
+--------------------------------------------------------------------------------
+
+:: HISTORY
+
+2.0.0b			- 23/11/08  - Initial release. Basic changes to be available for Piwigo 2.0RC4
+
+2.0.1b 			- 24/11/08  - Small bug correction on submit button display
+
+2.0.2			- 19/02/09	- Language pack correction
+
+2.1.0			- 25/04/09  - Admin panel with tabsheets
+							- Radio buttons functionnalities corrections (now radio buttons show the configuration saved in database)
+							- Language files (fr - en) improvement
+
+2.1.1			- 30/04/09	- Bux fixed on profile update
+
+--------------------------------------------------------------------------------
+*/
+
+// pour faciliter le debug - make debug easier :o)
+//ini_set('error_reporting', E_ALL);
+//ini_set('display_errors', true);
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+define('Register_FluxBB_DIR' , basename(dirname(__FILE__)));
+define('Register_FluxBB_PATH' , PHPWG_PLUGINS_PATH . Register_FluxBB_DIR . '/');
+include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+
+/* plugin administration */
+add_event_handler('get_admin_plugin_menu_links', 'Register_FluxBB_admin_menu');
+
+function Register_FluxBB_admin_menu($menu)
+{
+  array_push($menu, array(
+      'NAME' => 'Register FluxBB',
+      'URL'  => get_admin_plugin_menu_link(Register_FluxBB_PATH.'admin/Register_FluxBB_admin.php')));
+      return $menu;
+}
+
+
+/* user creation*/
+add_event_handler('register_user', 'Register_FluxBB_Adduser');
+
+function Register_FluxBB_Adduser($register_user)
+{
+	global $conf;
+	
+  include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+
+  FluxBB_Adduser($register_user['id'], $register_user['username'], $conf['pass_convert']($_POST['password']), $register_user['email']);
+}
+
+
+/* user deletion */
+add_event_handler('delete_user', 'Register_FluxBB_Deluser');
+
+function Register_FluxBB_Deluser($user_id)
+{
+	include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+
+  FluxBB_Deluser( FluxBB_Searchuser($user_id), true );
+}
+
+
+
+add_event_handler('init', 'Register_FluxBB_InitPage');
+ 
+function Register_FluxBB_InitPage()
+{
+  global $conf, $user ;
+  include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+
+/* user update */
+  if (script_basename() == 'profile')
+  {
+    if (isset($_POST['validate']))
+    {
+      $errors = array();
+
+      $int_pattern = '/^\d+$/';
+      if (empty($_POST['nb_image_line'])
+          or (!preg_match($int_pattern, $_POST['nb_image_line'])))
+      {
+        $errors[] = l10n('nb_image_line_error');
+      }
+    
+      if (empty($_POST['nb_line_page'])
+          or (!preg_match($int_pattern, $_POST['nb_line_page'])))
+      {
+        $errors[] = l10n('nb_line_page_error');
+      }
+    
+      if ($_POST['maxwidth'] != ''
+          and (!preg_match($int_pattern, $_POST['maxwidth'])
+               or $_POST['maxwidth'] < 50))
+      {
+        $errors[] = l10n('maxwidth_error');
+      }
+      if ($_POST['maxheight']
+           and (!preg_match($int_pattern, $_POST['maxheight'])
+                 or $_POST['maxheight'] < 50))
+      {
+        $errors[] = l10n('maxheight_error');
+      }
+      // periods must be integer values, they represents number of days
+      if (!preg_match($int_pattern, $_POST['recent_period'])
+          or $_POST['recent_period'] <= 0)
+      {
+        $errors[] = l10n('periods_error') ;
+      }
+    
+      if (isset($_POST['mail_address']))
+      {
+        $mail_error = validate_mail_address($user['id'],$_POST['mail_address']);
+        if (!empty($mail_error))
+        {
+          $errors[] = $mail_error;
+        }
+      }
+    
+      if (!empty($_POST['use_new_pwd']))
+      {
+        // password must be the same as its confirmation
+        if ($_POST['use_new_pwd'] != $_POST['passwordConf'])
+        {
+          $errors[] = l10n('New password confirmation does not correspond');
+        }
+    
+        if ( !defined('IN_ADMIN') )
+        {// changing password requires old password
+          $query = '
+            SELECT '.$conf['user_fields']['password'].' AS password
+            FROM '.USERS_TABLE.'
+            WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+          ;';
+          list($current_password) = mysql_fetch_row(pwg_query($query));
+      
+          if ($conf['pass_convert']($_POST['password']) != $current_password)
+          {
+            $errors[] = l10n('Current password is wrong');
+          }
+        }
+      }
+    
+      if (count($errors) == 0)
+      {
+      	include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+      
+        $query = '
+          SELECT '.$conf['user_fields']['username'].' AS username
+          FROM '.USERS_TABLE.'
+          WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+        ;';
+        list($username) = mysql_fetch_row(pwg_query($query));
+
+        FluxBB_Updateuser($user['id'], $username, $conf['pass_convert']($_POST['use_new_pwd']), $_POST['mail_address']);
+      }
+    }
+  }
+}
+
+?>
Index: extensions/Register_FluxBB/trunk/maintain.inc.php
===================================================================
--- extensions/Register_FluxBB/trunk/maintain.inc.php	(revision 3738)
+++ extensions/Register_FluxBB/trunk/maintain.inc.php	(revision 3738)
@@ -0,0 +1,62 @@
+<?php
+
+define('Register_FluxBB_DIR' , basename(dirname(__FILE__)));
+define('Register_FluxBB_PATH' , PHPWG_PLUGINS_PATH . Register_FluxBB_DIR . '/');
+
+//ini_set('error_reporting', E_ALL);
+//ini_set('display_errors', true);
+
+include_once (PHPWG_ROOT_PATH.'/include/constants.php');
+include_once (Register_FluxBB_PATH.'include/constants.php');
+
+
+
+function plugin_install()
+{
+  global $prefixeTable;
+
+  $q = '
+    INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+    VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true","Parametres Register_FluxBB")
+  ;';
+    
+  pwg_query($q);
+  
+	$q = "
+    CREATE TABLE IF NOT EXISTS ".Register_FluxBB_ID_TABLE." (
+      id_user_pwg smallint(5) NOT NULL default '0',
+      id_user_FluxBB int(10) NOT NULL default '0',
+      PRIMARY KEY  (id_user_pwg),
+      KEY id_user_pwg (id_user_pwg, id_user_FluxBB)
+    )
+  ;";
+
+  pwg_query($q);
+
+}
+
+function plugin_activate()
+{
+
+}
+
+function plugin_uninstall()
+{
+  global $conf;
+
+  if (isset($conf['Register_FluxBB']))
+  {
+    $q = '
+      DELETE FROM '.CONFIG_TABLE.'
+      WHERE param="Register_FluxBB" LIMIT 1
+    ;';
+
+    pwg_query($q);
+  }
+  
+  $q = 'DROP TABLE '.Register_FluxBB_ID_TABLE.';';
+  pwg_query( $q );
+
+}
+
+?>
