Changeset 4285
- Timestamp:
- Nov 17, 2009, 6:07:41 PM (14 years ago)
- Location:
- extensions/Register_FluxBB/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Register_FluxBB/trunk/main.inc.php
r3778 r4285 2 2 /* 3 3 Plugin Name: Register FluxBB 4 Version: 2.1. 24 Version: 2.1.3 5 5 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 6 6 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=252 … … 19 19 :: HISTORY 20 20 21 2.0.0b 21 2.0.0b - 23/11/08 - Initial release. Basic changes to be available for Piwigo 2.0RC4 22 22 23 2.0.1b 23 2.0.1b - 24/11/08 - Small bug correction on submit button display 24 24 25 25 2.0.2 - 19/02/09 - Language pack correction 26 26 27 27 2.1.0 - 25/04/09 - Admin panel with tabsheets 28 29 28 - Radio buttons functionnalities corrections (now radio buttons show the configuration saved in database) 29 - Language files (fr - en) improvement 30 30 31 31 2.1.1 - 30/04/09 - Bug fixed on profile update 32 32 33 33 2.1.2 - 22/08/09 - Compatibility bug fixed when used with DynamicRecentPeriod plugin 34 35 2.1.3 - 16/11/09 - Using sha1 hash instead of md5 for password hashing in FluxBB 36 - 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) 37 - Code refactoring 38 - Full HTML 4.0 for tpl 34 39 35 40 -------------------------------------------------------------------------------- … … 52 57 { 53 58 array_push($menu, array( 54 55 56 59 'NAME' => 'Register FluxBB', 60 'URL' => get_admin_plugin_menu_link(Register_FluxBB_PATH.'admin/Register_FluxBB_admin.php'))); 61 return $menu; 57 62 } 58 63 … … 63 68 function Register_FluxBB_Adduser($register_user) 64 69 { 65 70 global $conf; 66 71 67 72 include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php'); 68 73 69 FluxBB_Adduser($register_user['id'], $register_user['username'], $conf['pass_convert']($_POST['password']), $register_user['email']); 74 // Warning : FluxBB uses Sha1 hash instead of md5 for Piwigo ! 75 FluxBB_Adduser($register_user['id'], $register_user['username'], sha1($_POST['password']), $register_user['email']); 70 76 } 71 77 … … 76 82 function Register_FluxBB_Deluser($user_id) 77 83 { 78 84 include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php'); 79 85 80 86 FluxBB_Deluser( FluxBB_Searchuser($user_id), true ); … … 99 105 $int_pattern = '/^\d+$/'; 100 106 if (empty($_POST['nb_image_line']) 101 107 or (!preg_match($int_pattern, $_POST['nb_image_line']))) 102 108 { 103 109 $errors[] = l10n('nb_image_line_error'); … … 105 111 106 112 if (empty($_POST['nb_line_page']) 107 113 or (!preg_match($int_pattern, $_POST['nb_line_page']))) 108 114 { 109 115 $errors[] = l10n('nb_line_page_error'); … … 111 117 112 118 if ($_POST['maxwidth'] != '' 113 114 119 and (!preg_match($int_pattern, $_POST['maxwidth']) 120 or $_POST['maxwidth'] < 50)) 115 121 { 116 122 $errors[] = l10n('maxwidth_error'); 117 123 } 124 118 125 if ($_POST['maxheight'] 119 120 126 and (!preg_match($int_pattern, $_POST['maxheight']) 127 or $_POST['maxheight'] < 50)) 121 128 { 122 129 $errors[] = l10n('maxheight_error'); 123 130 } 124 // periods must be integer values, they represents number of days 125 /* Commented to fix compatibility problem with Dynamic Recent Period Plugin */ 126 /* This don't impact the plugin functionnalities */ 127 /*if (!preg_match($int_pattern, $_POST['recent_period']) 128 or $_POST['recent_period'] <= 0) 129 { 130 $errors[] = l10n('periods_error') ; 131 }*/ 132 131 133 132 if (isset($_POST['mail_address'])) 134 133 { … … 151 150 {// changing password requires old password 152 151 $query = ' 153 SELECT '.$conf['user_fields']['password'].' AS password 154 FROM '.USERS_TABLE.' 155 WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\' 156 ;'; 152 SELECT '.$conf['user_fields']['password'].' AS password 153 FROM '.USERS_TABLE.' 154 WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\' 155 ;'; 156 157 157 list($current_password) = mysql_fetch_row(pwg_query($query)); 158 158 … … 166 166 if (count($errors) == 0) 167 167 { 168 168 include_once (Register_FluxBB_PATH.'include/functions_Register_FluxBB.inc.php'); 169 169 170 170 $query = ' 171 SELECT '.$conf['user_fields']['username'].' AS username 172 FROM '.USERS_TABLE.' 173 WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\' 174 ;'; 171 SELECT '.$conf['user_fields']['username'].' AS username 172 FROM '.USERS_TABLE.' 173 WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\' 174 ;'; 175 175 176 list($username) = mysql_fetch_row(pwg_query($query)); 176 177 177 FluxBB_Updateuser($user['id'], $username, $conf['pass_convert']($_POST['use_new_pwd']), $_POST['mail_address']);178 FluxBB_Updateuser($user['id'], stripslashes($username), sha1($_POST['use_new_pwd']), $_POST['mail_address']); 178 179 } 179 180 } 180 181 } 181 182 } 182 183 183 ?> -
extensions/Register_FluxBB/trunk/maintain.inc.php
r3738 r4285 17 17 18 18 $q = ' 19 20 21 19 INSERT INTO '.CONFIG_TABLE.' (param,value,comment) 20 VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true","Parametres Register_FluxBB") 21 ;'; 22 22 23 23 pwg_query($q); 24 24 25 26 27 28 29 30 31 32 25 $q = " 26 CREATE TABLE IF NOT EXISTS ".Register_FluxBB_ID_TABLE." ( 27 id_user_pwg smallint(5) NOT NULL default '0', 28 id_user_FluxBB int(10) NOT NULL default '0', 29 PRIMARY KEY (id_user_pwg), 30 KEY id_user_pwg (id_user_pwg, id_user_FluxBB) 31 ) 32 ;"; 33 33 34 34 pwg_query($q); … … 48 48 { 49 49 $q = ' 50 51 52 50 DELETE FROM '.CONFIG_TABLE.' 51 WHERE param="Register_FluxBB" LIMIT 1 52 ;'; 53 53 54 54 pwg_query($q); … … 59 59 60 60 } 61 62 61 ?>
Note: See TracChangeset
for help on using the changeset viewer.