summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/nudge.php3
-rw-r--r--actions/subscribe.php17
-rw-r--r--actions/unsubscribe.php15
3 files changed, 27 insertions, 8 deletions
diff --git a/actions/nudge.php b/actions/nudge.php
index 822606d30..f14cdc83c 100644
--- a/actions/nudge.php
+++ b/actions/nudge.php
@@ -32,9 +32,6 @@ class NudgeAction extends Action {
}
$user = common_current_user();
-// $other_nickname = common_canonical_nickname($args['nickname']);
-// $other_nickname = $this->arg('nickname');
-// $other = User::staticGet('nickname', $other_nickname);
$other = User::staticGet('nickname', $this->arg('nickname'));
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
diff --git a/actions/subscribe.php b/actions/subscribe.php
index 20c258923..10951dc3b 100644
--- a/actions/subscribe.php
+++ b/actions/subscribe.php
@@ -53,8 +53,19 @@ class SubscribeAction extends Action {
common_user_error($result);
return;
}
-
- common_redirect(common_local_url('subscriptions', array('nickname' =>
+
+ if ($this->boolean('ajax')) {
+ common_start_html('text/xml');
+ common_element_start('head');
+ common_element('title', null, _('Subscribed'));
+ common_element_end('head');
+ common_element_start('body');
+ common_subscribe_response();
+ common_element_end('body');
+ common_element_end('html');
+ } else {
+ common_redirect(common_local_url('subscriptions', array('nickname' =>
$user->nickname)));
+ }
}
-} \ No newline at end of file
+}
diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php
index 4bfaf7958..562dd00fc 100644
--- a/actions/unsubscribe.php
+++ b/actions/unsubscribe.php
@@ -49,7 +49,18 @@ class UnsubscribeAction extends Action {
return;
}
- common_redirect(common_local_url('subscriptions', array('nickname' =>
- $user->nickname)));
+ if ($this->boolean('ajax')) {
+ common_start_html('text/xml');
+ common_element_start('head');
+ common_element('title', null, _('Unsubscribed'));
+ common_element_end('head');
+ common_element_start('body');
+ common_unsubscribe_response();
+ common_element_end('body');
+ common_element_end('html');
+ } else {
+ common_redirect(common_local_url('subscriptions', array('nickname' =>
+ $user->nickname)));
+ }
}
}