diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-13 09:15:29 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-13 09:15:29 +0000 |
commit | 851a05cb77d9b33e7b853ee985d8278abde55545 (patch) | |
tree | 900909334d8055909755b918f51f107367426ba7 /engine/lib/access.php | |
parent | e42621f802c25c0284f33e6236d971c728f20f7c (diff) | |
download | elgg-851a05cb77d9b33e7b853ee985d8278abde55545.tar.gz elgg-851a05cb77d9b33e7b853ee985d8278abde55545.tar.bz2 |
Admins now see all!
git-svn-id: https://code.elgg.org/elgg/trunk@1873 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/access.php')
-rw-r--r-- | engine/lib/access.php | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/engine/lib/access.php b/engine/lib/access.php index 66eee69ed..b38025c2c 100644 --- a/engine/lib/access.php +++ b/engine/lib/access.php @@ -83,10 +83,11 @@ if (!empty($collection->id)) $tmp_access_array[] = $collection->id;
}
- /*if ($user = get_entity($user_id)) {
- if ($user instanceof ElggUser && $user->admin)
- $tmp_access_array[] = 0;
- }*/
+ global $is_admin;
+
+ if (isset($is_admin) && $is_admin == true) {
+ $tmp_access_array[] = 0;
+ }
$access_array[$user_id] = $tmp_access_array;
@@ -94,8 +95,6 @@ $tmp_access_array = $access_array[$user_id];
}
- $tmp_access_array = trigger_plugin_hook('access:collections','user',array('user_id' => $user_id, 'site_id' => $site_id),$tmp_access_array);
-
return $access_array[$user_id];
}
@@ -116,25 +115,20 @@ if ($table_prefix)
$table_prefix = sanitise_string($table_prefix) . ".";
- //if (!is_privileged())
- //{
$access = get_access_list(); $owner = $_SESSION['id']; if (!$owner) $owner = -1;
- /*if ($owner_entity = get_entity($owner)) {
- if ($owner_entity instanceof ElggUser)
- if ($owner_entity->admin)
- $sql = " (1 = 1) ";
+ global $is_admin;
+
+ if (isset($is_admin) && $is_admin == true) {
+ $sql = " (1 = 1) ";
}
- if (empty($sql))*/
+
+ if (empty($sql))
$sql = " ({$table_prefix}access_id in {$access} or ({$table_prefix}access_id = 0 and {$table_prefix}owner_guid = $owner))";
- //}
- //else
- // $sql = " 1 ";
-
- // Only return 'active' objects
+
$sql .= " and {$table_prefix}enabled='yes'";
return $sql;
|