diff options
author | fiwswe <53953985+fiwswe@users.noreply.github.com> | 2022-09-21 23:13:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-21 23:13:41 +0200 |
commit | 1ab7d624dbb1f6764ba6af3be9f580154efcbd06 (patch) | |
tree | 8c402bce03cd436a3296c1529bdcfe87880d7dfe | |
parent | ce0feb5f5c38d0e698bd162105fbe61ceb27fca8 (diff) | |
download | dokuwiki-1ab7d624dbb1f6764ba6af3be9f580154efcbd06.tar.gz dokuwiki-1ab7d624dbb1f6764ba6af3be9f580154efcbd06.zip |
Revert: Messed up PR #3774
The previuos commit was added to PR #3774 by mistake. reverting now.
-rw-r--r-- | lib/plugins/authad/auth.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index b5447e8d9..05d3a11bd 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -97,21 +97,21 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin } // Prepare SSO - if (!empty($INPUT->server->str('REMOTE_USER'))) { + if (!empty($_SERVER['REMOTE_USER'])) { // make sure the right encoding is used if ($this->getConf('sso_charset')) { - $INPUT->server->set('REMOTE_USER', iconv($this->getConf('sso_charset'), 'UTF-8', $INPUT->server->str('REMOTE_USER'))); - } elseif (!\dokuwiki\Utf8\Clean::isUtf8($INPUT->server->str('REMOTE_USER'))) { - $INPUT->server->set('REMOTE_USER', utf8_encode($INPUT->server->str('REMOTE_USER'))); + $_SERVER['REMOTE_USER'] = iconv($this->getConf('sso_charset'), 'UTF-8', $_SERVER['REMOTE_USER']); + } elseif (!\dokuwiki\Utf8\Clean::isUtf8($_SERVER['REMOTE_USER'])) { + $_SERVER['REMOTE_USER'] = utf8_encode($_SERVER['REMOTE_USER']); } // trust the incoming user if ($this->conf['sso']) { - $INPUT->server->set('REMOTE_USER', $this->cleanUser($INPUT->server->str('REMOTE_USER'))); + $_SERVER['REMOTE_USER'] = $this->cleanUser($_SERVER['REMOTE_USER']); // we need to simulate a login if (empty($_COOKIE[DOKU_COOKIE])) { - $INPUT->set('u', $INPUT->server->str('REMOTE_USER')); + $INPUT->set('u', $_SERVER['REMOTE_USER']); $INPUT->set('p', 'sso_only'); } } @@ -131,9 +131,8 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin */ public function canDo($cap) { - global $INPUT; //capabilities depend on config, which may change depending on domain - $domain = $this->getUserDomain($INPUT->server->str('REMOTE_USER')); + $domain = $this->getUserDomain($_SERVER['REMOTE_USER']); $this->loadServerConfig($domain); return parent::canDo($cap); } @@ -152,8 +151,8 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin */ public function checkPass($user, $pass) { - global $INPUT; - if ($INPUT->server->str('REMOTE_USER') == $user && + if ($_SERVER['REMOTE_USER'] && + $_SERVER['REMOTE_USER'] == $user && $this->conf['sso'] ) return true; @@ -198,7 +197,6 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin global $conf; global $lang; global $ID; - global $INPUT; $adldap = $this->initAdLdap($this->getUserDomain($user)); if (!$adldap) return array(); @@ -264,7 +262,7 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin $info['expiresin'] = round(($info['expiresat'] - time())/(24*60*60)); // if this is the current user, warn him (once per request only) - if (($INPUT->server->str('REMOTE_USER') == $user) && + if (($_SERVER['REMOTE_USER'] == $user) && ($info['expiresin'] <= $this->conf['expirywarn']) && !$this->msgshown ) { |