From 0dd842dbf5a63af81fc2abfc884dd9889e59b269 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sat, 19 Sep 2009 04:01:55 -0400
Subject: [PATCH] - added server side password inconsistency check

---
 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 3a7050b..0a44aa9 100644
--- a/plugins/password/password.php
+++ b/plugins/password/password.php
@@ -89,8 +89,12 @@
 
       $curpwd = get_input_value('_curpasswd', RCUBE_INPUT_POST);
       $newpwd = get_input_value('_newpasswd', RCUBE_INPUT_POST);
+      $conpwd = get_input_value('_confpasswd', RCUBE_INPUT_POST);
 
-      if ($confirm && $rcmail->decrypt($_SESSION['password']) != $curpwd) {
+      if ($conpwd != $newpwd) {
+        $rcmail->output->command('display_message', $this->gettext('passwordinconsistency'), 'error');
+      }
+      else if ($confirm && $rcmail->decrypt($_SESSION['password']) != $curpwd) {
         $rcmail->output->command('display_message', $this->gettext('passwordincorrect'), 'error');
       }
       else if ($required_length && strlen($newpwd) < $required_length) {
@@ -103,7 +107,8 @@
       else if (!($res = $this->_save($curpwd,$newpwd))) {
         $rcmail->output->command('display_message', $this->gettext('successfullysaved'), 'confirmation');
         $_SESSION['password'] = $rcmail->encrypt($newpwd);
-      } else
+      }
+      else
         $rcmail->output->command('display_message', $res, 'error');
     }
 

--
Gitblit v1.9.1