aboutsummaryrefslogtreecommitdiff
path: root/actions/friends/remove.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/friends/remove.php')
-rw-r--r--actions/friends/remove.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/actions/friends/remove.php b/actions/friends/remove.php
index 786b5975b..d69d18f31 100644
--- a/actions/friends/remove.php
+++ b/actions/friends/remove.php
@@ -6,9 +6,6 @@
* @subpackage Friends.Management
*/
-// Ensure we are logged in
-gatekeeper();
-
// Get the GUID of the user to friend
$friend_guid = get_input('friend');
$friend = get_entity($friend_guid);
@@ -17,18 +14,18 @@ $errors = false;
// Get the user
try{
if ($friend instanceof ElggUser) {
- get_loggedin_user()->removeFriend($friend_guid);
+ elgg_get_logged_in_user_entity()->removeFriend($friend_guid);
} else {
- register_error(sprintf(elgg_echo("friends:remove:failure"), $friend->name));
+ register_error(elgg_echo("friends:remove:failure", array($friend->name)));
$errors = true;
}
} catch (Exception $e) {
- register_error(sprintf(elgg_echo("friends:remove:failure"), $friend->name));
+ register_error(elgg_echo("friends:remove:failure", array($friend->name)));
$errors = true;
}
if (!$errors) {
- system_message(sprintf(elgg_echo("friends:remove:successful"), $friend->name));
+ system_message(elgg_echo("friends:remove:successful", array($friend->name)));
}
// Forward back to the page you made the friend on