diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-03-07 07:52:35 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-03-07 07:52:35 +0000 |
| commit | 4ae9a39aabee5816b6321d24e771ddb56d824ab7 (patch) | |
| tree | 602b0a5917555d3637c7a07d77ac28b068f88ac9 /plugins/password/password.php | |
| parent | b8c247a8773b945369a5858275c86e2448cdc7db (diff) | |
- When old and new passwords are the same, do nothing, return success (#1487823)
git-svn-id: https://svn.roundcube.net/trunk@4595 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/password/password.php')
| -rw-r--r-- | plugins/password/password.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/password/password.php b/plugins/password/password.php index 8fc95ea86..c79f55ef2 100644 --- a/plugins/password/password.php +++ b/plugins/password/password.php @@ -91,7 +91,8 @@ class password extends rcube_plugin $charset = strtoupper($rcmail->config->get('password_charset', 'ISO-8859-1')); $rc_charset = strtoupper($rcmail->output->get_charset()); - $curpwd = get_input_value('_curpasswd', RCUBE_INPUT_POST, true, $charset); + $sespwd = $rcmail->decrypt($_SESSION['password']); + $curpwd = $confirm ? get_input_value('_curpasswd', RCUBE_INPUT_POST, true, $charset) : $sespwd; $newpwd = get_input_value('_newpasswd', RCUBE_INPUT_POST, true); $conpwd = get_input_value('_confpasswd', RCUBE_INPUT_POST, true); @@ -115,7 +116,7 @@ class password extends rcube_plugin else if ($conpwd != $newpwd) { $rcmail->output->command('display_message', $this->gettext('passwordinconsistency'), 'error'); } - else if ($confirm && $rcmail->decrypt($_SESSION['password']) != $curpwd) { + else if ($confirm && $sespwd != $curpwd) { $rcmail->output->command('display_message', $this->gettext('passwordincorrect'), 'error'); } else if ($required_length && strlen($newpwd) < $required_length) { @@ -125,6 +126,10 @@ class password extends rcube_plugin else if ($check_strength && (!preg_match("/[0-9]/", $newpwd) || !preg_match("/[^A-Za-z0-9]/", $newpwd))) { $rcmail->output->command('display_message', $this->gettext('passwordweak'), 'error'); } + // password is the same as the old one, do nothing, return success + else if ($sespwd == $newpwd) { + $rcmail->output->command('display_message', $this->gettext('successfullysaved'), 'confirmation'); + } // try to save the password else if (!($res = $this->_save($curpwd, $newpwd))) { $rcmail->output->command('display_message', $this->gettext('successfullysaved'), 'confirmation'); |
