From: cajus Date: Tue, 18 Sep 2007 10:04:48 +0000 (+0000) Subject: Added optimizations X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7ccc8e6b4d9f06f42c262212fce14caacc77ff3c;p=gosa.git Added optimizations git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7315 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_userinfo.inc b/include/class_userinfo.inc index ac33f535d..c3712521c 100644 --- a/include/class_userinfo.inc +++ b/include/class_userinfo.inc @@ -403,20 +403,20 @@ class userinfo function cleanACL($acl, $reset= FALSE) { - foreach ($acl as $key => $value){ + foreach ($acl as &$value){ /* Reset removes everything but 'p' */ if ($reset && $value != 'p'){ - $acl[$key]= ""; + $value= ""; continue; } /* Decrease tree level */ - if (preg_match('/^[0-9]+$/', $value)){ - if ($value > 0){ - $acl[$key]= $value - 1; + if (is_int($value)){ + if ($value){ + $value--; } else { - $acl[$key]= ""; + $value= ""; } } } diff --git a/include/functions.inc b/include/functions.inc index 7bf69aaf3..2280628a1 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -1957,10 +1957,10 @@ function array_key_ics($ikey, $items) function search_config(&$arr, $name, $return) { + $lname= strtolower($name); if (is_array($arr)){ foreach ($arr as $a){ - if (isset($a['CLASS']) && - strtolower($a['CLASS']) == strtolower($name)){ + if (isset($a['CLASS']) && strtolower($a['CLASS']) == $lname){ if (isset($a[$return])){ return ($a[$return]);