aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/access.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-09-24 16:59:50 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-09-24 16:59:50 +0000
commit438a11e22e24fbff1921cec2c483b2728cb8a91b (patch)
tree0e66c5627176208e0e7be8cada9e4aff37306b18 /engine/lib/access.php
parent31ae28f30652e4dc67a5fe350f922289d14d5e37 (diff)
downloadelgg-438a11e22e24fbff1921cec2c483b2728cb8a91b.tar.gz
elgg-438a11e22e24fbff1921cec2c483b2728cb8a91b.tar.bz2
Returning cache control back to access permissions.
git-svn-id: https://code.elgg.org/elgg/trunk@2118 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/access.php')
-rw-r--r--engine/lib/access.php22
1 files changed, 19 insertions, 3 deletions
diff --git a/engine/lib/access.php b/engine/lib/access.php
index 313fc7476..f6fefe3bf 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -23,9 +23,9 @@
*/
function get_access_list($user_id = 0, $site_id = 0, $flush = false) {
- global $CONFIG;
+ global $CONFIG, $init_finished;
- //if (!isset($access_list))
+ if (!isset($access_list) || !$init_finished)
$access_list = array();
if ($user_id == 0) $user_id = $_SESSION['id'];
@@ -52,7 +52,7 @@
global $CONFIG;
static $access_array;
- //if (!isset($access_array))
+ if (!isset($access_array) || !$init_finished)
$access_array = array();
if ($user_id == 0) $user_id = $_SESSION['guid'];
@@ -431,4 +431,20 @@
define('ACCESS_PRIVATE',0);
define('ACCESS_LOGGED_IN',1);
define('ACCESS_PUBLIC',2);
+
+ global $init_finished;
+ $init_finished = false;
+
+ /**
+ * A quick and dirty way to make sure the access permissions have been correctly set up
+ *
+ */
+ function access_init() {
+ global $init_finished;
+ $init_finished = true;
+ }
+
+ // This function will let us know when 'init' has finished
+ register_elgg_event_handler('init','system','access_init',9999);
+
?> \ No newline at end of file