removed in_cache()

This commit is contained in:
Roland Gruber 2009-11-26 13:32:48 +00:00
parent 112a320555
commit 83b8b25506
1 changed files with 0 additions and 37 deletions

View File

@ -130,43 +130,6 @@ class cache {
return $return;
}
/**
* This function returns the DN if an LDAP entry with $attribute=$value is found.
*
* @param string $value is the searched value of the attribute $attribute
* @param string $attribute name of the LDAP attribute
* @param mixed $scopelist the account type(s) as string or array, all scopes if NULL given
*/
function in_cache($value, $attribute, $scopelist) {
$this->refresh_cache();
if (is_array($scopelist)) $scopes = $scopelist;
elseif (is_string($scopelist)) $scopes = array($scopelist);
else $scopes = getTypes();
// Add cache entry dynamic
$add = array();
foreach ($scopes as $scope) {
if (!@in_array($attribute ,$this->attributes[$scope])) $add[$scope][] = $attribute;
}
if (count($add)!=0) $this->add_cache($add);
foreach ($scopes as $scope) {
if (isset($this->ldapcache[$scope])) {
$DNs = array_keys($this->ldapcache[$scope]);
foreach ($DNs as $dn) {
if (is_array($this->ldapcache[$scope][$dn][$attribute])) {
if (in_array($value, $this->ldapcache[$scope][$dn][$attribute])) {
// Return value if value was found
return $dn;
}
}
}
}
}
// Return false if value wasn't found
return false;
}
/**
* This function refreshes the cache.
*