From 256bf9d32857cf74e207f0c46f1c2eca09d49759 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Wed, 13 Feb 2008 12:46:20 +1300 Subject: [PATCH] Handle the case where sync_LDAP doesn't find any users in LDAP. --- inc/drivers_ldap.php | 4 ++++ 1 file changed, 4 insertions(+) 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]);