fixed problems. Sometimes Code was returned as unicode and not as local code

This commit is contained in:
katagia 2004-09-28 16:42:12 +00:00
parent 565a5a2c9e
commit 174539d53f
1 changed files with 8 additions and 3 deletions

View File

@ -211,7 +211,9 @@ class cache {
// unset every count entry // unset every count entry
unset ($attr['count']); unset ($attr['count']);
$attributes = array_keys($attr); $attributes = array_keys($attr);
foreach ($attributes as $attribute) unset ($attr[$attribute]['count']); foreach ($attributes as $attribute) {
unset ($attr[$attribute]['count']);
}
// unset double entries // unset double entries
for ($i=0; $i<count($attr); $i++) { for ($i=0; $i<count($attr); $i++) {
if (isset($attr[$i])) unset($attr[$i]); if (isset($attr[$i])) unset($attr[$i]);
@ -219,6 +221,9 @@ class cache {
// Write new cache entry // Write new cache entry
$addcache = $attr; $addcache = $attr;
unset ($addcache['objectClass']); unset ($addcache['objectClass']);
foreach ($addcache as $temp)
foreach ($temp as $temp2)
$temp2 = utf8_decode($temp2);
if (count($addcache)!=0) $this->ldapcache[$scope][$dn] = $attr; if (count($addcache)!=0) $this->ldapcache[$scope][$dn] = $attr;
$entry = ldap_next_entry($_SESSION['ldap']->server(), $entry); $entry = ldap_next_entry($_SESSION['ldap']->server(), $entry);
} }
@ -306,7 +311,7 @@ class cache {
if (is_array($dn_groups)) { if (is_array($dn_groups)) {
$DNs = array_keys($dn_groups); $DNs = array_keys($dn_groups);
foreach ($DNs as $DN) foreach ($DNs as $DN)
$return[] = $dn_groups[$DN][0]; $return[] = utf8_decode($dn_groups[$DN][0]);
return $return; return $return;
} }
return array(); return array();
@ -322,7 +327,7 @@ class cache {
$DNs = array_keys($dn_groups); $DNs = array_keys($dn_groups);
foreach ($DNs as $DN) { foreach ($DNs as $DN) {
if ($dn_groups[$DN][0]==$gidNumber) if ($dn_groups[$DN][0]==$gidNumber)
$return = substr($DN, 3, strpos($DN, ',')-3); $return = utf8_decode(substr($DN, 3, strpos($DN, ',')-3));
} }
return $return; return $return;
} }