From: cajus Date: Wed, 29 Oct 2008 15:52:45 +0000 (+0000) Subject: Improved cleanACL (10%) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=38d1a0022be092554ccfd872f7a3ec96eddcca57;p=gosa.git Improved cleanACL (10%) git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12809 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_userinfo.inc b/gosa-core/include/class_userinfo.inc index 0483ef2e6..62ca55277 100644 --- a/gosa-core/include/class_userinfo.inc +++ b/gosa-core/include/class_userinfo.inc @@ -549,20 +549,25 @@ class userinfo function cleanACL($acl, $reset= FALSE) { - foreach ($acl as &$value){ + foreach ($acl as $key => $value){ + + /* Continue, if value is empty or permanent */ + if ($value == "" || $value == "p") { + continue; + } /* Reset removes everything but 'p' */ if ($reset && $value != 'p'){ - $value= ""; + $acl[$key]= ""; continue; } /* Decrease tree level */ if (is_int($value)){ if ($value){ - $value--; + $acl[$key]--; } else { - $value= ""; + $acl[$key]= ""; } } }