mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Add new class methods and use them
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user