From 3c083f6c4ff4d354a546e03477e7a4acbb16d4a9 Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 29 Dec 2010 18:16:54 +0000 Subject: rewrote the display of likes git-svn-id: http://code.elgg.org/elgg/trunk@7748 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/likes/add.php | 6 ++++++ actions/likes/delete.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'actions') diff --git a/actions/likes/add.php b/actions/likes/add.php index 3de1ebc51..9abe0b60e 100644 --- a/actions/likes/add.php +++ b/actions/likes/add.php @@ -20,6 +20,12 @@ if (!$entity) { forward(REFERER); } +// cannot like your own stuff +if (get_loggedin_userid() == $entity->getOwnerGUID()) { + register_error(elgg_echo("likes:no_self_like")); + forward(REFERER); +} + $user = get_loggedin_user(); $annotation = create_annotation($entity->guid, 'likes', diff --git a/actions/likes/delete.php b/actions/likes/delete.php index 45984b581..7ccf2de37 100644 --- a/actions/likes/delete.php +++ b/actions/likes/delete.php @@ -20,7 +20,7 @@ if ($likes = get_annotation($annotation_id)) { if ($likes->canEdit()) { $likes->delete(); system_message(elgg_echo("likes:deleted")); - forward($entity->getURL()); + forward(REFERER); } } else { -- cgit v1.2.3