Skip to content

Commit

Permalink
Merge pull request #971 from ltb-project/970-error-catching
Browse files Browse the repository at this point in the history
Only call ldap_get_dn on an entry
  • Loading branch information
coudot committed Sep 4, 2024
2 parents b742d6b + ffd925f commit e9d1ca9
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 e9d1ca9

Please sign in to comment.