Code

Fixed caching for values using the skip_write parameter.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 25 Oct 2007 06:47:51 +0000 (06:47 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 25 Oct 2007 06:47:51 +0000 (06:47 +0000)
MyAccount plugins wasn't accessible anymore.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7649 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_userinfo.inc

index c479e9332a78d606ad750ddd8e0573c0258103f4..097c7ccdc90f2030cdd4cbc0d35b5e28ba0ff126 100644 (file)
@@ -191,7 +191,14 @@ class userinfo
   {
     /* Push cache answer? */
     if (isset($_SESSION['ACL_CACHE']["$dn+$object+$attribute"])){
-      return ($_SESSION['ACL_CACHE']["$dn+$object+$attribute"]);
+
+      /* Remove write if needed */
+      if ($skip_write){
+        $ret = preg_replace('/w/', '', $_SESSION['ACL_CACHE']["$dn+$object+$attribute"]);
+      }else{
+        $ret = $_SESSION['ACL_CACHE']["$dn+$object+$attribute"];
+      } 
+      return($ret);
     }
 
     $acl= array("r" => "", "w" => "", "c" => "", "d" => "", "m" => "", "a" => "");
@@ -266,12 +273,12 @@ class userinfo
       }
     }
 
+    $_SESSION['ACL_CACHE']["$dn+$object+$attribute"]= $ret;
+
     /* Remove write if needed */
     if ($skip_write){
       $ret= preg_replace('/w/', '', $ret);
     }
-
-    $_SESSION['ACL_CACHE']["$dn+$object+$attribute"]= $ret;
     return ($ret);
   }