summaryrefslogtreecommitdiff
path: root/lib/subs.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/subs.php')
-rw-r--r--lib/subs.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/subs.php b/lib/subs.php
index 2fc3160de..4b6b03967 100644
--- a/lib/subs.php
+++ b/lib/subs.php
@@ -127,6 +127,12 @@ function subs_unsubscribe_to($user, $other)
if (!$user->isSubscribed($other))
return _('Not subscribed!');
+ // Don't allow deleting self subs
+
+ if ($user->id == $other->id) {
+ return _('Couldn\'t delete self-subscription.');
+ }
+
$sub = DB_DataObject::factory('subscription');
$sub->subscriber = $user->id;