summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-10-23 10:36:49 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-11-26 13:29:47 (GMT)
commitce9f741c3161f5bbbc7c7a2430e4458a6c40f800 (patch)
treedd574b94958839c3b5a8ec7783819b59be760384
parent5d73614d72655eaddc5f53c50931d123fd695be8 (diff)
downloadkolab-wap-ce9f741c3161f5bbbc7c7a2430e4458a6c40f800.tar.gz
Update the session password on own's password change via user.edit (Bug #964)
-rw-r--r--lib/Auth/LDAP.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Auth/LDAP.php b/lib/Auth/LDAP.php
index 2891857..e2f5d27 100644
--- a/lib/Auth/LDAP.php
+++ b/lib/Auth/LDAP.php
@@ -530,7 +530,18 @@ class LDAP extends Net_LDAP3 {
$user_dn = key($user);
// We should start throwing stuff over the fence here.
- return $this->modify_entry($user_dn, $user[$user_dn], $attributes);
+ $result = $this->modify_entry($user_dn, $user[$user_dn], $attributes);
+
+ // Handle modification of current user data
+ if (!empty($result) && $user_dn == $_SESSION['user']->user_bind_dn) {
+ // update session password
+ if (!empty($result['replace']) && !empty($result['replace']['userpassword'])) {
+ $pass = $result['replace']['userpassword'];
+ $_SESSION['user']->user_bind_pw = is_array($pass) ? implode($pass) : $pass;
+ }
+ }
+
+ return $result;
}
public function user_delete($user)