diff --git a/inc/drivers_ldap.php b/inc/drivers_ldap.php index 8d312e6e..451fd0d1 100644 --- a/inc/drivers_ldap.php +++ b/inc/drivers_ldap.php @@ -302,6 +302,10 @@ function sync_LDAP(){ $mapping = $c->authenticate_hook['config']['mapping_field']; $attributes = array_values($mapping); $ldap_users_tmp = $ldapDriver->getAllUsers($attributes); + + if ( sizeof($ldap_users_tmp) == 0 ) + return; + foreach($ldap_users_tmp as $key => $ldap_user){ $ldap_users_info[$ldap_user[$mapping["username"]]] = $ldap_user; unset($ldap_users_tmp[$key]);