diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-06-30 13:28:51 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-06-30 13:28:51 +0000 |
commit | 0af3ab738efb2fe6ea14d33a7a8261cfdb60efb7 (patch) | |
tree | 4a366870cc8b4f44751edd9c3e6ccf960b6d01c8 /engine | |
parent | d3efc6c117d43e651a7e4e85162237311f5816cf (diff) | |
download | elgg-0af3ab738efb2fe6ea14d33a7a8261cfdb60efb7.tar.gz elgg-0af3ab738efb2fe6ea14d33a7a8261cfdb60efb7.tar.bz2 |
Modified output/confirmlink view to accept a class param.
user_remove_friend() uses remove_user_from_access_collection() instead of raw SQL.
Deleting an access collection prompts using output/confirmlink.
git-svn-id: https://code.elgg.org/elgg/trunk@3368 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/users.php | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php index 5f562845c..46636548b 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -561,24 +561,14 @@ $user_guid = (int) $user_guid;
$friend_guid = (int) $friend_guid;
- if (!remove_entity_relationship($user_guid, "friend", $friend_guid)){
- return false;
- }
// perform cleanup for access lists.
$collections = get_user_access_collections($user_guid);
- $in_arr = array();
foreach ($collections as $collection) {
- $in_arr[] = $collection->id;
+ remove_user_from_access_collection($friend_guid, $collection->id);
}
- $query = "DELETE FROM `{$CONFIG->dbprefix}access_collection_membership`
- WHERE `user_guid` = '$friend_guid'
- AND `access_collection_id` IN(" . implode($in_arr, ',') . ")";
- delete_data($query);
- // delete_data() might return nothing if no rows were affected.
- // the users has been removed already, so we safely return true.
- return true;
+ return remove_entity_relationship($user_guid, "friend", $friend_guid);
}
/**
|