Skip to content
Snippets Groups Projects
Commit b3fc8ffb authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch 'task-3875-login' into 'master'

Task 3875 login

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