From 81dfa789c03a2fb7cb1d5b297d7de1436bd60b2f Mon Sep 17 00:00:00 2001 From: skeeter Date: Mon, 3 Sep 2001 09:47:47 +0000 Subject: [PATCH] Small changes. Added the caching back into id2name and did a little more checking for use of caching. --- phpgwapi/inc/class.accounts_ldap.inc.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/phpgwapi/inc/class.accounts_ldap.inc.php b/phpgwapi/inc/class.accounts_ldap.inc.php index edcc1d6add..25b9ab4463 100644 --- a/phpgwapi/inc/class.accounts_ldap.inc.php +++ b/phpgwapi/inc/class.accounts_ldap.inc.php @@ -415,7 +415,7 @@ { static $name_list; - if(@isset($name_list[$account_lid])) + if(@isset($name_list[$account_lid]) && $name_list[$account_lid]) { return $name_list[$account_lid]; } @@ -424,19 +424,19 @@ $sri = ldap_search($ds, $this->group_context, "(&(cn=$account_lid)(phpgwaccounttype=g))"); $allValues = ldap_get_entries($ds, $sri); - - if ($allValues[0]['gidnumber'][0]) + + if (@$allValues[0]['gidnumber'][0]) { $name_list[$account_lid] = intval($allValues[0]['gidnumber'][0]); } $sri = ldap_search($ds, $this->user_context, "(&(uid=$account_lid)(phpgwaccounttype=u))"); + $allValues = ldap_get_entries($ds, $sri); - if ($allValues[0]['uidnumber'][0]) + if (@$allValues[0]['uidnumber'][0]) { - /* $name_list[$account_lid] = intval($allValues[0]['uidnumber'][0]); */ - return intval($allValues[0]['uidnumber'][0]); + $name_list[$account_lid] = intval($allValues[0]['uidnumber'][0]); } return $name_list[$account_lid];