Remove session creation in scripts

This commit is contained in:
bergware
2022-07-06 08:50:22 +02:00
parent 1dc59e5fd9
commit 594533f8a2
15 changed files with 32 additions and 61 deletions
@@ -12,7 +12,6 @@
*/
?>
<?
session_start();
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/webGui/include/Wrappers.php";
@@ -21,7 +20,7 @@ extract(parse_plugin_cfg('dynamix',true));
// add translations
$_SERVER['REQUEST_URI'] = 'plugins';
$_SESSION['locale'] = $display['locale'];
$login_locale = $display['locale'];
require_once "$docroot/webGui/include/Translations.php";
$console = $argv[$argc-1] != 'nchan'; // console or nchan output
@@ -1,7 +1,7 @@
#!/usr/bin/php -q
<?PHP
/* Copyright 2005-2020, Lime Technology
* Copyright 2012-2020, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -12,19 +12,17 @@
*/
?>
<?
session_start();
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/webGui/include/Wrappers.php";
require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php";
$var = parse_ini_file('/var/local/emhttp/var.ini');
$unraid = parse_plugin_cfg('dynamix', true);
$var = parse_ini_file('/var/local/emhttp/var.ini');
$unraid = parse_plugin_cfg('dynamix', true);
// Multi-language support
$_SESSION['locale'] = $unraid['display']['locale'];
$_SERVER['REQUEST_URI'] = "scripts";
$login_locale = $unraid['display']['locale'];
require_once "$docroot/webGui/include/Translations.php";
$server = strtoupper($var['NAME']);
@@ -1,7 +1,7 @@
#!/usr/bin/php -q
<?PHP
/* Copyright 2005-2021, Lime Technology
* Copyright 2012-2021, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -12,18 +12,17 @@
*/
?>
<?
session_start();
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/webGui/include/Wrappers.php";
require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php";
$var = parse_ini_file('/var/local/emhttp/var.ini');
$unraid = parse_plugin_cfg('dynamix', true);
$var = parse_ini_file('/var/local/emhttp/var.ini');
$unraid = parse_plugin_cfg('dynamix', true);
// Multi-language support
$_SESSION['locale'] = $unraid['display']['locale'];
$_SERVER['REQUEST_URI'] = "scripts";
$login_locale = $unraid['display']['locale'];
require_once "$docroot/webGui/include/Translations.php";
function apos($text) {
@@ -12,7 +12,6 @@
*/
?>
<?
session_start();
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/webGui/include/Wrappers.php";
@@ -20,7 +19,7 @@ extract(parse_plugin_cfg('dynamix',true));
// add translations
$_SERVER['REQUEST_URI'] = 'plugins';
$_SESSION['locale'] = $display['locale'];
$login_locale = $display['locale'];
require_once "$docroot/webGui/include/Translations.php";
$file = realpath($argv[1] ?? '');