diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2013-11-19 21:26:50 +0100 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2013-11-19 21:26:50 +0100 |
commit | 703aeaef1a43b07dc5497dba72c98151466396cc (patch) | |
tree | 1e18a6b3fc3c28156c2e56f8a3d515b8dd6a9cf9 /lib/plugins/authad/auth.php | |
parent | 33c3b3817b00aa9384760813643fac0e33daaaff (diff) | |
parent | 14b3007921f7b66fc9e3621b861a3c83e7e9093c (diff) | |
download | rpg-703aeaef1a43b07dc5497dba72c98151466396cc.tar.gz rpg-703aeaef1a43b07dc5497dba72c98151466396cc.tar.bz2 |
Merge remote-tracking branch 'origin/master' into diff_navigation
Diffstat (limited to 'lib/plugins/authad/auth.php')
-rw-r--r-- | lib/plugins/authad/auth.php | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index fcbd2eeef..e1d758fb8 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -92,16 +92,24 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { } // Prepare SSO - if(!utf8_check($_SERVER['REMOTE_USER'])) { - $_SERVER['REMOTE_USER'] = utf8_encode($_SERVER['REMOTE_USER']); - } - if($_SERVER['REMOTE_USER'] && $this->conf['sso']) { - $_SERVER['REMOTE_USER'] = $this->cleanUser($_SERVER['REMOTE_USER']); + if(!empty($_SERVER['REMOTE_USER'])) { + + // make sure the right encoding is used + if($this->getConf('sso_charset')) { + $_SERVER['REMOTE_USER'] = iconv($this->getConf('sso_charset'), 'UTF-8', $_SERVER['REMOTE_USER']); + } elseif(!utf8_check($_SERVER['REMOTE_USER'])) { + $_SERVER['REMOTE_USER'] = utf8_encode($_SERVER['REMOTE_USER']); + } - // we need to simulate a login - if(empty($_COOKIE[DOKU_COOKIE])) { - $INPUT->set('u', $_SERVER['REMOTE_USER']); - $INPUT->set('p', 'sso_only'); + // trust the incoming user + if($this->conf['sso']) { + $_SERVER['REMOTE_USER'] = $this->cleanUser($_SERVER['REMOTE_USER']); + + // we need to simulate a login + if(empty($_COOKIE[DOKU_COOKIE])) { + $INPUT->set('u', $_SERVER['REMOTE_USER']); + $INPUT->set('p', 'sso_only'); + } } } |