summaryrefslogtreecommitdiff
path: root/lib/plugins/authad/auth.php
diff options
context:
space:
mode:
authorAnika Henke <anika@selfthinker.org>2013-11-02 13:10:14 +0000
committerAnika Henke <anika@selfthinker.org>2013-11-02 13:10:14 +0000
commitc5393ecb1aa570830d21e9dc95b4c21cd9aa9c01 (patch)
tree96e8dc34468a325596a5f94c85e38374fbc4b9ba /lib/plugins/authad/auth.php
parent71c1143e8785954ea00a62aeb755ca7d8fa47e56 (diff)
parent38d74b12176722ce52dc1905c13816a78a2551ee (diff)
downloadrpg-c5393ecb1aa570830d21e9dc95b4c21cd9aa9c01.tar.gz
rpg-c5393ecb1aa570830d21e9dc95b4c21cd9aa9c01.tar.bz2
Merge remote-tracking branch 'origin/master' into video-audio
Conflicts: inc/parser/xhtml.php
Diffstat (limited to 'lib/plugins/authad/auth.php')
-rw-r--r--lib/plugins/authad/auth.php26
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');
+ }
}
}