Handle the case where sync_LDAP doesn't find any users in LDAP.

This commit is contained in:
Andrew Ruthven 2008-02-13 12:46:20 +13:00 committed by Andrew Ruthven
parent 0bc51a9e39
commit 256bf9d328

View File

@ -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]);