[Svn] r4544 - trunk/plugins/password

trac at roundcube.net trac at roundcube.net
Tue Feb 15 12:47:41 CET 2011


Author: alec
Date: 2011-02-15 05:47:41 -0600 (Tue, 15 Feb 2011)
New Revision: 4544

Modified:
   trunk/plugins/password/config.inc.php.dist
   trunk/plugins/password/package.xml
   trunk/plugins/password/password.php
Log:
- Added option (password_log) for logging password changes


Modified: trunk/plugins/password/config.inc.php.dist
===================================================================
--- trunk/plugins/password/config.inc.php.dist	2011-02-15 11:10:59 UTC (rev 4543)
+++ trunk/plugins/password/config.inc.php.dist	2011-02-15 11:47:41 UTC (rev 4544)
@@ -18,7 +18,10 @@
 // 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
 // ------------------
 // PEAR database DSN for performing the query. By default
@@ -195,17 +198,10 @@
 // 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'] = '';
+// Also try to update Samba password attributes: sambaNTPassword and sambaPwdLastSet
+$rcmail_config['password_ldap_samba'] = false;
 
-// 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'] = '';
 
-
 // DirectAdmin Driver options
 // --------------------------
 // The host which changes the password

Modified: trunk/plugins/password/package.xml
===================================================================
--- trunk/plugins/password/package.xml	2011-02-15 11:10:59 UTC (rev 4543)
+++ trunk/plugins/password/package.xml	2011-02-15 11:47:41 UTC (rev 4544)
@@ -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
     </notes>
 	<contents>
 		<dir baseinstalldir="/" name="/">

Modified: trunk/plugins/password/password.php
===================================================================
--- trunk/plugins/password/password.php	2011-02-15 11:10:59 UTC (rev 4543)
+++ trunk/plugins/password/password.php	2011-02-15 11:47:41 UTC (rev 4544)
@@ -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');

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list