summaryrefslogtreecommitdiff
path: root/inc/subscription.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/subscription.php
parent1418498c406caca058076e3d148e31daee800551 (diff)
downloadrpg-585bf44e2b756eac2e1cfce7035ef237bc02a788.tar.gz
rpg-585bf44e2b756eac2e1cfce7035ef237bc02a788.tar.bz2
amend $_SERVER to $INPUT->server
Diffstat (limited to 'inc/subscription.php')
-rw-r--r--inc/subscription.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/inc/subscription.php b/inc/subscription.php
index ddf30706b..adf1b821c 100644
--- a/inc/subscription.php
+++ b/inc/subscription.php
@@ -256,8 +256,10 @@ class Subscription {
if(!$this->isenabled()) return false;
global $ID;
+ /** @var Input $INPUT */
+ global $INPUT;
if(!$id) $id = $ID;
- if(!$user) $user = $_SERVER['REMOTE_USER'];
+ if(!$user) $user = $INPUT->server->str('REMOTE_USER');
$subs = $this->subscribers($id, $user);
if(!count($subs)) return false;
@@ -292,13 +294,15 @@ class Subscription {
global $auth;
global $conf;
global $USERINFO;
+ /** @var Input $INPUT */
+ global $INPUT;
$count = 0;
$subscriptions = $this->subscribers($page, null, array('digest', 'list'));
// remember current user info
$olduinfo = $USERINFO;
- $olduser = $_SERVER['REMOTE_USER'];
+ $olduser = $INPUT->server->str('REMOTE_USER');
foreach($subscriptions as $target => $users) {
if(!$this->lock($target)) continue;
@@ -315,7 +319,7 @@ class Subscription {
// Work as the user to make sure ACLs apply correctly
$USERINFO = $auth->getUserData($user);
- $_SERVER['REMOTE_USER'] = $user;
+ $INPUT->server->set('REMOTE_USER',$user);
if($USERINFO === false) continue;
if(!$USERINFO['mail']) continue;
@@ -334,7 +338,7 @@ class Subscription {
foreach($changes as $rev) {
$n = 0;
while(!is_null($rev) && $rev['date'] >= $lastupdate &&
- ($_SERVER['REMOTE_USER'] === $rev['user'] ||
+ ($INPUT->server->str('REMOTE_USER') === $rev['user'] ||
$rev['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT)) {
$rev = getRevisions($rev['id'], $n++, 1);
$rev = (count($rev) > 0) ? $rev[0] : null;
@@ -369,7 +373,7 @@ class Subscription {
// restore current user info
$USERINFO = $olduinfo;
- $_SERVER['REMOTE_USER'] = $olduser;
+ $INPUT->server->set('REMOTE_USER',$olduser);
return $count;
}
@@ -654,6 +658,8 @@ class Subscription {
/** @var DokuWiki_Auth_Plugin $auth */
global $auth;
global $conf;
+ /** @var Input $INPUT */
+ global $INPUT;
$id = $data['id'];
$self = $data['self'];
@@ -667,7 +673,7 @@ class Subscription {
$userinfo = $auth->getUserData($user);
if($userinfo === false) continue;
if(!$userinfo['mail']) continue;
- if(!$self && $user == $_SERVER['REMOTE_USER']) continue; //skip our own changes
+ if(!$self && $user == $INPUT->server->str('REMOTE_USER')) continue; //skip our own changes
$level = auth_aclcheck($id, $user, $userinfo['grps']);
if($level >= AUTH_READ) {