fixed between directory user exploit - now the session depends on its brwoser/server scope and the baseurl in your config
This commit is contained in:
parent
ff3b3b6b8d
commit
482a5009b5
@ -61,7 +61,8 @@ class Security {
|
||||
getenv('REMOTE_ADDR'),
|
||||
0,
|
||||
NULL,
|
||||
$row[\SYSTEM\DBD\system_user::FIELD_LOCALE]);
|
||||
$row[\SYSTEM\DBD\system_user::FIELD_LOCALE],
|
||||
\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL));
|
||||
if(isset($locale)){
|
||||
\SYSTEM\locale::set($locale);}
|
||||
// track succesful user login
|
||||
@ -121,7 +122,7 @@ class Security {
|
||||
|
||||
public static function isLoggedIn(){
|
||||
self::startSession();
|
||||
return (isset($_SESSION['user']) && $_SESSION['user'] instanceof User);}
|
||||
return (isset($_SESSION['user']) && $_SESSION['user'] instanceof User && $_SESSION['user']->base_url === \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL));}
|
||||
|
||||
private static function startSession(){
|
||||
if(!isset($_SESSION) && !headers_sent()){
|
||||
|
||||
@ -13,8 +13,9 @@ class User {
|
||||
public $passwordWrongCount = NULL;
|
||||
public $rights = NULL;
|
||||
public $locale = NULL;
|
||||
public $base_url = NULL;
|
||||
|
||||
public function __construct($id, $username, $email, $creationDate, $lastLoginDate, $lastLoginIP, $passwordWrongCount, $rights, $locale){
|
||||
public function __construct($id, $username, $email, $creationDate, $lastLoginDate, $lastLoginIP, $passwordWrongCount, $rights, $locale, $base_url){
|
||||
$this->id = $id;
|
||||
$this->username = $username;
|
||||
$this->email = $email;
|
||||
@ -24,5 +25,6 @@ class User {
|
||||
$this->passwordWrongCount = $passwordWrongCount;
|
||||
$this->rights = $rights;
|
||||
$this->locale = $locale;
|
||||
$this->base_url = $base_url;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user