From 484c83ff60fc5a427dd9e18be1c504d3dbb6e337 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 22 Oct 2007 12:27:14 +0000 Subject: [PATCH] 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 --- include/class_userinfo.inc | 6 ++++++ 1 file changed, 6 insertions(+) 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); } -- 2.30.2