Add new class methods and use them

This commit is contained in:
FusionPBX
2023-09-11 01:45:19 -06:00
committed by GitHub
parent 6411f50750
commit 2c5724c6ed
8 changed files with 238 additions and 184 deletions

View File

@@ -37,7 +37,35 @@
}
//start the session
if (!isset($_SESSION)) { session_start(); }
if (function_exists('session_start')) {
if (!isset($_SESSION)) {
session_start();
}
}
//regenerate sessions to avoid session id attacks such as session fixation
if (array_key_exists('security',$_SESSION) && $_SESSION['security']['session_rotate']['boolean'] == "true") {
$_SESSION['session']['last_activity'] = time();
if (!isset($_SESSION['session']['created'])) {
$_SESSION['session']['created'] = time();
} else if (time() - $_SESSION['session']['created'] > 28800) {
// session started more than 8 hours ago
session_regenerate_id(true); // rotate the session id
$_SESSION['session']['created'] = time(); // update creation time
}
}
//set the domains session
if (!isset($_SESSION['domains'])) {
$domain = new domains();
$domain->session();
$domain->set();
}
//set the domain_uuid variable from the session
if (!empty($_SESSION["domain_uuid"])) {
$domain_uuid = $_SESSION["domain_uuid"];
}
//define variables
if (!isset($_SESSION['template_content'])) { $_SESSION["template_content"] = null; }