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 --- mod/profile/views/default/profile/menu/actions.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'mod/profile/views/default') 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