mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: Centralize includes and initialization (#4991)
This commit is contained in:
committed by
Neil Lathwood
parent
bbf05feb90
commit
9a33464c52
@@ -12,12 +12,6 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
require_once '../includes/functions.php';
|
||||
require_once '../includes/device-groups.inc.php';
|
||||
if (file_exists('../html/includes/authentication/'.$config['auth_mechanism'].'.inc.php')) {
|
||||
include '../html/includes/authentication/'.$config['auth_mechanism'].'.inc.php';
|
||||
}
|
||||
|
||||
function authToken(\Slim\Route $route)
|
||||
{
|
||||
$app = \Slim\Slim::getInstance();
|
||||
|
@@ -48,13 +48,6 @@ if (!isset($config['auth_mechanism'])) {
|
||||
$config['auth_mechanism'] = 'mysql';
|
||||
}
|
||||
|
||||
if (file_exists('includes/authentication/'.$config['auth_mechanism'].'.inc.php')) {
|
||||
include_once 'includes/authentication/'.$config['auth_mechanism'].'.inc.php';
|
||||
} else {
|
||||
print_error('ERROR: no valid auth_mechanism defined!');
|
||||
exit();
|
||||
}
|
||||
|
||||
$auth_success = 0;
|
||||
|
||||
if ((isset($_SESSION['username'])) || (isset($_COOKIE['sess_id'],$_COOKIE['token']))) {
|
||||
|
@@ -1055,19 +1055,6 @@ function clean_bootgrid($string)
|
||||
}//end clean_bootgrid()
|
||||
|
||||
|
||||
// Insert new config items
|
||||
function add_config_item($new_conf_name, $new_conf_value, $new_conf_type, $new_conf_desc)
|
||||
{
|
||||
if (dbInsert(array('config_name' => $new_conf_name, 'config_value' => $new_conf_value, 'config_default' => $new_conf_value, 'config_type' => $new_conf_type, 'config_desc' => $new_conf_desc, 'config_group' => '500_Custom Settings', 'config_sub_group' => '01_Custom settings', 'config_hidden' => '0', 'config_disabled' => '0'), 'config')) {
|
||||
$db_inserted = 1;
|
||||
} else {
|
||||
$db_inserted = 0;
|
||||
}
|
||||
|
||||
return ($db_inserted);
|
||||
}//end add_config_item()
|
||||
|
||||
|
||||
function get_config_by_group($group)
|
||||
{
|
||||
$group = array($group);
|
||||
|
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
// Authorises bill viewing and sets $ports as reference to mysql query containing ports for this bill
|
||||
require '../includes/billing.php';
|
||||
|
||||
if (is_numeric($_GET['id']) && ($auth || bill_permitted($_GET['id']))) {
|
||||
$bill = dbFetchRow('SELECT * FROM `bills` WHERE bill_id = ?', array($_GET['id']));
|
||||
|
@@ -57,6 +57,7 @@ if ($config['title_image']) {
|
||||
<li><a href="<?php echo(generate_url(array('page'=>'availability-map'))); ?>"><i class="fa fa-arrow-circle-up fa-fw fa-lg" aria-hidden="true"></i> Availability</a></li>
|
||||
<li><a href="<?php echo(generate_url(array('page'=>'map'))); ?>"><i class="fa fa-desktop fa-fw fa-lg" aria-hidden="true"></i> Network</a></li>
|
||||
<?php
|
||||
echo 'BROKE HERE';
|
||||
require_once '../includes/device-groups.inc.php';
|
||||
$devices_groups = GetDeviceGroups();
|
||||
if (count($devices_groups) > 0) {
|
||||
|
Reference in New Issue
Block a user