Code

Cache results from get_module_departments.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Oct 2007 12:27:14 +0000 (12:27 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Oct 2007 12:27:14 +0000 (12:27 +0000)
It took 2 seconds sometimes...

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

include/class_userinfo.inc

index 2c46e9efcd63f72ca88a5fe53b5824f4845b36e5..c479e9332a78d606ad750ddd8e0573c0258103f4 100644 (file)
@@ -280,6 +280,11 @@ class userinfo
      accessible department) */
   function get_module_departments($module)
   {
+    /* Use cached results if possilbe */
+    if(isset($_SESSION['ACL_CACHE']['MODULE_DEPARTMENTS'][serialize($module)])){
+      return($_SESSION['ACL_CACHE']['MODULE_DEPARTMENTS'][serialize($module)]);
+    }
+
     global $plist;
 
     $objects= array();
@@ -372,6 +377,7 @@ class userinfo
       }
     }
 
+    $_SESSION['ACL_CACHE']['MODULE_DEPARTMENTS'][serialize($module)] = $deps;
     return ($deps);
   }