Commit acc319f3 authored by Franco Fichtner's avatar Franco Fichtner

rrd: restructure settings POST a little

parent 0e101efe
...@@ -33,26 +33,20 @@ require_once("interfaces.inc"); ...@@ -33,26 +33,20 @@ require_once("interfaces.inc");
$pconfig['enable'] = isset($config['rrd']['enable']); $pconfig['enable'] = isset($config['rrd']['enable']);
if ($_POST['ResetRRD']) { if ($_POST) {
mwexec('/bin/rm /var/db/rrd/*');
enable_rrd_graphing();
setup_gateways_monitor();
$savemsg = "RRD data has been cleared. New RRD files have been generated.";
} elseif ($_POST) {
unset($input_errors);
$pconfig = $_POST; $pconfig = $_POST;
/* input validation */ if (isset($pconfig['ResetRRD'])) {
/* none */ $savemsg = gettext('RRD data has been cleared.');
mwexec('/bin/rm /var/db/rrd/*');
if (!$input_errors) { } else {
$config['rrd']['enable'] = $_POST['enable'] ? true : false; $config['rrd']['enable'] = $_POST['enable'] ? true : false;
write_config();
$retval = 0;
$retval = enable_rrd_graphing();
$savemsg = get_std_save_message(); $savemsg = get_std_save_message();
write_config();
} }
enable_rrd_graphing();
setup_gateways_monitor();
} }
$pgtitle = array(gettext('System'), gettext('Settings'), gettext('RRD Graphs')); $pgtitle = array(gettext('System'), gettext('Settings'), gettext('RRD Graphs'));
...@@ -68,7 +62,6 @@ include("head.inc"); ...@@ -68,7 +62,6 @@ include("head.inc");
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<?php if (isset($savemsg)) print_info_box($savemsg); ?> <?php if (isset($savemsg)) print_info_box($savemsg); ?>
<section class="col-xs-12"> <section class="col-xs-12">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment