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

task#3869 - update sws class

parent d07a8a75
No related branches found
No related tags found
No related merge requests found
......@@ -53,15 +53,15 @@ class user {
/**
* detect a user
* @return type
* get string with detected user from current session / basic auth / cli access
* @return string
*/
private function _autoDetectUser(){
$sUser=false;
if (isset($_SESSION) && is_array($_SESSION) && array_key_exists("PHP_AUTH_USER", $_SESSION)){
if (isset($_SESSION) && isset($_SESSION["PHP_AUTH_USER"])){
$sUser=$_SESSION["PHP_AUTH_USER"];
}
if (!$sUser && is_array($_SERVER) && array_key_exists("PHP_AUTH_USER", $_SERVER)){
if (!$sUser && isset($_SERVER["PHP_AUTH_USER"])){
$sUser=$_SERVER["PHP_AUTH_USER"];
}
if (php_sapi_name() == "cli") {
......@@ -137,7 +137,7 @@ class user {
*/
public function authenticate(){
global $aConfig, $aParams;
print_r($aConfig);
if(!array_key_exists('auth', $aConfig) || !count($aConfig['auth']) || !array_key_exists('user', $aParams)){
return false;
}
......@@ -180,10 +180,11 @@ class user {
}
/**
* set a authenticated user and get its roles
* set an authenticated user and get its roles
*/
public function setUser(){
$this->_sUsername=$this->_autoDetectUser();
$this->_getUserGroups();
$this->_getUserPermission();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment