2007-07-19
kalt
The auth module below used to work fine with 2006-11-06 but is having trouble with the new version. Adding the following two lines before the "//prepend groups with @ and nameencode" comment seems to help, but i don't understand why it's needed here since the auth module sets the groups.
//make sure groups is an array
if(!is_array($groups)) $groups = array();
Without it, users get the following errors at the top of the page:
Warning: in_array() [function.in-array]: Wrong datatype for second argument in ..../inc/auth.php on line 290
Warning: in_array() [function.in-array]: Wrong datatype for second argument in ..../inc/auth.php on line 292
Warning: Cannot modify header information - headers already sent by (output started at ..../inc/auth.php:290) in ..../inc/actions.php on line 131
Auth module is:
define('DOKU_AUTH', dirname(__FILE__));
require_once(DOKU_AUTH.'/basic.class.php');
class auth_kerberos extends auth_basic {
function auth_kerberos() {
$this->cando['external'] = true;
$this->cando['logoff'] = false;
}
function trustExternal($user, $pass, $sticky=false){
$oink = split("@", $_SERVER['REMOTE_USER']);
$USERINFO['name'] = $oink[0];
$USERINFO['mail'] = $_SERVER['REMOTE_USER'];
$USERINFO['grps'] = array('staff');
$_SERVER['REMOTE_USER'] = $oink[0];
}
}