diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2012-05-14 22:33:17 -0700 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2012-05-14 22:33:17 -0700 |
commit | 11e83f1864a17a98c794dd598731a5129aa8a8e7 (patch) | |
tree | 98d5ca571a104760fe92e5a4bfb7c0407f282268 /engine | |
parent | 9a59aa7a3cbb0e741b9b50b6b6ce8bd021b2479a (diff) | |
download | elgg-11e83f1864a17a98c794dd598731a5129aa8a8e7.tar.gz elgg-11e83f1864a17a98c794dd598731a5129aa8a8e7.tar.bz2 |
Making sure access calls don't get cached if access is disabled and it's the first call after $init_finished is set.
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/access.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/engine/lib/access.php b/engine/lib/access.php index 702e2c1cb..e8b3b0d52 100644 --- a/engine/lib/access.php +++ b/engine/lib/access.php @@ -51,8 +51,9 @@ function get_access_list($user_id = 0, $site_id = 0, $flush = false) { $access = "(" . implode(",", get_access_array($user_id, $site_id, $flush)) . ")"; - // only cache if done with init - if ($init_finished) { + // only cache if done with init and access is enabled (unless admin user) + // session is loaded before init is finished, so don't need to check for user session + if ($init_finished && (elgg_is_admin_logged_in() || !elgg_get_ignore_access())) { $access_list[$user_id] = $access; return $access_list[$user_id]; } else { @@ -143,8 +144,9 @@ function get_access_array($user_id = 0, $site_id = 0, $flush = false) { $tmp_access_array[] = ACCESS_PRIVATE; } - // only cache if done with init - if ($init_finished) { + // only cache if done with init and access is enabled (unless admin user) + // session is loaded before init is finished, so don't need to check for user session + if ($init_finished && (elgg_is_admin_logged_in() || !elgg_get_ignore_access())) { $access_array[$user_id] = $tmp_access_array; } } |