summaryrefslogtreecommitdiff
path: root/actions/unsubscribe.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/unsubscribe.php')
-rw-r--r--actions/unsubscribe.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php
index fabb7148e..1bf95fb61 100644
--- a/actions/unsubscribe.php
+++ b/actions/unsubscribe.php
@@ -24,6 +24,14 @@ class UnsubscribeAction extends Action {
common_user_error(_t('Not logged in.'));
return;
}
+
+ $user = common_current_user();
+
+ if ($_SERVER['REQUEST_METHOD'] != 'POST') {
+ common_redirect(common_local_url('subscriptions', array('nickname' => $user->nickname)));
+ return;
+ }
+
$other_nickname = $this->arg('unsubscribeto');
$other = User::staticGet('nickname', $other_nickname);
if (!$other) {
@@ -31,8 +39,6 @@ class UnsubscribeAction extends Action {
return;
}
- $user = common_current_user();
-
if (!$user->isSubscribed($other)) {
common_server_error(_t('Not subscribed!.'));
}