diff options
author | Andreas Gohr <gohr@cosmocode.de> | 2011-10-31 15:27:45 +0100 |
---|---|---|
committer | Andreas Gohr <gohr@cosmocode.de> | 2011-10-31 15:52:05 +0100 |
commit | 222298bcee7f8e8fd98bb6fc1bcfb821ac1e55cd (patch) | |
tree | 6e3dd6d2c520cbe8900330951a6a36a4ed113551 | |
parent | 3a68d3cc23ddbed6aed2eea5ef49c35ad3494959 (diff) | |
download | dokuwiki-222298bcee7f8e8fd98bb6fc1bcfb821ac1e55cd.tar.gz dokuwiki-222298bcee7f8e8fd98bb6fc1bcfb821ac1e55cd.zip |
Do not send empty changes to the AD backend
This fixes password changing operations: password change and user
modification are two different operations on the AD backend - the user
modification should not be done on password only changes.
-rw-r--r-- | inc/auth/ad.class.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/inc/auth/ad.class.php b/inc/auth/ad.class.php index 9ffd3e18b..1fddad243 100644 --- a/inc/auth/ad.class.php +++ b/inc/auth/ad.class.php @@ -286,11 +286,13 @@ class auth_ad extends auth_basic { if(isset($changes['mail'])){ $adchanges['email'] = $changes['mail']; } - try { - $return = $return & $this->adldap->user_modify($user,$adchanges); - } catch (adLDAPException $e) { - if ($this->cnf['debug']) msg('AD Auth: '.$e->getMessage(), -1); - $return = false; + if(count($adchanges)){ + try { + $return = $return & $this->adldap->user_modify($user,$adchanges); + } catch (adLDAPException $e) { + if ($this->cnf['debug']) msg('AD Auth: '.$e->getMessage(), -1); + $return = false; + } } return $return; |