Index: extensions/Register_FluxBB/trunk/index.php
===================================================================
--- extensions/Register_FluxBB/trunk/index.php	(revision 3778)
+++ extensions/Register_FluxBB/trunk/index.php	(revision 4285)
Index: extensions/Register_FluxBB/trunk/main.inc.php
===================================================================
--- extensions/Register_FluxBB/trunk/main.inc.php	(revision 3778)
+++ extensions/Register_FluxBB/trunk/main.inc.php	(revision 4285)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: Register FluxBB
-Version: 2.1.2
+Version: 2.1.3
 Description: Link user registration from Piwigo to FluxBB forum (registration, password changing, deletion) - Original Nicco's NBC_LinkUser2PunBB plugin upgraded to Piwigo / Liez l'inscription des utilisateurs de Piwigo avec votre forum FluxBB - Portage du plugin NBC_LinkUser2PunBB de Nicco vers Piwigo
 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=252
@@ -19,17 +19,22 @@
 :: HISTORY
 
-2.0.0b			- 23/11/08  - Initial release. Basic changes to be available for Piwigo 2.0RC4
+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.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
+                      - Radio buttons functionnalities corrections (now radio buttons show the configuration saved in database)
+                      - Language files (fr - en) improvement
 
 2.1.1			- 30/04/09	- Bug fixed on profile update
 
 2.1.2			- 22/08/09	- Compatibility bug fixed when used with DynamicRecentPeriod plugin
+
+2.1.3     - 16/11/09  - Using sha1 hash instead of md5 for password hashing in FluxBB
+                      - Escaping all characters in login names and be able to retreive them without slashes - FluxBB does not allow this so Piwigo's user names with escaped characters will not been escaped in FluxBB (ie : "it's" in Piwigo will be "It\'s" in FluxBB)
+                      - Code refactoring
+                      - Full HTML 4.0 for tpl
 
 --------------------------------------------------------------------------------
@@ -52,7 +57,7 @@
 {
   array_push($menu, array(
-      'NAME' => 'Register FluxBB',
-      'URL'  => get_admin_plugin_menu_link(Register_FluxBB_PATH.'admin/Register_FluxBB_admin.php')));
-      return $menu;
+    'NAME' => 'Register FluxBB',
+    'URL'  => get_admin_plugin_menu_link(Register_FluxBB_PATH.'admin/Register_FluxBB_admin.php')));
+  return $menu;
 }
 
@@ -63,9 +68,10 @@
 function Register_FluxBB_Adduser($register_user)
 {
-	global $conf;
+  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']);
+  // Warning : FluxBB uses Sha1 hash instead of md5 for Piwigo !
+  FluxBB_Adduser($register_user['id'], $register_user['username'], sha1($_POST['password']), $register_user['email']);
 }
 
@@ -76,5 +82,5 @@
 function Register_FluxBB_Deluser($user_id)
 {
-	include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+  include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
 
   FluxBB_Deluser( FluxBB_Searchuser($user_id), true );
@@ -99,5 +105,5 @@
       $int_pattern = '/^\d+$/';
       if (empty($_POST['nb_image_line'])
-          or (!preg_match($int_pattern, $_POST['nb_image_line'])))
+        or (!preg_match($int_pattern, $_POST['nb_image_line'])))
       {
         $errors[] = l10n('nb_image_line_error');
@@ -105,5 +111,5 @@
     
       if (empty($_POST['nb_line_page'])
-          or (!preg_match($int_pattern, $_POST['nb_line_page'])))
+        or (!preg_match($int_pattern, $_POST['nb_line_page'])))
       {
         $errors[] = l10n('nb_line_page_error');
@@ -111,24 +117,17 @@
     
       if ($_POST['maxwidth'] != ''
-          and (!preg_match($int_pattern, $_POST['maxwidth'])
-               or $_POST['maxwidth'] < 50))
+        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))
+        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
-        /* Commented to fix compatibility problem with Dynamic Recent Period Plugin */
-        /* This don't impact the plugin functionnalities */
-        /*if (!preg_match($int_pattern, $_POST['recent_period'])
-            or $_POST['recent_period'] <= 0)
-        {
-          $errors[] = l10n('periods_error') ;
-        }*/
-    
+
       if (isset($_POST['mail_address']))
       {
@@ -151,8 +150,9 @@
         {// changing password requires old password
           $query = '
-            SELECT '.$conf['user_fields']['password'].' AS password
-            FROM '.USERS_TABLE.'
-            WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
-          ;';
+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));
       
@@ -166,18 +166,18 @@
       if (count($errors) == 0)
       {
-      	include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php');
+        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'].'\'
-        ;';
+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']);
+        FluxBB_Updateuser($user['id'], stripslashes($username), sha1($_POST['use_new_pwd']), $_POST['mail_address']);
       }
     }
   }
 }
-
 ?>
Index: extensions/Register_FluxBB/trunk/maintain.inc.php
===================================================================
--- extensions/Register_FluxBB/trunk/maintain.inc.php	(revision 3778)
+++ extensions/Register_FluxBB/trunk/maintain.inc.php	(revision 4285)
@@ -17,18 +17,18 @@
 
   $q = '
-    INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
-    VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true","Parametres Register_FluxBB")
-  ;';
+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)
-    )
-  ;";
+  $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);
@@ -48,7 +48,7 @@
   {
     $q = '
-      DELETE FROM '.CONFIG_TABLE.'
-      WHERE param="Register_FluxBB" LIMIT 1
-    ;';
+DELETE FROM '.CONFIG_TABLE.'
+WHERE param="Register_FluxBB" LIMIT 1
+;';
 
     pwg_query($q);
@@ -59,4 +59,3 @@
 
 }
-
 ?>
