Skip to content
Snippets Groups Projects
Commit aab20d91 authored by hahn's avatar hahn
Browse files

task#3875 - fix user login

parent eb475d4e
No related branches found
No related tags found
No related merge requests found
...@@ -137,7 +137,7 @@ class user { ...@@ -137,7 +137,7 @@ class user {
*/ */
public function authenticate(){ public function authenticate(){
global $aConfig, $aParams; global $aConfig, $aParams;
print_r($aConfig); //print_r($aConfig);
if(!array_key_exists('auth', $aConfig) || !count($aConfig['auth']) || !array_key_exists('user', $aParams)){ if(!array_key_exists('auth', $aConfig) || !count($aConfig['auth']) || !array_key_exists('user', $aParams)){
return false; return false;
} }
...@@ -161,8 +161,8 @@ class user { ...@@ -161,8 +161,8 @@ class user {
if ($oUserAuth && $oUserAuth->authenticate($sUser, $sPassword)){ if ($oUserAuth && $oUserAuth->authenticate($sUser, $sPassword)){
// set a session - it must correspondent with _autoDetectUser() // set a session - it must correspondent with _autoDetectUser()
$_SESSION["PHP_AUTH_USER"]=$sUser; // $_SESSION["PHP_AUTH_USER"]=$sUser;
$this->setUser(''); $this->setUser($sUser);
return true; return true;
} }
} }
...@@ -181,12 +181,14 @@ class user { ...@@ -181,12 +181,14 @@ class user {
/** /**
* set an authenticated user and get its roles * set an authenticated user and get its roles
* @param string $sUser optional: set a given username
*/ */
public function setUser($sUser=false){ public function setUser($sUser=false){
if($sUser!==false){ if($sUser!==false){
$this->_sUsername=$sUser; $this->_sUsername=$sUser;
$_SESSION["PHP_AUTH_USER"]=$sUser; $_SESSION["PHP_AUTH_USER"]=$sUser;
} else { } else {
// check user from basic auth or cli
$this->_sUsername=$this->_autoDetectUser(); $this->_sUsername=$this->_autoDetectUser();
} }
$this->_getUserGroups(); $this->_getUserGroups();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment