diff options
Diffstat (limited to 'engine/lib/access.php')
-rw-r--r-- | engine/lib/access.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/engine/lib/access.php b/engine/lib/access.php index f6fefe3bf..f52d839de 100644 --- a/engine/lib/access.php +++ b/engine/lib/access.php @@ -24,15 +24,18 @@ function get_access_list($user_id = 0, $site_id = 0, $flush = false) {
global $CONFIG, $init_finished;
+ static $access_list;
if (!isset($access_list) || !$init_finished)
$access_list = array();
-
+
if ($user_id == 0) $user_id = $_SESSION['id'];
if (($site_id == 0) && (isset($CONFIG->site_id))) $site_id = $CONFIG->site_id;
$user_id = (int) $user_id;
$site_id = (int) $site_id;
+ if (isset($access_list[$user_id])) return $access_list[$user_id];
+
$access_list[$user_id] = "(" . implode(",",get_access_array($user_id, $site_id, $flush)) . ")";
return $access_list[$user_id];
@@ -54,7 +57,7 @@ if (!isset($access_array) || !$init_finished)
$access_array = array();
-
+
if ($user_id == 0) $user_id = $_SESSION['guid'];
if (($site_id == 0) && (isset($CONFIG->site_guid))) $site_id = $CONFIG->site_guid;
|