summaryrefslogtreecommitdiff
path: root/inc/actions.php
diff options
context:
space:
mode:
authorAndreas Gohr <gohr@cosmocode.de>2009-11-30 14:03:11 +0100
committerAdrian Lang <lang@cosmocode.de>2010-01-20 10:53:25 +0100
commit056c20495937fe45fe0f7204b112dbfe6931a855 (patch)
treea994bc7c4850e1c9a54efb55fd8d7913b12cd265 /inc/actions.php
parentcb3f9dbab0cf12b2a7486cca0de17c47399633f3 (diff)
downloadrpg-056c20495937fe45fe0f7204b112dbfe6931a855.tar.gz
rpg-056c20495937fe45fe0f7204b112dbfe6931a855.tar.bz2
nicer subscription styles
Ignore-this: e1b3b815b5ebb0da320bff997c4fed4b darcs-hash:20091130130311-6e07b-03ccfc52abb3dcc0764eed5784d81f8416841328.gz
Diffstat (limited to 'inc/actions.php')
-rw-r--r--inc/actions.php20
1 files changed, 9 insertions, 11 deletions
diff --git a/inc/actions.php b/inc/actions.php
index 900409a90..1fda0584e 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -558,19 +558,21 @@ function act_export($act){
* @author Adrian Lang <lang@cosmocode.de>
*/
function act_subscription($act){
- if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
- // No post to handle, let tpl_subscribe manage the request.
- return $act;
- }
+ global $lang;
+ global $INFO;
+ global $ID;
- // Get and preprocess data.
+ // get and preprocess data.
$params = array();
foreach(array('target', 'style', 'action') as $param) {
- if (isset($_POST["subscribe_$param"])) {
- $params[$param] = $_POST["subscribe_$param"];
+ if (isset($_REQUEST["sub_$param"])) {
+ $params[$param] = $_REQUEST["sub_$param"];
}
}
+ // any action given? if not just return and show the subscription page
+ if(!$params['action']) return $act;
+
// Handle POST data, may throw exception.
trigger_event('ACTION_HANDLE_SUBSCRIBE', $params, 'subscription_handle_post');
@@ -579,9 +581,6 @@ function act_subscription($act){
$data = $params['data'];
$action = $params['action'];
- global $lang;
- global $INFO;
-
// Perform action.
require_once DOKU_INC . 'inc/subscription.php';
if (!subscription_set($_SERVER['REMOTE_USER'], $target, $style, $data)) {
@@ -591,7 +590,6 @@ function act_subscription($act){
}
msg(sprintf($lang["subscr_{$action}_success"], hsc($INFO['userinfo']['name']),
prettyprint_id($target)), 1);
- global $ID;
act_redirect($ID, $act);
// Assure that we have valid data if act_redirect somehow fails.