Skip to content

Commit

Permalink
Only call ldap_get_dn on an entry
Browse files Browse the repository at this point in the history
  • Loading branch information
coudot committed Sep 4, 2024
1 parent b742d6b commit ffd925f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/multi_ldap_change.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@

# Get user DN
$entry = ldap_first_entry($ldap, $search);
$userdn = ldap_get_dn($ldap, $entry);
$userdn = null;
if ( $entry ) {
$userdn = ldap_get_dn($ldap, $entry);
}

if( !$userdn ) {
$result = "badcredentials";
Expand Down

0 comments on commit ffd925f

Please sign in to comment.