Commit 31293e66 authored by Franco Fichtner's avatar Franco Fichtner

www: purge $changecount for #394

parent 456bb54e
......@@ -338,13 +338,11 @@ function gentitle($title) {
return join($navlevelsep, $title);
}
/* update the changedesc and changecount(er) variables */
function update_changedesc($update) {
function update_changedesc($update)
{
global $changedesc;
global $changecount;
$changedesc .= " {$update}";
$changecount++;
}
function clear_log($logfile, $restart_syslogd = true)
......
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2008 Bill Marquette <bill.marquette@gmail.com>.
......@@ -127,11 +128,8 @@ if (isset($id) && $a_monitor[$id]) {
}
$changedesc = gettext("Load Balancer: Monitor:") . " ";
$changecount = 0;
if ($_POST) {
$changecount++;
unset($input_errors);
$pconfig = $_POST;
......@@ -239,15 +237,12 @@ if ($_POST) {
$config['load_balancer']['lbpool'][$i]['monitor'] = $monent['name'];
}
$a_monitor[$id] = $monent;
} else
} else {
$a_monitor[] = $monent;
}
if ($changecount > 0) {
/* Mark config dirty */
mark_subsystem_dirty('loadbalancer');
write_config($changedesc);
}
header("Location: load_balancer_monitor.php");
exit;
}
......
......@@ -55,11 +55,8 @@ if (isset($id) && $a_pool[$id]) {
}
$changedesc = gettext("Load Balancer: Pool:") . " ";
$changecount = 0;
if ($_POST) {
$changecount++;
unset($input_errors);
$pconfig = $_POST;
......@@ -140,15 +137,12 @@ if ($_POST) {
$config['load_balancer']['virtual_server'][$i]['lbpool'] = $poolent['name'];
}
$a_pool[$id] = $poolent;
} else
} else {
$a_pool[] = $poolent;
}
if ($changecount > 0) {
/* Mark pool dirty */
mark_subsystem_dirty('loadbalancer');
write_config($changedesc);
}
header("Location: load_balancer_pool.php");
exit;
}
......
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2008 Bill Marquette <bill.marquette@gmail.com>.
......@@ -54,7 +55,6 @@ if (isset($id) && $a_action[$id]) {
}
$changedesc = gettext("Load Balancer: Relay Action:") . " ";
$changecount = 0;
$kv = array('key', 'value');
$vk = array('value', 'key');
......@@ -92,8 +92,6 @@ $actions['direction']['response']['header'] = $hr_actions;
if ($_POST) {
$changecount++;
unset($input_errors);
$pconfig = $_POST;
......@@ -157,12 +155,9 @@ if ($_POST) {
} else {
$a_action[] = $actent;
}
if ($changecount > 0) {
/* Mark config dirty */
mark_subsystem_dirty('loadbalancer');
write_config($changedesc);
}
header("Location: load_balancer_relay_action.php");
exit;
}
......
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2008 Bill Marquette <bill.marquette@gmail.com>.
......@@ -26,11 +27,9 @@
POSSIBILITY OF SUCH DAMAGE.
*/
require_once("guiconfig.inc");
require_once("services.inc");
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/load_balancer_relay_protocol.php');
if (!is_array($config['load_balancer']['lbprotocol'])) {
......@@ -55,13 +54,8 @@ if (isset($id) && $a_protocol[$id]) {
}
$changedesc = gettext("Load Balancer: Relay Protocol:") . " ";
$changecount = 0;
if ($_POST) {
$changecount++;
unset($input_errors);
$pconfig = $_POST;
......@@ -115,12 +109,8 @@ if ($_POST) {
$a_protocol[] = $protent;
}
if ($changecount > 0) {
/* Mark config dirty */
mark_subsystem_dirty('loadbalancer');
write_config($changedesc);
}
header("Location: load_balancer_relay_protocol.php");
exit;
}
......
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2005-2008 Bill Marquette <bill.marquette@gmail.com>.
......@@ -52,7 +53,6 @@ if (isset($id) && $a_vs[$id]) {
}
$changedesc = gettext("Load Balancer: Virtual Server:") . " ";
$changecount = 0;
if ($_POST) {
unset($input_errors);
......@@ -119,15 +119,12 @@ if ($_POST) {
cleanup_lb_mark_anchor($a_vs[$id]['name']);
}
$a_vs[$id] = $vsent;
} else
} else {
$a_vs[] = $vsent;
}
if ($changecount > 0) {
/* Mark virtual server dirty */
mark_subsystem_dirty('loadbalancer');
write_config($changedesc);
}
header("Location: load_balancer_virtual_server.php");
exit;
}
......
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