summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-08-09 15:57:25 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-08-09 15:57:25 +0000
commit1e4bb015cd11cee39ecc25bb7617edb33acdd809 (patch)
tree2254bb54d1fd3a40f8e0f5656fa87c3de19fa19b /plugins
parent7d38670e386d0de3cf3245e06a269f32d6ad1593 (diff)
- Added 'password_change' hook for plugin actions after successful password change
git-svn-id: https://svn.roundcube.net/trunk@5036 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/password/package.xml1
-rw-r--r--plugins/password/password.php6
2 files changed, 6 insertions, 1 deletions
diff --git a/plugins/password/package.xml b/plugins/password/package.xml
index 28f82a43d..a4f74c192 100644
--- a/plugins/password/package.xml
+++ b/plugins/password/package.xml
@@ -29,6 +29,7 @@
<notes>
- When old and new passwords are the same, do nothing, return success (#1487823)
- Fixed Samba password hashing in 'ldap' driver
+- Added 'password_change' hook for plugin actions after successful password change
</notes>
<contents>
<dir baseinstalldir="/" name="/">
diff --git a/plugins/password/password.php b/plugins/password/password.php
index c79f55ef2..b1c7863fc 100644
--- a/plugins/password/password.php
+++ b/plugins/password/password.php
@@ -134,8 +134,12 @@ class password extends rcube_plugin
else if (!($res = $this->_save($curpwd, $newpwd))) {
$rcmail->output->command('display_message', $this->gettext('successfullysaved'), 'confirmation');
+ // allow additional actions after password change (e.g. reset some backends)
+ $plugin = $rcmail->plugins->exec_hook('password_change', array(
+ 'old_pass' => $curpwd, 'new_pass' => $newpwd));
+
// Reset session password
- $_SESSION['password'] = $rcmail->encrypt($newpwd);
+ $_SESSION['password'] = $rcmail->encrypt($plugin['new_pass']);
// Log password change
if ($rcmail->config->get('password_log')) {