Skip to content

Commit

Permalink
Invert bitwise operations
Browse files Browse the repository at this point in the history
  • Loading branch information
coudot committed Jul 26, 2024
1 parent 25caa0d commit 022aae6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Ltb/Directory/ActiveDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function enableAccount($ldap, $dn) : bool {
}

if ($entry[0]['useraccountcontrol'] and ( $entry[0]['useraccountcontrol'][0] & 2)) {
$newUAC = $entry[0]['useraccountcontrol'][0] | 2;
$newUAC = $entry[0]['useraccountcontrol'][0] & ~2;
$update = \Ltb\PhpLDAP::ldap_mod_replace($ldap, $dn, array( "userAccountControl" => $newUAC));
$errno = ldap_errno($ldap);

Expand Down Expand Up @@ -255,7 +255,7 @@ public function disableAccount($ldap, $dn) : bool {
}

if ($entry[0]['useraccountcontrol'] and ( $entry[0]['useraccountcontrol'][0] ^ 2)) {
$newUAC = $entry[0]['useraccountcontrol'][0] & ~2;
$newUAC = $entry[0]['useraccountcontrol'][0] | 2;
$update = \Ltb\PhpLDAP::ldap_mod_replace($ldap, $dn, array( "userAccountControl" => $newUAC));
$errno = ldap_errno($ldap);

Expand Down

0 comments on commit 022aae6

Please sign in to comment.