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:
Tony Murray
2019-10-26 00:29:12 +00:00
committed by GitHub
parent d72c722075
commit e6423852ef
15 changed files with 78 additions and 101 deletions

View File

@@ -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);
}

View File

@@ -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';

View File

@@ -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(),