aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/access.php15
-rw-r--r--engine/lib/group.php6
2 files changed, 9 insertions, 12 deletions
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}");
}
diff --git a/engine/lib/group.php b/engine/lib/group.php
index 2556001c5..5c09a93d9 100644
--- a/engine/lib/group.php
+++ b/engine/lib/group.php
@@ -765,7 +765,8 @@
* @param int $user_guid The user.
*/
function join_group($group_guid, $user_guid)
- {
+ {
+ trigger_elgg_event('join','group',array('group' => get_entity($group_guid), 'user' => get_entity($user_guid)));
return add_entity_relationship($user_guid, 'member', $group_guid);
}
@@ -776,7 +777,8 @@
* @param int $user_guid The user.
*/
function leave_group($group_guid, $user_guid)
- {
+ {
+ trigger_elgg_event('leave','group',array('group' => get_entity($group_guid), 'user' => get_entity($user_guid)));
return remove_entity_relationship($user_guid, 'member', $group_guid);
}