aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/users.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r--engine/lib/users.php14
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);
}
/**