summaryrefslogtreecommitdiff
path: root/actions/subscribe.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-07-05 17:36:37 -0400
committerEvan Prodromou <evan@prodromou.name>2008-07-05 17:36:37 -0400
commit293ad758f76143cf0e23c8d4a65f66d8a1ba7bab (patch)
tree78630d6c9291c3c66bc82becb002a390062a4a68 /actions/subscribe.php
parenta050b2f1d99eb0b1d83c339ae888a3538609207c (diff)
if not a POST, redirect to subscriptions
darcs-hash:20080705213637-84dde-87ceb18bfc0db5248083bae1b9ce7ef088a68fe2.gz
Diffstat (limited to 'actions/subscribe.php')
-rw-r--r--actions/subscribe.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/actions/subscribe.php b/actions/subscribe.php
index 9a1d43fa5..fe683828a 100644
--- a/actions/subscribe.php
+++ b/actions/subscribe.php
@@ -28,6 +28,13 @@ class SubscribeAction extends Action {
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('subscribeto');
$other = User::staticGet('nickname', $other_nickname);
@@ -37,8 +44,6 @@ class SubscribeAction extends Action {
return;
}
- $user = common_current_user();
-
if ($user->isSubscribed($other)) {
common_user_error(_t('Already subscribed!.'));
return;