summaryrefslogtreecommitdiff
path: root/inc/actions.php
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2014-03-06 19:55:56 +0000
committerChristopher Smith <chris@jalakai.co.uk>2014-03-06 19:55:56 +0000
commit585bf44e2b756eac2e1cfce7035ef237bc02a788 (patch)
treea9b431951c39bbac03c125fc6a13d3cca15eba9e /inc/actions.php
parent1418498c406caca058076e3d148e31daee800551 (diff)
downloadrpg-585bf44e2b756eac2e1cfce7035ef237bc02a788.tar.gz
rpg-585bf44e2b756eac2e1cfce7035ef237bc02a788.tar.bz2
amend $_SERVER to $INPUT->server
Diffstat (limited to 'inc/actions.php')
-rw-r--r--inc/actions.php27
1 files changed, 18 insertions, 9 deletions
diff --git a/inc/actions.php b/inc/actions.php
index 240dce59a..ef09a0dc7 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -20,6 +20,7 @@ function act_dispatch(){
global $ID;
global $INFO;
global $QUERY;
+ /* @var Input $INPUT */
global $INPUT;
global $lang;
global $conf;
@@ -94,7 +95,7 @@ function act_dispatch(){
// user profile changes
if (in_array($ACT, array('profile','profile_delete'))) {
- if(!$_SERVER['REMOTE_USER']) {
+ if(!$INPUT->server->str('REMOTE_USER')) {
$ACT = 'login';
} else {
switch ($ACT) {
@@ -190,7 +191,7 @@ function act_dispatch(){
unset($evt);
// when action 'show', the intial not 'show' and POST, do a redirect
- if($ACT == 'show' && $preact != 'show' && strtolower($_SERVER['REQUEST_METHOD']) == 'post'){
+ if($ACT == 'show' && $preact != 'show' && strtolower($INPUT->server->str('REQUEST_METHOD')) == 'post'){
act_redirect($ID,$preact);
}
@@ -414,6 +415,8 @@ function act_revert($act){
global $ID;
global $REV;
global $lang;
+ /* @var Input $INPUT */
+ global $INPUT;
// FIXME $INFO['writable'] currently refers to the attic version
// global $INFO;
// if (!$INFO['writable']) {
@@ -445,7 +448,7 @@ function act_revert($act){
session_write_close();
// when done, show current page
- $_SERVER['REQUEST_METHOD'] = 'post'; //should force a redirect
+ $INPUT->server->set('REQUEST_METHOD','post'); //should force a redirect
$REV = '';
return 'show';
}
@@ -493,17 +496,20 @@ function act_redirect_execute($opts){
function act_auth($act){
global $ID;
global $INFO;
+ /* @var Input $INPUT */
+ global $INPUT;
//already logged in?
- if(isset($_SERVER['REMOTE_USER']) && $act=='login'){
+ if($INPUT->server->has('REMOTE_USER') && $act=='login'){
return 'show';
}
//handle logout
if($act=='logout'){
$lockedby = checklock($ID); //page still locked?
- if($lockedby == $_SERVER['REMOTE_USER'])
+ if($lockedby == $INPUT->server->str('REMOTE_USER')){
unlock($ID); //try to unlock
+ }
// do the logout stuff
auth_logoff();
@@ -719,10 +725,11 @@ function act_subscription($act){
global $lang;
global $INFO;
global $ID;
+ /* @var Input $INPUT */
global $INPUT;
// subcriptions work for logged in users only
- if(!$_SERVER['REMOTE_USER']) return 'show';
+ if(!$INPUT->server->str('REMOTE_USER')) return 'show';
// get and preprocess data.
$params = array();
@@ -745,9 +752,9 @@ function act_subscription($act){
// Perform action.
$sub = new Subscription();
if($action == 'unsubscribe'){
- $ok = $sub->remove($target, $_SERVER['REMOTE_USER'], $style);
+ $ok = $sub->remove($target, $INPUT->server->str('REMOTE_USER'), $style);
}else{
- $ok = $sub->add($target, $_SERVER['REMOTE_USER'], $style);
+ $ok = $sub->add($target, $INPUT->server->str('REMOTE_USER'), $style);
}
if($ok) {
@@ -776,6 +783,8 @@ function act_subscription($act){
function subscription_handle_post(&$params) {
global $INFO;
global $lang;
+ /* @var Input $INPUT */
+ global $INPUT;
// Get and validate parameters.
if (!isset($params['target'])) {
@@ -806,7 +815,7 @@ function subscription_handle_post(&$params) {
}
if ($is === false) {
throw new Exception(sprintf($lang['subscr_not_subscribed'],
- $_SERVER['REMOTE_USER'],
+ $INPUT->server->str('REMOTE_USER'),
prettyprint_id($target)));
}
// subscription_set deletes a subscription if style = null.