From f92b77b64f3f20242aa6593d4b3efee20ff66edd Mon Sep 17 00:00:00 2001 From: katagia Date: Tue, 7 Sep 2004 17:58:58 +0000 Subject: [PATCH] removed main-Module --- lam/lib/cache.inc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lam/lib/cache.inc b/lam/lib/cache.inc index 0b8c64b8..64f4b98e 100644 --- a/lam/lib/cache.inc +++ b/lam/lib/cache.inc @@ -200,8 +200,9 @@ class cache { $scopes = array_keys($this->attributes); foreach ($scopes as $scope) { // Get Scope - $function = '$suffix = $this->config->get_'.ucfirst($scope).'Suffix();'; - If ($scope != '*') eval($function); + //$function = '$suffix = $this->config->get_'.ucfirst($scope).'Suffix();'; + If ($scope != '*') //eval($function); + $suffix = call_user_func(array($this->config, 'get_'.ucfirst($scope).'Suffix')); else $suffix = ''; // Get Data from ldap $search = $this->attributes[$scope]; @@ -243,7 +244,8 @@ class cache { print $function; print "
"; // *** fixme, where is get_DomainSuffix - If ($scope != '*') eval($function); + If ($scope != '*') //eval($function); + $suffix = call_user_func(array($$this->config, 'get_'.ucfirst($allowed_types[$i]).'Suffix')); else $suffix = ''; if (substr($suffix, $dn)) $singlescope = $allowed_types[$i]; } @@ -254,7 +256,8 @@ class cache { // Get Scope foreach ($allowed_types as $scope) { $function = '$suffix = $this->config->get_'.ucfirst($scope).'Suffix();'; - eval($function); + //eval($function); + $suffix = call_user_func(array($$this->config, 'get_'.ucfirst($scope).'Suffix')); if (strpos($dn, $suffix)) $singlescope = $scope; } if (!isset($singlescope)) trigger_error(sprintf(_('Invalid dn: %s. DN not covered by any suffix.'), $dn), E_USER_WARN); @@ -308,10 +311,13 @@ class cache { */ function findgroups() { $dn_groups = $_SESSION['cache']->get_cache('cn', 'posixGroup', 'group'); - $DNs = array_keys($dn_groups); - foreach ($DNs as $DN) - $return[] = $dn_groups[$DN][0]; - return $return; + if (is_array($dn_groups)) { + $DNs = array_keys($dn_groups); + foreach ($DNs as $DN) + $return[] = $dn_groups[$DN][0]; + return $return; + } + return array(); }