summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorAndreas Gohr <gohr@cosmocode.de>2011-10-31 15:27:45 +0100
committerAndreas Gohr <gohr@cosmocode.de>2011-10-31 15:52:05 +0100
commit222298bcee7f8e8fd98bb6fc1bcfb821ac1e55cd (patch)
tree6e3dd6d2c520cbe8900330951a6a36a4ed113551 /inc
parent3a68d3cc23ddbed6aed2eea5ef49c35ad3494959 (diff)
downloadrpg-222298bcee7f8e8fd98bb6fc1bcfb821ac1e55cd.tar.gz
rpg-222298bcee7f8e8fd98bb6fc1bcfb821ac1e55cd.tar.bz2
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.
Diffstat (limited to 'inc')
-rw-r--r--inc/auth/ad.class.php12
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;