mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Remove $_SESSION usage, except install (#10745)
* Remove $_SESSION usage, except install Fixes issue with device debug capture Removes secure_cookies setting, use the .env variable SESSION_SECURE_COOKIE instead. Reminder secure cookies requires cookies are transported over https, if everything is already transported via https, the setting won't make a difference. * Fix availability map controls
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
session_start();
|
||||
//availability-map mode view
|
||||
if (isset($_REQUEST['map_view'])) {
|
||||
$_SESSION['map_view'] = $_REQUEST['map_view'];
|
||||
$map_view = array('map_view' => $_SESSION['map_view']);
|
||||
header('Content-type: text/plain');
|
||||
echo json_encode($map_view);
|
||||
}
|
||||
|
||||
//availability-map device group view
|
||||
if (isset($_REQUEST['group_view'])) {
|
||||
$_SESSION['group_view'] = $_REQUEST['group_view'];
|
||||
$group_view = array('group_view' => $_SESSION['group_view']);
|
||||
header('Content-type: text/plain');
|
||||
echo json_encode($group_view);
|
||||
}
|
@@ -13,6 +13,7 @@
|
||||
*/
|
||||
|
||||
session_start();
|
||||
session_write_close();
|
||||
if (isset($_SESSION['stage']) && $_SESSION['stage'] == 2) {
|
||||
$init_modules = array('web', 'nodb');
|
||||
require realpath(__DIR__ . '/..') . '/includes/init.php';
|
||||
|
@@ -154,7 +154,7 @@ $(document).on("click", '.collapse-neighbors', function(event)
|
||||
|
||||
//availability-map mode change
|
||||
$(document).on("change", '#mode', function() {
|
||||
$.post('ajax_mapview.php',
|
||||
$.post('ajax/set_map_view',
|
||||
{
|
||||
map_view: $(this).val()
|
||||
},
|
||||
@@ -166,7 +166,7 @@ $(document).on("change", '#mode', function() {
|
||||
|
||||
//availability-map device group
|
||||
$(document).on("change", '#group', function() {
|
||||
$.post('ajax_mapview.php',
|
||||
$.post('ajax/set_map_group',
|
||||
{
|
||||
group_view: $(this).val()
|
||||
},
|
||||
@@ -433,7 +433,7 @@ function init_select2(selector, type, data, selected, placeholder) {
|
||||
|
||||
function humanize_duration(seconds) {
|
||||
// transform xxx seconds into yy years MM months dd days hh hours mm:ss
|
||||
|
||||
|
||||
var duration = moment.duration(Number(seconds), 's');
|
||||
var years = duration.years(),
|
||||
months = duration.months(),
|
||||
|
Reference in New Issue
Block a user