From b803877972dcb047d54537936da019f92d9809d3 Mon Sep 17 00:00:00 2001 From: alec Date: Tue, 15 Feb 2011 11:47:41 +0000 Subject: - Added option (password_log) for logging password changes git-svn-id: https://svn.roundcube.net/trunk@4544 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/password/password.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins/password/password.php') diff --git a/plugins/password/password.php b/plugins/password/password.php index b675b079c..8fc95ea86 100644 --- a/plugins/password/password.php +++ b/plugins/password/password.php @@ -128,7 +128,15 @@ class password extends rcube_plugin // 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'); -- cgit v1.2.3