diff options
Diffstat (limited to 'actions/block.php')
-rw-r--r-- | actions/block.php | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/actions/block.php b/actions/block.php index b507af324..8956b79ba 100644 --- a/actions/block.php +++ b/actions/block.php @@ -95,6 +95,12 @@ class BlockAction extends Action { 'type' => 'hidden', 'value' => $id)); + foreach ($this->args as $k => $v) { + if (substr($k, 0, 9) == 'returnto-') { + common_hidden($k, $v); + } + } + common_submit('no', _('No')); common_submit('yes', _('Yes')); @@ -147,7 +153,21 @@ class BlockAction extends Action { $block->query('COMMIT'); - common_redirect(common_local_url('subscribers', - array('nickname' => $cur->nickname))); + # Now, gotta figure where we go back to + + foreach ($this->args as $k => $v) { + if ($k == 'returnto-action') { + $action = $v; + } else if (substr($k, 0, 9) == 'returnto-') { + $args[$k] = substr($k, 9); + } + } + + if ($action) { + common_redirect(common_local_url($action, $args)); + } else { + common_redirect(common_local_url('subscriptions', + array('nickname' => $cur->nickname))); + } } } |