Skip to content

Commit

Permalink
Do not send empty changes to the AD backend
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
splitbrain committed Oct 31, 2011
1 parent 3a68d3c commit 222298b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions inc/auth/ad.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,13 @@ function modifyUser($user, $changes) {
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;
Expand Down

0 comments on commit 222298b

Please sign in to comment.