mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: Stop irc bot crashing on .reload #4353
* Removed duplicate include * Move set_debug into functions.php, and restore the (re)loading of includes/defaults * Move debug call until after function has been included
This commit is contained in:
committed by
Neil Lathwood
parent
50a02a0fc5
commit
f00c383d60
@@ -13,13 +13,14 @@
|
||||
*/
|
||||
|
||||
require_once '../includes/defaults.inc.php';
|
||||
set_debug($_REQUEST['debug']);
|
||||
require_once '../config.php';
|
||||
require_once '../includes/definitions.inc.php';
|
||||
require_once 'includes/functions.inc.php';
|
||||
require_once '../includes/functions.php';
|
||||
require_once 'includes/authenticate.inc.php';
|
||||
|
||||
set_debug($_REQUEST['debug']);
|
||||
|
||||
if (!$_SESSION['authenticated']) {
|
||||
echo 'unauthenticated';
|
||||
exit;
|
||||
|
@@ -15,7 +15,6 @@
|
||||
// FUA
|
||||
|
||||
require_once '../includes/defaults.inc.php';
|
||||
set_debug($_REQUEST['debug']);
|
||||
require_once '../config.php';
|
||||
require_once '../includes/definitions.inc.php';
|
||||
require_once 'includes/functions.inc.php';
|
||||
@@ -23,6 +22,8 @@ require_once '../includes/functions.php';
|
||||
require_once 'includes/authenticate.inc.php';
|
||||
require_once 'includes/vars.inc.php';
|
||||
|
||||
set_debug($_REQUEST['debug']);
|
||||
|
||||
if (!$_SESSION['authenticated']) {
|
||||
echo 'unauthenticated';
|
||||
exit;
|
||||
|
@@ -12,7 +12,6 @@
|
||||
*/
|
||||
|
||||
require_once '../includes/defaults.inc.php';
|
||||
set_debug($_REQUEST['debug']);
|
||||
require_once '../config.php';
|
||||
require_once '../includes/definitions.inc.php';
|
||||
require_once 'includes/functions.inc.php';
|
||||
@@ -22,6 +21,8 @@ require_once '../includes/common.php';
|
||||
require_once '../includes/rewrites.php';
|
||||
require_once 'includes/authenticate.inc.php';
|
||||
|
||||
set_debug($_REQUEST['debug']);
|
||||
|
||||
if (!$_SESSION['authenticated']) {
|
||||
echo 'unauthenticated';
|
||||
exit;
|
||||
|
@@ -29,11 +29,11 @@ if (!isset($_SESSION['authenticated'])) {
|
||||
}
|
||||
|
||||
require_once '../includes/defaults.inc.php';
|
||||
set_debug($_REQUEST['debug']);
|
||||
require_once '../config.php';
|
||||
require_once '../includes/definitions.inc.php';
|
||||
require_once '../includes/functions.php';
|
||||
|
||||
set_debug($_REQUEST['debug']);
|
||||
|
||||
/**
|
||||
* Levenshtein Sort
|
||||
|
@@ -1,13 +1,14 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/defaults.inc.php';
|
||||
set_debug($_REQUEST['debug']);
|
||||
require_once '../config.php';
|
||||
require_once '../includes/definitions.inc.php';
|
||||
require_once 'includes/functions.inc.php';
|
||||
require_once '../includes/functions.php';
|
||||
require_once 'includes/authenticate.inc.php';
|
||||
|
||||
set_debug($_REQUEST['debug']);
|
||||
|
||||
if (!$_SESSION['authenticated']) {
|
||||
echo 'unauthenticated';
|
||||
exit;
|
||||
|
@@ -13,13 +13,14 @@
|
||||
*/
|
||||
|
||||
require_once '../includes/defaults.inc.php';
|
||||
set_debug($_REQUEST['debug']);
|
||||
require_once '../config.php';
|
||||
require_once '../includes/definitions.inc.php';
|
||||
require_once 'includes/functions.inc.php';
|
||||
require_once '../includes/functions.php';
|
||||
require_once 'includes/authenticate.inc.php';
|
||||
|
||||
set_debug($_REQUEST['debug']);
|
||||
|
||||
$current = $_POST['current'];
|
||||
settype($current, 'integer');
|
||||
$rowCount = $_POST['rowCount'];
|
||||
|
@@ -23,17 +23,6 @@
|
||||
//
|
||||
error_reporting(E_ERROR|E_PARSE|E_CORE_ERROR|E_COMPILE_ERROR);
|
||||
|
||||
function set_debug($debug)
|
||||
{
|
||||
if (isset($debug)) {
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 0);
|
||||
ini_set('log_errors', 0);
|
||||
ini_set('allow_url_fopen', 0);
|
||||
ini_set('error_reporting', E_ALL);
|
||||
}
|
||||
}//end set_debug()
|
||||
|
||||
// set install_dir
|
||||
$config['install_dir'] = realpath(__DIR__ . '/..');
|
||||
|
||||
|
@@ -37,6 +37,17 @@ include_once($config['install_dir'] . "/includes/services.inc.php");
|
||||
|
||||
$console_color = new Console_Color2();
|
||||
|
||||
function set_debug($debug)
|
||||
{
|
||||
if (isset($debug)) {
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 0);
|
||||
ini_set('log_errors', 0);
|
||||
ini_set('allow_url_fopen', 0);
|
||||
ini_set('error_reporting', E_ALL);
|
||||
}
|
||||
}//end set_debug()
|
||||
|
||||
function array_sort($array, $on, $order = SORT_ASC)
|
||||
{
|
||||
$new_array = array();
|
||||
|
Reference in New Issue
Block a user