mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Try to prevent creating new session on every BasePage load
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
2017-07-25 DariusIII
|
||||
* Chg: Try to prevent creating new session on every BasePage load
|
||||
* Chg: Add automatic user profile role change for expired roles (role change date) on users list check (admin area)
|
||||
2017-07-23 DariusIII
|
||||
* Fix: Fix error for scandir in profileedit page
|
||||
|
||||
+11
-7
@@ -10,12 +10,12 @@ use nntmux\SABnzbd;
|
||||
class BasePage
|
||||
{
|
||||
/**
|
||||
* @var \nntmux\db\Settings
|
||||
* @var DB
|
||||
*/
|
||||
public $settings = null;
|
||||
|
||||
/**
|
||||
* @var nntmux\Users
|
||||
* @var Users
|
||||
*/
|
||||
public $users = null;
|
||||
|
||||
@@ -79,17 +79,21 @@ class BasePage
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $theme = 'Omicron';
|
||||
protected $theme = 'Gentele';
|
||||
|
||||
/**
|
||||
* Set up session / smarty / user variables.
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->https = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? true : false);
|
||||
$this->https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on';
|
||||
|
||||
session_set_cookie_params(0, '/', '', $this->https, true);
|
||||
@session_start();
|
||||
if (session_id() === '') {
|
||||
session_set_cookie_params(0, '/', '', $this->https, true);
|
||||
@session_start();
|
||||
}
|
||||
|
||||
if (NN_FLOOD_CHECK) {
|
||||
$this->floodCheck();
|
||||
@@ -111,7 +115,7 @@ class BasePage
|
||||
if (isset($_SERVER['SERVER_NAME'])) {
|
||||
$this->serverurl = (
|
||||
($this->https === true ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] .
|
||||
(($_SERVER['SERVER_PORT'] != '80' && $_SERVER['SERVER_PORT'] != '443') ? ':' . $_SERVER['SERVER_PORT'] : '') .
|
||||
(((int)$_SERVER['SERVER_PORT'] !== 80 && (int)$_SERVER['SERVER_PORT'] !== 443) ? ':' . $_SERVER['SERVER_PORT'] : '') .
|
||||
WWW_TOP . '/'
|
||||
);
|
||||
$this->smarty->assign('serverroot', $this->serverurl);
|
||||
|
||||
Reference in New Issue
Block a user