Changeset 4595 in subversion
- Timestamp:
- Mar 7, 2011 2:52:35 AM (2 years ago)
- Location:
- trunk/plugins/password
- Files:
-
- 4 edited
-
README (modified) (1 diff)
-
drivers/sql.php (modified) (1 diff)
-
package.xml (modified) (3 diffs)
-
password.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/password/README
r4546 r4595 257 257 Driver file (<driver_name>.php) must define 'password_save' function with 258 258 two arguments. First - current password, second - new password. Function 259 mayreturn PASSWORD_SUCCESS on success or any of PASSWORD_CONNECT_ERROR,259 should return PASSWORD_SUCCESS on success or any of PASSWORD_CONNECT_ERROR, 260 260 PASSWORD_CRYPT_ERROR, PASSWORD_ERROR when driver was unable to change password. 261 See existing drivers in drivers/ directory for examples.262 261 Extended result (as a hash-array with 'message' and 'code' items) can be returned 262 too. See existing drivers in drivers/ directory for examples. -
trunk/plugins/password/drivers/sql.php
r4308 r4595 138 138 if ($result = $db->fetch_array($res)) 139 139 return PASSWORD_SUCCESS; 140 } else { 140 } else { 141 // This is the good case: 1 row updated 141 142 if ($db->affected_rows($res) == 1) 142 return PASSWORD_SUCCESS; // This is the good case: 1 row updated 143 return PASSWORD_SUCCESS; 144 // @TODO: Some queries don't affect any rows 145 // Should we assume a success if there was no error? 143 146 } 144 147 } -
trunk/plugins/password/package.xml
r4546 r4595 16 16 <active>yes</active> 17 17 </lead> 18 <date> 2011-02-15</date>19 <time> 12:00</time>18 <date></date> 19 <time></time> 20 20 <version> 21 <release> 2.2</release>21 <release></release> 22 22 <api>1.6</api> 23 23 </version> … … 28 28 <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> 29 29 <notes> 30 - hMail driver: add username_domain detection (#1487100) 31 - hMail driver: HTML tags in logged messages should be stripped off (#1487099) 32 - Chpasswd driver: add newline at end of input to chpasswd binary (#1487141) 33 - Fix usage of configured temp_dir instead of /tmp (#1487447) 34 - ldap_simple driver: fix parse error 35 - ldap/ldap_simple drivers: support %dc variable in config 36 - ldap/ldap_simple drivers: support Samba password change 37 - Fix extended error messages handling (#1487676) 38 - Fix double request when clicking on Password tab in Firefox 39 - Fix deprecated split() usage in xmail and directadmin drivers (#1487769) 40 - Added option (password_log) for logging password changes 41 - Virtualmin driver: Add option for setting username format (#1487781) 30 - When old and new passwords are the same, do nothing, return success (#1487823) 42 31 </notes> 43 32 <contents> … … 246 235 </notes> 247 236 </release> 237 <release> 238 <date>2011-02-15</date> 239 <time>12:00</time> 240 <version> 241 <release>2.2</release> 242 <api>1.6</api> 243 </version> 244 <stability> 245 <release>stable</release> 246 <api>stable</api> 247 </stability> 248 <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> 249 <notes> 250 - hMail driver: add username_domain detection (#1487100) 251 - hMail driver: HTML tags in logged messages should be stripped off (#1487099) 252 - Chpasswd driver: add newline at end of input to chpasswd binary (#1487141) 253 - Fix usage of configured temp_dir instead of /tmp (#1487447) 254 - ldap_simple driver: fix parse error 255 - ldap/ldap_simple drivers: support %dc variable in config 256 - ldap/ldap_simple drivers: support Samba password change 257 - Fix extended error messages handling (#1487676) 258 - Fix double request when clicking on Password tab in Firefox 259 - Fix deprecated split() usage in xmail and directadmin drivers (#1487769) 260 - Added option (password_log) for logging password changes 261 - Virtualmin driver: Add option for setting username format (#1487781) 262 </notes> 263 </release> 248 264 </changelog> 249 265 </package> -
trunk/plugins/password/password.php
r4544 r4595 92 92 $rc_charset = strtoupper($rcmail->output->get_charset()); 93 93 94 $curpwd = get_input_value('_curpasswd', RCUBE_INPUT_POST, true, $charset); 94 $sespwd = $rcmail->decrypt($_SESSION['password']); 95 $curpwd = $confirm ? get_input_value('_curpasswd', RCUBE_INPUT_POST, true, $charset) : $sespwd; 95 96 $newpwd = get_input_value('_newpasswd', RCUBE_INPUT_POST, true); 96 97 $conpwd = get_input_value('_confpasswd', RCUBE_INPUT_POST, true); … … 116 117 $rcmail->output->command('display_message', $this->gettext('passwordinconsistency'), 'error'); 117 118 } 118 else if ($confirm && $ rcmail->decrypt($_SESSION['password'])!= $curpwd) {119 else if ($confirm && $sespwd != $curpwd) { 119 120 $rcmail->output->command('display_message', $this->gettext('passwordincorrect'), 'error'); 120 121 } … … 125 126 else if ($check_strength && (!preg_match("/[0-9]/", $newpwd) || !preg_match("/[^A-Za-z0-9]/", $newpwd))) { 126 127 $rcmail->output->command('display_message', $this->gettext('passwordweak'), 'error'); 128 } 129 // password is the same as the old one, do nothing, return success 130 else if ($sespwd == $newpwd) { 131 $rcmail->output->command('display_message', $this->gettext('successfullysaved'), 'confirmation'); 127 132 } 128 133 // try to save the password
Note: See TracChangeset
for help on using the changeset viewer.
