mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-09-01 02:38:55 +00:00
Update users and basepage.
This commit is contained in:
@@ -44,6 +44,9 @@ class BasePage
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->https = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? true : false);
|
||||
|
||||
session_set_cookie_params(0, '/', '', $this->https, true);
|
||||
@session_start();
|
||||
|
||||
if (NN_FLOOD_CHECK) {
|
||||
@@ -81,12 +84,12 @@ class BasePage
|
||||
$servername = null;
|
||||
if (defined('EXTERNAL_PROXY_IP') && defined('EXTERNAL_HOST_NAME') && isset($_SERVER["REMOTE_ADDR"]) && $_SERVER["REMOTE_ADDR"] == EXTERNAL_PROXY_IP)
|
||||
$servername = EXTERNAL_HOST_NAME;
|
||||
elseif (isset($_SERVER["SERVER_NAME"]))
|
||||
$servername = $_SERVER["SERVER_NAME"];
|
||||
|
||||
if ($servername != "")
|
||||
{
|
||||
$this->serverurl = ($this->secure_connection ? "https://" : "http://").$servername.(($_SERVER["SERVER_PORT"] != "80" && $_SERVER["SERVER_PORT"] != "443") ? ":".$_SERVER["SERVER_PORT"] : "").WWW_TOP.'/';
|
||||
elseif (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'] : '') .
|
||||
WWW_TOP . '/'
|
||||
);
|
||||
$this->smarty->assign('serverroot', $this->serverurl);
|
||||
}
|
||||
|
||||
|
||||
@@ -659,12 +659,16 @@ class Users
|
||||
return (isset($_SESSION['uid']) ? $_SESSION['uid'] : -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logout the user, destroying his cookies and session.
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
session_unset();
|
||||
session_destroy();
|
||||
setcookie('uid', '', (time() - 2592000), '/', $_SERVER['SERVER_NAME'], (isset($_SERVER['HTTPS']) ? true : false));
|
||||
setcookie('idh', '', (time() - 2592000), '/', $_SERVER['SERVER_NAME'], (isset($_SERVER['HTTPS']) ? true : false));
|
||||
$secure_cookie = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? '1' : '0');
|
||||
setcookie('uid', null, -1, '/', null, $secure_cookie, true);
|
||||
setcookie('idh', null, -1, '/', null, $secure_cookie, true);
|
||||
}
|
||||
|
||||
public function updateApiAccessed($uid)
|
||||
|
||||
Reference in New Issue
Block a user