From 8422a0502f87ff85c0898287a3578cf387965586 Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 5 Aug 2008 19:20:17 +0000 Subject: Fixed group-specific access controls, and site-specific access controls git-svn-id: https://code.elgg.org/elgg/trunk@1720 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/access.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'engine/lib/access.php') diff --git a/engine/lib/access.php b/engine/lib/access.php index 29f87a1f8..d9f48e6e2 100644 --- a/engine/lib/access.php +++ b/engine/lib/access.php @@ -24,7 +24,6 @@ function get_access_list($user_id = 0, $site_id = 0, $flush = false) { global $CONFIG; - static $access_list; if (!isset($access_list)) $access_list = array(); @@ -34,11 +33,7 @@ $user_id = (int) $user_id; $site_id = (int) $site_id; - if (empty($access_list[$user_id]) || $flush == true) { - - $access_list[$user_id] = "(" . implode(",",get_access_array($user_id, $site_id, $flush)) . ")"; - - } + $access_list[$user_id] = "(" . implode(",",get_access_array($user_id, $site_id, $flush)) . ")"; return $access_list[$user_id]; @@ -55,13 +50,13 @@ function get_access_array($user_id = 0, $site_id = 0, $flush = false) { global $CONFIG; - static $access_array; if (!isset($access_array)) $access_array = array(); if ($user_id == 0) $user_id = $_SESSION['guid']; - if (($site_id == 0) && (isset($CONFIG->site_id))) $site_id = $CONFIG->site_id; + + if (($site_id == 0) && (isset($CONFIG->site_guid))) $site_id = $CONFIG->site_guid; $user_id = (int) $user_id; $site_id = (int) $site_id; @@ -188,6 +183,8 @@ */ function create_access_collection($name, $owner_guid = 0, $site_guid = 0) { + global $CONFIG; + $name = trim($name); if (empty($name)) return false; @@ -195,8 +192,6 @@ if (($site_id == 0) && (isset($CONFIG->site_id))) $site_id = $CONFIG->site_id; $name = sanitise_string($name); - global $CONFIG; - return insert_data("insert into {$CONFIG->dbprefix}access_collections set name = '{$name}', owner_guid = {$owner_guid}, site_guid = {$site_guid}"); } -- cgit v1.2.3