From f4476bd9b5badd36cd0617d76538e47d9649986b Mon Sep 17 00:00:00 2001 From: Jan Schumann Date: Mon, 20 Feb 2012 19:51:26 +0100 Subject: Refactored auth system: All auth methods are now introduced as plugins. --- lib/plugins/authad/auth.php | 359 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 359 insertions(+) create mode 100644 lib/plugins/authad/auth.php (limited to 'lib/plugins/authad/auth.php') diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php new file mode 100644 index 000000000..70d3cfb8c --- /dev/null +++ b/lib/plugins/authad/auth.php @@ -0,0 +1,359 @@ + + */ +// must be run within Dokuwiki +if(!defined('DOKU_INC')) die(); + +require_once(DOKU_INC.'inc/adLDAP.php'); + +/** + * Active Directory authentication backend for DokuWiki + * + * This makes authentication with a Active Directory server much easier + * than when using the normal LDAP backend by utilizing the adLDAP library + * + * Usage: + * Set DokuWiki's local.protected.php auth setting to read + * + * $conf['useacl'] = 1; + * $conf['disableactions'] = 'register'; + * $conf['autopasswd'] = 0; + * $conf['authtype'] = 'authad'; + * $conf['passcrypt'] = 'ssha'; + * + * $conf['plugin']['authad']['account_suffix'] = '@my.domain.org'; + * $conf['plugin']['authad']['base_dn'] = 'DC=my,DC=domain,DC=org'; + * $conf['plugin']['authad']['domain_controllers'] = 'srv1.domain.org,srv2.domain.org'; + * + * //optional: + * $conf['plugin']['authad']['sso'] = 1; + * $conf['plugin']['authad']['ad_username'] = 'root'; + * $conf['plugin']['authad']['ad_password'] = 'pass'; + * $conf['plugin']['authad']['real_primarygroup'] = 1; + * $conf['plugin']['authad']['use_ssl'] = 1; + * $conf['plugin']['authad']['use_tls'] = 1; + * $conf['plugin']['authad']['debug'] = 1; + * + * // get additional information to the userinfo array + * // add a list of comma separated ldap contact fields. + * $conf['plugin']['authad']['additional'] = 'field1,field2'; + * + * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) + * @author James Van Lommel + * @link http://www.nosq.com/blog/2005/08/ldap-activedirectory-and-dokuwiki/ + * @author Andreas Gohr + * @author Jan Schumann + */ +class auth_plugin_authad extends DokuWiki_Auth_Plugin +{ + var $cnf = null; + var $opts = null; + var $adldap = null; + var $users = null; + + /** + * Constructor + */ + function auth_plugin_authad() { + global $conf; + $this->cnf = $conf['auth']['ad']; + + + // additional information fields + if (isset($this->cnf['additional'])) { + $this->cnf['additional'] = str_replace(' ', '', $this->cnf['additional']); + $this->cnf['additional'] = explode(',', $this->cnf['additional']); + } else $this->cnf['additional'] = array(); + + // ldap extension is needed + if (!function_exists('ldap_connect')) { + if ($this->cnf['debug']) + msg("AD Auth: PHP LDAP extension not found.",-1); + $this->success = false; + return; + } + + // Prepare SSO + if($_SERVER['REMOTE_USER'] && $this->cnf['sso']){ + // remove possible NTLM domain + list($dom,$usr) = explode('\\',$_SERVER['REMOTE_USER'],2); + if(!$usr) $usr = $dom; + + // remove possible Kerberos domain + list($usr,$dom) = explode('@',$usr); + + $dom = strtolower($dom); + $_SERVER['REMOTE_USER'] = $usr; + + // we need to simulate a login + if(empty($_COOKIE[DOKU_COOKIE])){ + $_REQUEST['u'] = $_SERVER['REMOTE_USER']; + $_REQUEST['p'] = 'sso_only'; + } + } + + // prepare adLDAP standard configuration + $this->opts = $this->cnf; + + // add possible domain specific configuration + if($dom && is_array($this->cnf[$dom])) foreach($this->cnf[$dom] as $key => $val){ + $this->opts[$key] = $val; + } + + // handle multiple AD servers + $this->opts['domain_controllers'] = explode(',',$this->opts['domain_controllers']); + $this->opts['domain_controllers'] = array_map('trim',$this->opts['domain_controllers']); + $this->opts['domain_controllers'] = array_filter($this->opts['domain_controllers']); + + // we can change the password if SSL is set + if($this->opts['use_ssl'] || $this->opts['use_tls']){ + $this->cando['modPass'] = true; + } + $this->cando['modName'] = true; + $this->cando['modMail'] = true; + } + + /** + * Check user+password [required auth function] + * + * Checks if the given user exists and the given + * plaintext password is correct by trying to bind + * to the LDAP server + * + * @author James Van Lommel + * @return bool + */ + function checkPass($user, $pass){ + if($_SERVER['REMOTE_USER'] && + $_SERVER['REMOTE_USER'] == $user && + $this->cnf['sso']) return true; + + if(!$this->_init()) return false; + return $this->adldap->authenticate($user, $pass); + } + + /** + * Return user info [required auth function] + * + * Returns info about the given user needs to contain + * at least these fields: + * + * name string full name of the user + * mail string email address of the user + * grps array list of groups the user is in + * + * This LDAP specific function returns the following + * addional fields: + * + * dn string distinguished name (DN) + * uid string Posix User ID + * + * @author James Van Lommel + */ + function getUserData($user){ + global $conf; + if(!$this->_init()) return false; + + $fields = array('mail','displayname','samaccountname'); + + // add additional fields to read + $fields = array_merge($fields, $this->cnf['additional']); + $fields = array_unique($fields); + + //get info for given user + $result = $this->adldap->user_info($user, $fields); + //general user info + $info['name'] = $result[0]['displayname'][0]; + $info['mail'] = $result[0]['mail'][0]; + $info['uid'] = $result[0]['samaccountname'][0]; + $info['dn'] = $result[0]['dn']; + + // additional information + foreach ($this->cnf['additional'] as $field) { + if (isset($result[0][strtolower($field)])) { + $info[$field] = $result[0][strtolower($field)][0]; + } + } + + // handle ActiveDirectory memberOf + $info['grps'] = $this->adldap->user_groups($user,(bool) $this->opts['recursive_groups']); + + if (is_array($info['grps'])) { + foreach ($info['grps'] as $ndx => $group) { + $info['grps'][$ndx] = $this->cleanGroup($group); + } + } + + // always add the default group to the list of groups + if(!is_array($info['grps']) || !in_array($conf['defaultgroup'],$info['grps'])){ + $info['grps'][] = $conf['defaultgroup']; + } + + return $info; + } + + /** + * Make AD group names usable by DokuWiki. + * + * Removes backslashes ('\'), pound signs ('#'), and converts spaces to underscores. + * + * @author James Van Lommel (jamesvl@gmail.com) + */ + function cleanGroup($name) { + $sName = str_replace('\\', '', $name); + $sName = str_replace('#', '', $sName); + $sName = preg_replace('[\s]', '_', $sName); + return $sName; + } + + /** + * Sanitize user names + */ + function cleanUser($name) { + return $this->cleanGroup($name); + } + + /** + * Most values in LDAP are case-insensitive + */ + function isCaseSensitive(){ + return false; + } + + /** + * Bulk retrieval of user data + * + * @author Dominik Eckelmann + * @param start index of first user to be returned + * @param limit max number of users to be returned + * @param filter array of field/pattern pairs, null for no filter + * @return array of userinfo (refer getUserData for internal userinfo details) + */ + function retrieveUsers($start=0,$limit=-1,$filter=array()) { + if(!$this->_init()) return false; + + if ($this->users === null) { + //get info for given user + $result = $this->adldap->all_users(); + if (!$result) return array(); + $this->users = array_fill_keys($result, false); + } + + $i = 0; + $count = 0; + $this->_constructPattern($filter); + $result = array(); + + foreach ($this->users as $user => &$info) { + if ($i++ < $start) { + continue; + } + if ($info === false) { + $info = $this->getUserData($user); + } + if ($this->_filter($user, $info)) { + $result[$user] = $info; + if (($limit >= 0) && (++$count >= $limit)) break; + } + } + return $result; + } + + /** + * Modify user data + * + * @param $user nick of the user to be changed + * @param $changes array of field/value pairs to be changed + * @return bool + */ + function modifyUser($user, $changes) { + $return = true; + + // password changing + if(isset($changes['pass'])){ + try { + $return = $this->adldap->user_password($user,$changes['pass']); + } catch (adLDAPException $e) { + if ($this->cnf['debug']) msg('AD Auth: '.$e->getMessage(), -1); + $return = false; + } + if(!$return) msg('AD Auth: failed to change the password. Maybe the password policy was not met?',-1); + } + + // changing user data + $adchanges = array(); + if(isset($changes['name'])){ + // get first and last name + $parts = explode(' ',$changes['name']); + $adchanges['surname'] = array_pop($parts); + $adchanges['firstname'] = join(' ',$parts); + $adchanges['display_name'] = $changes['name']; + } + if(isset($changes['mail'])){ + $adchanges['email'] = $changes['mail']; + } + if(count($adchanges)){ + try { + $return = $return & $this->adldap->user_modify($user,$adchanges); + } catch (adLDAPException $e) { + if ($this->cnf['debug']) msg('AD Auth: '.$e->getMessage(), -1); + $return = false; + } + } + + return $return; + } + + /** + * Initialize the AdLDAP library and connect to the server + */ + function _init(){ + if(!is_null($this->adldap)) return true; + + // connect + try { + $this->adldap = new adLDAP($this->opts); + if (isset($this->opts['ad_username']) && isset($this->opts['ad_password'])) { + $this->canDo['getUsers'] = true; + } + return true; + } catch (adLDAPException $e) { + if ($this->cnf['debug']) { + msg('AD Auth: '.$e->getMessage(), -1); + } + $this->success = false; + $this->adldap = null; + } + return false; + } + + /** + * return 1 if $user + $info match $filter criteria, 0 otherwise + * + * @author Chris Smith + */ + function _filter($user, $info) { + foreach ($this->_pattern as $item => $pattern) { + if ($item == 'user') { + if (!preg_match($pattern, $user)) return 0; + } else if ($item == 'grps') { + if (!count(preg_grep($pattern, $info['grps']))) return 0; + } else { + if (!preg_match($pattern, $info[$item])) return 0; + } + } + return 1; + } + + function _constructPattern($filter) { + $this->_pattern = array(); + foreach ($filter as $item => $pattern) { +// $this->_pattern[$item] = '/'.preg_quote($pattern,"/").'/i'; // don't allow regex characters + $this->_pattern[$item] = '/'.str_replace('/','\/',$pattern).'/i'; // allow regex characters + } + } +} \ No newline at end of file -- cgit v1.2.3 From 454d868b911059adb8889a2d6afefa016d6a21f5 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Nov 2012 14:04:41 +0100 Subject: make all sub auth classes call the parent constructor This does nothing currently but allows us adding certain things to the base class later. --- lib/plugins/authad/auth.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/plugins/authad/auth.php') diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index 35c19f471..0900a3f87 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -82,6 +82,8 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { * Constructor */ public function __construct() { + parent::__construct(); + global $conf; $this->cnf = $conf['auth']['ad']; -- cgit v1.2.3 From 5a65cc7f5700c1a96e469b9f5a57bbe1ca879f53 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Nov 2012 14:07:17 +0100 Subject: some comment cleanup in authad --- lib/plugins/authad/auth.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'lib/plugins/authad/auth.php') diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index 0900a3f87..e82610327 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -13,15 +13,9 @@ require_once(DOKU_INC.'inc/adLDAP.php'); * Usage: * Set DokuWiki's local.protected.php auth setting to read * - * $conf['useacl'] = 1; - * $conf['disableactions'] = 'register'; - * $conf['autopasswd'] = 0; * $conf['authtype'] = 'authad'; - * $conf['passcrypt'] = 'ssha'; * - * $conf['auth']['ad']['account_suffix'] = ' - * - * @my.domain.org'; + * $conf['auth']['ad']['account_suffix'] = '@my.domain.org'; * $conf['auth']['ad']['base_dn'] = 'DC=my,DC=domain,DC=org'; * $conf['auth']['ad']['domain_controllers'] = 'srv1.domain.org,srv2.domain.org'; * -- cgit v1.2.3 From 76ce1169a0c8cbb18423b1581800b9aa1050ccd5 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Nov 2012 14:13:32 +0100 Subject: moved adLDAP to authad plugin and fixed includes --- lib/plugins/authad/auth.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/plugins/authad/auth.php') diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index e82610327..5c566195e 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -2,8 +2,6 @@ // must be run within Dokuwiki if(!defined('DOKU_INC')) die(); -require_once(DOKU_INC.'inc/adLDAP.php'); - /** * Active Directory authentication backend for DokuWiki * @@ -41,7 +39,7 @@ require_once(DOKU_INC.'inc/adLDAP.php'); * @author Jan Schumann */ -require_once(DOKU_INC.'inc/adLDAP/adLDAP.php'); +require_once(DOKU_PLUGIN.'authad/adLDAP/adLDAP.php'); class auth_plugin_authad extends DokuWiki_Auth_Plugin { /** -- cgit v1.2.3 From 32fd494aaeb28179d8823354e07c1399e7443c90 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Nov 2012 14:54:48 +0100 Subject: authad fixes * fixes incorrect $this->adldap calls * makes use of correct plugin config --- lib/plugins/authad/auth.php | 83 ++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 43 deletions(-) (limited to 'lib/plugins/authad/auth.php') diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index 5c566195e..f651d87a1 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -2,6 +2,8 @@ // must be run within Dokuwiki if(!defined('DOKU_INC')) die(); +require_once(DOKU_PLUGIN.'authad/adLDAP/adLDAP.php'); + /** * Active Directory authentication backend for DokuWiki * @@ -13,20 +15,20 @@ if(!defined('DOKU_INC')) die(); * * $conf['authtype'] = 'authad'; * - * $conf['auth']['ad']['account_suffix'] = '@my.domain.org'; - * $conf['auth']['ad']['base_dn'] = 'DC=my,DC=domain,DC=org'; - * $conf['auth']['ad']['domain_controllers'] = 'srv1.domain.org,srv2.domain.org'; + * $conf['plugin']['authad']['account_suffix'] = '@my.domain.org'; + * $conf['plugin']['authad']['base_dn'] = 'DC=my,DC=domain,DC=org'; + * $conf['plugin']['authad']['domain_controllers'] = 'srv1.domain.org,srv2.domain.org'; * * //optional: - * $conf['auth']['ad']['sso'] = 1; - * $conf['auth']['ad']['ad_username'] = 'root'; - * $conf['auth']['ad']['ad_password'] = 'pass'; - * $conf['auth']['ad']['real_primarygroup'] = 1; - * $conf['auth']['ad']['use_ssl'] = 1; - * $conf['auth']['ad']['use_tls'] = 1; - * $conf['auth']['ad']['debug'] = 1; + * $conf['plugin']['authad']['sso'] = 1; + * $conf['plugin']['authad']['ad_username'] = 'root'; + * $conf['plugin']['authad']['ad_password'] = 'pass'; + * $conf['plugin']['authad']['real_primarygroup'] = 1; + * $conf['plugin']['authad']['use_ssl'] = 1; + * $conf['plugin']['authad']['use_tls'] = 1; + * $conf['plugin']['authad']['debug'] = 1; * // warn user about expiring password this many days in advance: - * $conf['auth']['ad']['expirywarn'] = 5; + * $conf['plugin']['authad']['expirywarn'] = 5; * * // get additional information to the userinfo array * // add a list of comma separated ldap contact fields. @@ -38,18 +40,13 @@ if(!defined('DOKU_INC')) die(); * @author Andreas Gohr * @author Jan Schumann */ - -require_once(DOKU_PLUGIN.'authad/adLDAP/adLDAP.php'); - class auth_plugin_authad extends DokuWiki_Auth_Plugin { - /** - * @var array copy of the auth backend configuration - */ - protected $cnf = array(); + /** * @var array hold connection data for a specific AD domain */ protected $opts = array(); + /** * @var array open connections for each AD domain, as adLDAP objects */ @@ -76,18 +73,18 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { public function __construct() { parent::__construct(); - global $conf; - $this->cnf = $conf['auth']['ad']; + // we load the config early to modify it a bit here + $this->loadConfig(); // additional information fields - if(isset($this->cnf['additional'])) { - $this->cnf['additional'] = str_replace(' ', '', $this->cnf['additional']); - $this->cnf['additional'] = explode(',', $this->cnf['additional']); - } else $this->cnf['additional'] = array(); + if(isset($this->conf['additional'])) { + $this->conf['additional'] = str_replace(' ', '', $this->conf['additional']); + $this->conf['additional'] = explode(',', $this->conf['additional']); + } else $this->conf['additional'] = array(); // ldap extension is needed if(!function_exists('ldap_connect')) { - if($this->cnf['debug']) + if($this->conf['debug']) msg("AD Auth: PHP LDAP extension not found.", -1); $this->success = false; return; @@ -97,7 +94,7 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { if(!utf8_check($_SERVER['REMOTE_USER'])) { $_SERVER['REMOTE_USER'] = utf8_encode($_SERVER['REMOTE_USER']); } - if($_SERVER['REMOTE_USER'] && $this->cnf['sso']) { + if($_SERVER['REMOTE_USER'] && $this->conf['sso']) { $_SERVER['REMOTE_USER'] = $this->cleanUser($_SERVER['REMOTE_USER']); // we need to simulate a login @@ -127,7 +124,7 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { public function checkPass($user, $pass) { if($_SERVER['REMOTE_USER'] && $_SERVER['REMOTE_USER'] == $user && - $this->cnf['sso'] + $this->conf['sso'] ) return true; $adldap = $this->_adldap($this->_userDomain($user)); @@ -172,11 +169,11 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { $fields = array('mail', 'displayname', 'samaccountname', 'lastpwd', 'pwdlastset', 'useraccountcontrol'); // add additional fields to read - $fields = array_merge($fields, $this->cnf['additional']); + $fields = array_merge($fields, $this->conf['additional']); $fields = array_unique($fields); //get info for given user - $result = $this->adldap->user()->info($this->_userName($user), $fields); + $result = $adldap->user()->info($this->_userName($user), $fields); if($result == false){ return array(); } @@ -192,14 +189,14 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { $info['expires'] = !($result[0]['useraccountcontrol'][0] & 0x10000); //ADS_UF_DONT_EXPIRE_PASSWD // additional information - foreach($this->cnf['additional'] as $field) { + foreach($this->conf['additional'] as $field) { if(isset($result[0][strtolower($field)])) { $info[$field] = $result[0][strtolower($field)][0]; } } // handle ActiveDirectory memberOf - $info['grps'] = $this->adldap->user()->groups($this->_userName($user),(bool) $this->opts['recursive_groups']); + $info['grps'] = $adldap->user()->groups($this->_userName($user),(bool) $this->opts['recursive_groups']); if(is_array($info['grps'])) { foreach($info['grps'] as $ndx => $group) { @@ -219,14 +216,14 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { } // check expiry time - if($info['expires'] && $this->cnf['expirywarn']){ - $timeleft = $this->adldap->user()->passwordExpiry($user); // returns unixtime + if($info['expires'] && $this->conf['expirywarn']){ + $timeleft = $adldap->user()->passwordExpiry($user); // returns unixtime $timeleft = round($timeleft/(24*60*60)); $info['expiresin'] = $timeleft; // if this is the current user, warn him (once per request only) if(($_SERVER['REMOTE_USER'] == $user) && - ($timeleft <= $this->cnf['expirywarn']) && + ($timeleft <= $this->conf['expirywarn']) && !$this->msgshown ) { $msg = sprintf($lang['authpwdexpire'], $timeleft); @@ -283,7 +280,7 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { $user = utf8_strtolower(trim($user)); // is this a known, valid domain? if not discard - if(!is_array($this->cnf[$domain])) { + if(!is_array($this->conf[$domain])) { $domain = ''; } @@ -316,7 +313,7 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { if($this->users === null) { //get info for given user - $result = $this->adldap->user()->all(); + $result = $adldap->user()->all(); if (!$result) return array(); $this->users = array_fill_keys($result, false); } @@ -356,9 +353,9 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { // password changing if(isset($changes['pass'])) { try { - $return = $this->adldap->user()->password($this->_userName($user),$changes['pass']); + $return = $adldap->user()->password($this->_userName($user),$changes['pass']); } catch (adLDAPException $e) { - if ($this->cnf['debug']) msg('AD Auth: '.$e->getMessage(), -1); + if ($this->conf['debug']) msg('AD Auth: '.$e->getMessage(), -1); $return = false; } if(!$return) msg('AD Auth: failed to change the password. Maybe the password policy was not met?', -1); @@ -378,9 +375,9 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { } if(count($adchanges)) { try { - $return = $return & $this->adldap->user()->modify($this->_userName($user),$adchanges); + $return = $return & $adldap->user()->modify($this->_userName($user),$adchanges); } catch (adLDAPException $e) { - if ($this->cnf['debug']) msg('AD Auth: '.$e->getMessage(), -1); + if ($this->conf['debug']) msg('AD Auth: '.$e->getMessage(), -1); $return = false; } } @@ -411,7 +408,7 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { $this->adldap[$domain] = new adLDAP($this->opts); return $this->adldap[$domain]; } catch(adLDAPException $e) { - if($this->cnf['debug']) { + if($this->conf['debug']) { msg('AD Auth: '.$e->getMessage(), -1); } $this->success = false; @@ -450,12 +447,12 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { */ protected function _loadServerConfig($domain) { // prepare adLDAP standard configuration - $opts = $this->cnf; + $opts = $this->conf; $opts['domain'] = $domain; // add possible domain specific configuration - if($domain && is_array($this->cnf[$domain])) foreach($this->cnf[$domain] as $key => $val) { + if($domain && is_array($this->conf[$domain])) foreach($this->conf[$domain] as $key => $val) { $opts[$key] = $val; } -- cgit v1.2.3 From 00d58927261c5bed6f093ca4aa2064a18139a228 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Wed, 20 Feb 2013 20:26:05 +0100 Subject: Fix remaining missing $INPUT uses FS#2577 This adds $INPUT in all places where it was still missing and available. $INPUT is now also used in places where using $_REQUEST/... was okay in order to make the code consistent. --- lib/plugins/authad/auth.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/plugins/authad/auth.php') diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index f651d87a1..6c49eafbb 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -71,6 +71,7 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { * Constructor */ public function __construct() { + global $INPUT; parent::__construct(); // we load the config early to modify it a bit here @@ -99,8 +100,8 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { // we need to simulate a login if(empty($_COOKIE[DOKU_COOKIE])) { - $_REQUEST['u'] = $_SERVER['REMOTE_USER']; - $_REQUEST['p'] = 'sso_only'; + $INPUT->set('u', $_SERVER['REMOTE_USER']); + $INPUT->set('p', 'sso_only'); } } -- cgit v1.2.3