diff --git a/scripts/multi_ldap_change.php b/scripts/multi_ldap_change.php index 68615ead..4e88bc9f 100644 --- a/scripts/multi_ldap_change.php +++ b/scripts/multi_ldap_change.php @@ -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";