This should fix #193

This commit is contained in:
kaetemi 2014-09-06 20:56:06 +02:00
parent 83d9dc9f69
commit 667fa78aab
3 changed files with 39 additions and 29 deletions

View file

@ -1,8 +1,8 @@
<?php <?php
/* /*
* THIS FILE SHOULD ONLY INCLUDE AUTHENTIFICATION RELATED FUNCTIONS * THIS FILE SHOULD ONLY INCLUDE AUTHENTIFICATION RELATED FUNCTIONS
*/ */
function nt_auth_set_logging_count($user_id) function nt_auth_set_logging_count($user_id)
{ {
@ -75,49 +75,59 @@
$tpl->display('index_login.tpl'); $tpl->display('index_login.tpl');
} }
function nt_auth_start_session() function nt_auth_start_session()
{ {
global $NEL_SETUP_SESSION;
if (isset($NEL_SETUP_SESSION) && ($NEL_SETUP_SESSION)) {
return;
}
session_name(NELTOOL_SESSIONID); session_name(NELTOOL_SESSIONID);
session_cache_limiter('nocache'); session_cache_limiter('nocache');
session_start(); session_start();
header("Expires: Mon, 01 May 2000 06:00:00 GMT"); header("Expires: Mon, 01 May 2000 06:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false); header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); header("Pragma: no-cache");
} }
function nt_auth_stop_session() function nt_auth_stop_session()
{
global $NEL_SETUP_SESSION;
if (isset($NEL_SETUP_SESSION) && ($NEL_SETUP_SESSION)) {
return;
}
global $NELTOOL;
foreach($NELTOOL['SESSION_VARS'] as $key => $val)
{
unset($NELTOOL['SESSION_VARS'][$key]);
}
}
function nt_auth_set_session_var($name,$value)
{ {
global $NELTOOL; global $NELTOOL;
foreach($NELTOOL['SESSION_VARS'] as $key => $val) $NELTOOL['SESSION_VARS'][$name] = $value;
{
unset($NELTOOL['SESSION_VARS'][$key]);
}
}
function nt_auth_set_session_var($name,$value)
{
global $NELTOOL;
$NELTOOL['SESSION_VARS'][$name] = $value;
} }
function nt_auth_get_session_var($name) function nt_auth_get_session_var($name)
{ {
global $NELTOOL; global $NELTOOL;
if (isset($NELTOOL['SESSION_VARS'][$name])) return $NELTOOL['SESSION_VARS'][$name]; if (isset($NELTOOL['SESSION_VARS'][$name])) return $NELTOOL['SESSION_VARS'][$name];
return null; return null;
} }
function nt_auth_unset_session_var($name) function nt_auth_unset_session_var($name)
{ {
global $NELTOOL; global $NELTOOL;
unset($NELTOOL['SESSION_VARS'][$name]); unset($NELTOOL['SESSION_VARS'][$name]);
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
$NEL_SETUP_SESSION = true;
if (file_exists( '../config.php')) { if (file_exists( '../config.php')) {
session_start();
if ((!isset($_SESSION['nelSetupAuthenticated'])) || $_SESSION['nelSetupAuthenticated'] != 1) { if ((!isset($_SESSION['nelSetupAuthenticated'])) || $_SESSION['nelSetupAuthenticated'] != 1) {
if (basename($_SERVER["SCRIPT_NAME"]) != "auth.php") { if (basename($_SERVER["SCRIPT_NAME"]) != "auth.php") {
header("Cache-Control: max-age=1"); header("Cache-Control: max-age=1");

View file

@ -24,9 +24,9 @@ include('header.php');
<a class="btn btn-default" style="width: 100%;" href="domain.php"><span class="glyphicon glyphicon-globe"></span> Add Domain</a> <a class="btn btn-default" style="width: 100%;" href="domain.php"><span class="glyphicon glyphicon-globe"></span> Add Domain</a>
</p>--> </p>-->
<p> <!--<p>
<a class="btn btn-default" style="width: 100%;" href="upgrade.php"><span class="glyphicon glyphicon-tower"></span> Add Shard</a> <a class="btn btn-default" style="width: 100%;" href="upgrade.php"><span class="glyphicon glyphicon-tower"></span> Add Shard</a>
</p> </p>-->
<?php } ?> <?php } ?>