From 0af3ab738efb2fe6ea14d33a7a8261cfdb60efb7 Mon Sep 17 00:00:00 2001 From: brettp Date: Tue, 30 Jun 2009 13:28:51 +0000 Subject: 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 --- engine/lib/users.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'engine/lib/users.php') 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); } /** -- cgit v1.2.3