From bbbd6568079affbd98f1dcc567ad3ccdfb9017ab Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 5 Aug 2006 18:31:47 +0200 Subject: fixed auth problem introduced in last unittest fix darcs-hash:20060805163147-7ad00-77e7d9cd88f012cd2ecc6275a574abde30f4a9be.gz --- inc/auth.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'inc/auth.php') diff --git a/inc/auth.php b/inc/auth.php index ed32dc95d..5c005434a 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -55,16 +55,16 @@ // do the login either by cookie or provided credentials if($conf['useacl']){ + if (!isset($_REQUEST['u'])) $_REQUEST['u'] = ''; + if (!isset($_REQUEST['p'])) $_REQUEST['p'] = ''; + if (!isset($_REQUEST['r'])) $_REQUEST['r'] = ''; + // if no credentials were given try to use HTTP auth (for SSO) if(empty($_REQUEST['u']) && empty($_COOKIE[DOKU_COOKIE]) && !empty($_SERVER['PHP_AUTH_USER'])){ $_REQUEST['u'] = $_SERVER['PHP_AUTH_USER']; $_REQUEST['p'] = $_SERVER['PHP_AUTH_PW']; } - if (!isset($_REQUEST['u'])) $_REQUEST['u'] = ''; - if (!isset($_REQUEST['p'])) $_REQUEST['p'] = ''; - if (!isset($_REQUEST['r'])) $_REQUEST['r'] = ''; - // external trust mechanism in place? if(!is_null($auth) && $auth->canDo('external')){ $auth->trustExternal($_REQUEST['u'],$_REQUEST['p'],$_REQUEST['r']); @@ -115,7 +115,7 @@ function auth_login($user,$pass,$sticky=false){ global $auth; $sticky ? $sticky = true : $sticky = false; //sanity check - if(isset($user)){ + if(!empty($user)){ //usual login if ($auth->checkPass($user,$pass)){ // make logininfo globally available -- cgit v1.2.3