aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-29 18:16:54 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-29 18:16:54 +0000
commit3c083f6c4ff4d354a546e03477e7a4acbb16d4a9 (patch)
tree961ad1135905070b95a51bc0c6bdbd948754b562 /actions
parent298114995174acf451cc1477fdeec34a42ef608b (diff)
downloadelgg-3c083f6c4ff4d354a546e03477e7a4acbb16d4a9.tar.gz
elgg-3c083f6c4ff4d354a546e03477e7a4acbb16d4a9.tar.bz2
rewrote the display of likes
git-svn-id: http://code.elgg.org/elgg/trunk@7748 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions')
-rw-r--r--actions/likes/add.php6
-rw-r--r--actions/likes/delete.php2
2 files changed, 7 insertions, 1 deletions
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 {