Code

Improved cleanACL (10%)
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 29 Oct 2008 15:52:45 +0000 (15:52 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 29 Oct 2008 15:52:45 +0000 (15:52 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12809 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_userinfo.inc

index 0483ef2e61438ea7e7aea9b7a54a32fbad579545..62ca552772a1bfc303a952bb3d6abde2a2c27bfc 100644 (file)
@@ -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]= "";
         }
       }
     }