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/config.inc.php.dist | 14 +++++--------- plugins/password/package.xml | 3 +-- plugins/password/password.php | 8 ++++++++ 3 files changed, 14 insertions(+), 11 deletions(-) (limited to 'plugins') diff --git a/plugins/password/config.inc.php.dist b/plugins/password/config.inc.php.dist index 086fc502f..d3812bcf2 100644 --- a/plugins/password/config.inc.php.dist +++ b/plugins/password/config.inc.php.dist @@ -18,6 +18,9 @@ $rcmail_config['password_minimum_length'] = 0; // Change to false to remove this check. $rcmail_config['password_require_nonalpha'] = false; +// Enables logging of password changes into logs/password +$rcmail_config['password_log'] = false; + // SQL Driver options // ------------------ @@ -195,15 +198,8 @@ $rcmail_config['password_ldap_force_replace'] = true; // Whenever the password is changed, the attribute will be updated if set (e.g. shadowLastChange) $rcmail_config['password_ldap_lchattr'] = ''; -// LDAP Samba password attribute, e.g. sambaNTPassword -// Name of the LDAP's Samba attribute used for storing user password -$rcmail_config['password_ldap_samba_pwattr'] = ''; - -// LDAP Samba Password Last Change Date attribute, e.g. sambaPwdLastSet -// Some places use an attribute to store the date of the last password change -// The date is meassured in "seconds since epoch" (an integer value) -// Whenever the password is changed, the attribute will be updated if set -$rcmail_config['password_ldap_samba_lchattr'] = ''; +// Also try to update Samba password attributes: sambaNTPassword and sambaPwdLastSet +$rcmail_config['password_ldap_samba'] = false; // DirectAdmin Driver options diff --git a/plugins/password/package.xml b/plugins/password/package.xml index dab44457d..823f3957e 100644 --- a/plugins/password/package.xml +++ b/plugins/password/package.xml @@ -37,8 +37,7 @@ - Fix extended error messages handling (#1487676) - Fix double request when clicking on Password tab in Firefox - Fix deprecated split() usage in xmail and directadmin drivers (#1487769) -- ldap/ldap_simple drivers: use password_ldap_samba_pwattr/password_ldap_samba_lchattr - instead of password_ldap_samba option +- Added option (password_log) for logging password changes 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