From: marcus Date: Tue, 23 Jun 2009 10:03:05 +0000 (+0000) Subject: Action gatekeeper added to add and remove friends. X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=029cb4bebc0d9ef7a0f60a402406633e2995dea5;p=lorea%2Felgg.git Action gatekeeper added to add and remove friends. git-svn-id: https://code.elgg.org/elgg/trunk@3349 36083f99-b078-4883-b0ff-0f9b5a30f544 --- 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") . "

"; } } }