Commit version 24.12.13800

This commit is contained in:
2025-01-06 17:35:06 -05:00
parent b7f6a79c2c
commit 55d9218816
6133 changed files with 4239740 additions and 1374287 deletions

View File

@ -1,56 +1,52 @@
<?php
/**
* Observium Network Management and Monitoring System
* Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage webui
* @author Adam Armstrong <adama@observium.org>
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
* @subpackage web
* @copyright (C) Adam Armstrong
*
*/
if (!isset($vars['section'])) { $vars['section'] = 'eventlog'; }
$sections = array('eventlog');
if ($config['enable_syslog'])
{
$sections[] = 'syslog';
if (OBSERVIUM_EDITION != 'community')
{
$sections[] = 'logalert';
}
// Allowed sections: eventlog, syslog, logalert, alertlog
$sections = [ 'eventlog' ];
if ($config['enable_syslog']) {
$sections[] = 'syslog';
if (OBSERVIUM_EDITION != 'community') {
$sections[] = 'logalert';
}
}
$sections[] = 'alertlog';
if (empty($vars['section'])) {
$vars['section'] = 'eventlog';
} elseif (!is_alpha($vars['section']) || !in_array($vars['section'], $sections, TRUE)) {
//r($vars['section']);
print_error_permission("Unknown Logs section.");
return;
}
$navbar['brand'] = "Logging";
$navbar['class'] = "navbar-narrow";
foreach ($sections as $section)
{
$type = strtolower($section);
if (!isset($vars['section'])) { $vars['section'] = $section; }
foreach ($sections as $section) {
$type = strtolower($section);
if (!isset($vars['section'])) {
$vars['section'] = escape_html($section);
}
if ($vars['section'] == $section) { $navbar['options'][$section]['class'] = "active"; }
$navbar['options'][$section]['url'] = generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'logs', 'section' => $section));
$navbar['options'][$section]['text'] = nicecase($section);
if ($vars['section'] == $section) {
$navbar['options'][$section]['class'] = "active";
}
$navbar['options'][$section]['url'] = generate_url(['page' => 'device', 'device' => $device['device_id'], 'tab' => 'logs', 'section' => $section]);
$navbar['options'][$section]['text'] = nicecase($section);
}
print_navbar($navbar);
switch ($vars['section'])
{
case 'syslog':
case 'eventlog':
case 'alertlog':
case 'logalert':
include($config['html_dir'].'/pages/device/logs/'.$vars['section'].'.inc.php');
break;
default:
echo('<h2>Error. No section '.$vars['section'].'.<br /> Please report this to observium developers.</h2>');
break;
}
include($config['html_dir'] . '/pages/device/logs/' . $vars['section'] . '.inc.php');
// EOF