From: hickert Date: Mon, 22 Oct 2007 12:27:14 +0000 (+0000) Subject: Cache results from get_module_departments. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=484c83ff60fc5a427dd9e18be1c504d3dbb6e337;p=gosa.git Cache results from get_module_departments. It took 2 seconds sometimes... git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7620 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_userinfo.inc b/include/class_userinfo.inc index 2c46e9efc..c479e9332 100644 --- a/include/class_userinfo.inc +++ b/include/class_userinfo.inc @@ -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); }