Changeset View
Changeset View
Standalone View
Standalone View
core/kernel/session/session.php
Show First 20 Lines • Show All 326 Lines • ▼ Show 20 Line(s) | |||||
function CheckIfCookiesAreOn() | function CheckIfCookiesAreOn() | ||||
{ | { | ||||
if ( $this->Mode == self::smGET_ONLY ) { | if ( $this->Mode == self::smGET_ONLY ) { | ||||
//we don't need to bother checking if we would not use it | //we don't need to bother checking if we would not use it | ||||
$this->CookiesEnabled = false; | $this->CookiesEnabled = false; | ||||
return false; | return false; | ||||
} | } | ||||
/** @var kHTTPQuery $http_query */ | |||||
$http_query = $this->Application->recallObject('HTTPQuery'); | $http_query = $this->Application->recallObject('HTTPQuery'); | ||||
/* @var $http_query kHTTPQuery */ | |||||
$cookies_on = array_key_exists('cookies_on', $http_query->Cookie); // not good here | $cookies_on = array_key_exists('cookies_on', $http_query->Cookie); // not good here | ||||
$get_sid = getArrayValue($http_query->Get, $this->GETName); | $get_sid = getArrayValue($http_query->Get, $this->GETName); | ||||
if ( ($this->Application->HttpQuery->IsHTTPSRedirect() && $get_sid) || $this->getFlashSID() ) { // Redirect from http to https on different domain OR flash uploader | if ( ($this->Application->HttpQuery->IsHTTPSRedirect() && $get_sid) || $this->getFlashSID() ) { // Redirect from http to https on different domain OR flash uploader | ||||
$this->OriginalMode = $this->Mode; | $this->OriginalMode = $this->Mode; | ||||
$this->SetMode(self::smGET_ONLY); | $this->SetMode(self::smGET_ONLY); | ||||
▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | |||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
function getFlashSID() | function getFlashSID() | ||||
{ | { | ||||
/** @var kHTTPQuery $http_query */ | |||||
$http_query = $this->Application->recallObject('HTTPQuery'); | $http_query = $this->Application->recallObject('HTTPQuery'); | ||||
/* @var $http_query kHTTPQuery */ | |||||
return getArrayValue($http_query->Post, 'flashsid'); | return getArrayValue($http_query->Post, 'flashsid'); | ||||
} | } | ||||
function GetPassedSIDValue($use_cache = 1) | function GetPassedSIDValue($use_cache = 1) | ||||
{ | { | ||||
if (!empty($this->CachedSID) && $use_cache) { | if (!empty($this->CachedSID) && $use_cache) { | ||||
return $this->CachedSID; | return $this->CachedSID; | ||||
} | } | ||||
// flash sid overrides regular sid | // flash sid overrides regular sid | ||||
$get_sid = $this->getFlashSID(); | $get_sid = $this->getFlashSID(); | ||||
if (!$get_sid) { | if (!$get_sid) { | ||||
Lint: CodingStandard.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBrace: Expected 1 spaces before "if" closing bracket; 0 found | |||||
Expected 1 spaces after "if" opening bracket; 0 found Lint: CodingStandard.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBrace: Expected 1 spaces after "if" opening bracket; 0 found | |||||
/** @var kHTTPQuery $http_query */ | |||||
$http_query = $this->Application->recallObject('HTTPQuery'); | $http_query = $this->Application->recallObject('HTTPQuery'); | ||||
/* @var $http_query kHTTPQuery */ | |||||
$get_sid = getArrayValue($http_query->Get, $this->GETName); | $get_sid = getArrayValue($http_query->Get, $this->GETName); | ||||
} | } | ||||
$sid_from_get = $get_sid ? true : false; | $sid_from_get = $get_sid ? true : false; | ||||
if ($this->Application->GetVar('admin') == 1 && $get_sid) { | if ($this->Application->GetVar('admin') == 1 && $get_sid) { | ||||
$sid = $get_sid; | $sid = $get_sid; | ||||
▲ Show 20 Lines • Show All 407 Lines • ▼ Show 20 Line(s) | |||||
if (!$this->RecallVar('admin') && !isset($admin_saved)) { | if (!$this->RecallVar('admin') && !isset($admin_saved)) { | ||||
// bug: we get recursion in this place, when cookies are disabled in browser and we are browsing | // bug: we get recursion in this place, when cookies are disabled in browser and we are browsing | ||||
// front-end in admin's frame (front-end session is initialized using admin's sid and they are | // front-end in admin's frame (front-end session is initialized using admin's sid and they are | ||||
// mixed together) | // mixed together) | ||||
$admin_saved = true; | $admin_saved = true; | ||||
/** @var Session $admin_session */ | |||||
$admin_session = $this->Application->recallObject('Session.admin'); | $admin_session = $this->Application->recallObject('Session.admin'); | ||||
/* @var $admin_session Session */ | |||||
// save to admin last_template too, because when F5 is pressed in frameset Front-End frame should reload as well | // save to admin last_template too, because when F5 is pressed in frameset Front-End frame should reload as well | ||||
$admin_session->StoreVar('last_template_popup', '../' . $last_template); | $admin_session->StoreVar('last_template_popup', '../' . $last_template); | ||||
$admin_session->StorePersistentVar('last_template_popup', '../' . $last_template); | $admin_session->StorePersistentVar('last_template_popup', '../' . $last_template); | ||||
$admin_session->SaveData( Array ('save_last_template' => false) ); | $admin_session->SaveData( Array ('save_last_template' => false) ); | ||||
} | } | ||||
else { | else { | ||||
▲ Show 20 Lines • Show All 219 Lines • ▼ Show 20 Line(s) | |||||
$ret = $user_id > 0; | $ret = $user_id > 0; | ||||
if (($this->RecallVar('admin') == 1 || defined('ADMIN')) && ($user_id == USER_ROOT)) { | if (($this->RecallVar('admin') == 1 || defined('ADMIN')) && ($user_id == USER_ROOT)) { | ||||
$ret = true; | $ret = true; | ||||
} | } | ||||
return $ret; | return $ret; | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |
Expected 1 spaces before "if" closing bracket; 0 found