From 029cb4bebc0d9ef7a0f60a402406633e2995dea5 Mon Sep 17 00:00:00 2001 From: marcus Date: Tue, 23 Jun 2009 10:03:05 +0000 Subject: Action gatekeeper added to add and remove friends. git-svn-id: https://code.elgg.org/elgg/trunk@3349 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/friends/add.php | 3 ++- actions/friends/remove.php | 3 ++- mod/profile/views/default/profile/menu/actions.php | 10 +++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/actions/friends/add.php b/actions/friends/add.php index 9dd8397bc..74238b3a0 100644 --- a/actions/friends/add.php +++ b/actions/friends/add.php @@ -12,7 +12,8 @@ */ // Ensure we are logged in - gatekeeper(); + gatekeeper(); + action_gatekeeper(); // Get the GUID of the user to friend $friend_guid = get_input('friend'); diff --git a/actions/friends/remove.php b/actions/friends/remove.php index debb0f7c2..ef0cdb46e 100644 --- a/actions/friends/remove.php +++ b/actions/friends/remove.php @@ -12,7 +12,8 @@ */ // Ensure we are logged in - gatekeeper(); + gatekeeper(); + action_gatekeeper(); // Get the GUID of the user to friend $friend_guid = get_input('friend'); diff --git a/mod/profile/views/default/profile/menu/actions.php b/mod/profile/views/default/profile/menu/actions.php index d348831c1..2c26e2814 100644 --- a/mod/profile/views/default/profile/menu/actions.php +++ b/mod/profile/views/default/profile/menu/actions.php @@ -13,11 +13,15 @@ */ if (isloggedin()) { - if ($_SESSION['user']->getGUID() != $vars['entity']->getGUID()) { + if ($_SESSION['user']->getGUID() != $vars['entity']->getGUID()) { + + $ts = time(); + $token = generate_action_token($ts); + if ($vars['entity']->isFriend()) { - echo "

getGUID()}\">" . elgg_echo("friend:remove") . "

"; + echo "

getGUID()}&__elgg_token=$token&__elgg_ts=$ts\">" . elgg_echo("friend:remove") . "

"; } else { - echo "

getGUID()}\">" . elgg_echo("friend:add") . "

"; + echo "

getGUID()}&__elgg_token=$token&__elgg_ts=$ts\">" . elgg_echo("friend:add") . "

"; } } } -- cgit v1.2.3