From 207cc0b9b3cfdfb29e4f02e83014320fd12eeb68 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 16 Feb 2011 05:48:11 -0500
Subject: [PATCH] - Applied plugin changes since 0.5-stable release

---
 plugins/password/password.php |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/plugins/password/password.php b/plugins/password/password.php
index 6d3042b..8fc95ea 100644
--- a/plugins/password/password.php
+++ b/plugins/password/password.php
@@ -128,7 +128,15 @@
             // try to save the password
             else if (!($res = $this->_save($curpwd, $newpwd))) {
                 $rcmail->output->command('display_message', $this->gettext('successfullysaved'), 'confirmation');
+
+                // Reset session password
                 $_SESSION['password'] = $rcmail->encrypt($newpwd);
+
+                // Log password change
+                if ($rcmail->config->get('password_log')) {
+                    write_log('password', sprintf('Password changed for user %s (ID: %d) from %s',
+                        $rcmail->user->get_username(), $rcmail->user->ID, rcmail_remote_ip()));
+                }
             }
             else {
                 $rcmail->output->command('display_message', $res, 'error');
@@ -232,8 +240,8 @@
         $result = password_save($curpass, $passwd);
 
         if (is_array($result)) {
-            $result  = $result['code'];
             $message = $result['message'];
+            $result  = $result['code'];
         }
 
         switch ($result) {

--
Gitblit v1.9.1