parent
ed6c302c57
commit
837a8c58ea
@ -18,6 +18,17 @@ if (!@include_once(BASEPATH . 'include/config/global.inc.php')) die('Unable to l
|
|||||||
if (!include_once(BASEPATH . 'include/config/security.inc.dist.php')) die('Unable to load base security config - '.$quickstartlink);
|
if (!include_once(BASEPATH . 'include/config/security.inc.dist.php')) die('Unable to load base security config - '.$quickstartlink);
|
||||||
if (@file_exists(BASEPATH . 'include/config/security.inc.php')) include_once(BASEPATH . 'include/config/security.inc.php');
|
if (@file_exists(BASEPATH . 'include/config/security.inc.php')) include_once(BASEPATH . 'include/config/security.inc.php');
|
||||||
|
|
||||||
|
// start our session, we need it for smarty caching
|
||||||
|
$session_start = @session_start();
|
||||||
|
session_set_cookie_params(time()+$config['cookie']['duration'], $config['cookie']['path'], $config['cookie']['domain'], $config['cookie']['secure'], $config['cookie']['httponly']);
|
||||||
|
if (!$session_start) {
|
||||||
|
$log->log("info", "Forcing session id regeneration for ".$_SERVER['REMOTE_ADDR']." [hijack attempt?]");
|
||||||
|
session_destroy();
|
||||||
|
session_regenerate_id(true);
|
||||||
|
session_start();
|
||||||
|
}
|
||||||
|
@setcookie(session_name(), session_id(), time()+$config['cookie']['duration'], $config['cookie']['path'], $config['cookie']['domain'], $config['cookie']['secure'], $config['cookie']['httponly']);
|
||||||
|
|
||||||
// Our default template to load, pages can overwrite this later
|
// Our default template to load, pages can overwrite this later
|
||||||
$master_template = 'master.tpl';
|
$master_template = 'master.tpl';
|
||||||
|
|
||||||
@ -25,4 +36,4 @@ $master_template = 'master.tpl';
|
|||||||
// We include all needed files here, even though our templates could load them themself
|
// We include all needed files here, even though our templates could load them themself
|
||||||
require_once(INCLUDE_DIR . '/autoloader.inc.php');
|
require_once(INCLUDE_DIR . '/autoloader.inc.php');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -43,16 +43,6 @@ include_once('include/bootstrap.php');
|
|||||||
$hts = ($config['https_only'] && (!empty($_SERVER['QUERY_STRING']))) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']."?".$_SERVER['QUERY_STRING'] : "https://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
|
$hts = ($config['https_only'] && (!empty($_SERVER['QUERY_STRING']))) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']."?".$_SERVER['QUERY_STRING'] : "https://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
|
||||||
($config['https_only'] && @!$_SERVER['HTTPS']) ? exit(header("Location: ".$hts)):0;
|
($config['https_only'] && @!$_SERVER['HTTPS']) ? exit(header("Location: ".$hts)):0;
|
||||||
|
|
||||||
$session_start = @session_start();
|
|
||||||
session_set_cookie_params(time()+$config['cookie']['duration'], $config['cookie']['path'], $config['cookie']['domain'], $config['cookie']['secure'], $config['cookie']['httponly']);
|
|
||||||
if (!$session_start) {
|
|
||||||
$log->log("info", "Forcing session id regeneration for ".$_SERVER['REMOTE_ADDR']." [hijack attempt?]");
|
|
||||||
session_destroy();
|
|
||||||
session_regenerate_id(true);
|
|
||||||
session_start();
|
|
||||||
}
|
|
||||||
@setcookie(session_name(), session_id(), time()+$config['cookie']['duration'], $config['cookie']['path'], $config['cookie']['domain'], $config['cookie']['secure'], $config['cookie']['httponly']);
|
|
||||||
|
|
||||||
// Rate limiting
|
// Rate limiting
|
||||||
if ($config['memcache']['enabled'] && $config['mc_antidos']['enabled']) {
|
if ($config['memcache']['enabled'] && $config['mc_antidos']['enabled']) {
|
||||||
if (PHP_OS == 'WINNT') {
|
if (PHP_OS == 'WINNT') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user