aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-17 15:45:13 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-17 15:45:13 +0000
commitd4ff6d2fc37c2b1f99538b67838b3269002e84b0 (patch)
tree0ec7f4714602d7dc08071f496c8ee6dd5a2c917d /engine/lib
parentaa3ea214f65cdd49adc5d2c6047127c4bd7cc7c8 (diff)
downloadelgg-d4ff6d2fc37c2b1f99538b67838b3269002e84b0.tar.gz
elgg-d4ff6d2fc37c2b1f99538b67838b3269002e84b0.tar.bz2
New access control hooks
git-svn-id: https://code.elgg.org/elgg/trunk@1457 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/access.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/engine/lib/access.php b/engine/lib/access.php
index ddf4b9a93..839d96989 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -65,6 +65,9 @@
$user_id = (int) $user_id;
$site_id = (int) $site_id;
+ if (!$user = get_entity($user_id))
+ $user = null;
+
if (empty($access_array[$user_id]) || $flush == true) {
$query = "select am.access_group_id from {$CONFIG->dbprefix}access_group_membership am ";
@@ -84,7 +87,9 @@
}
- return $access_array[$user_id];
+ $access_array_temp = trigger_plugin_hook('access:groups','user',array('user' => $user, 'site_id' => $site_id),$access_array[$user_id]);
+
+ return $access_array_temp;
}
@@ -138,6 +143,9 @@
$user_id = (int) $user_id;
$site_id = (int) $site_id;
+ if (!$user = get_entity($user_id))
+ $user = null;
+
if (empty($access_array[$user_id]) || $flush == true) {
$query = "select ag.* from {$CONFIG->dbprefix}access_groups ag ";
@@ -150,13 +158,13 @@
$tmp_access_array[$group->id] = elgg_echo($group->name);
}
- $tmp_access_array = trigger_plugin_hook('access','user',array('user_id' => $user_id, 'site_id' => $site_id),$tmp_access_array);
-
$access_array[$user_id] = $tmp_access_array;
}
- return $access_array[$user_id];
+ $tmp_access_array = trigger_plugin_hook('access','user',array('user' => $user, 'site_id' => $site_id),$tmp_access_array);
+
+ return $tmp_access_array;
}