summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2017-03-24 11:35:20 -0400
committerjim-p <jimp@pfsense.org>2017-03-24 11:36:22 -0400
commit1ae0947a1b2d9894c7b5ece509ca10ee3d3b6db6 (patch)
tree31aa0444456167e58f5b611d49bb8c9e0b66666e
parentbf4440b495e0555981c606ec8808b3b544847b8e (diff)
downloadpfsense-1ae0947a1b2d9894c7b5ece509ca10ee3d3b6db6.zip
pfsense-1ae0947a1b2d9894c7b5ece509ca10ee3d3b6db6.tar.gz
Show the button to reset CARP demotion status even when the value is negative, and change the reset code to accommodate. Also fixup text in that dialog. Fixes #7424
-rw-r--r--src/usr/local/www/status_carp.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/usr/local/www/status_carp.php b/src/usr/local/www/status_carp.php
index 1141a26..888b556 100644
--- a/src/usr/local/www/status_carp.php
+++ b/src/usr/local/www/status_carp.php
@@ -130,7 +130,7 @@ if ($_POST['disablecarp'] != "") {
$carp_detected_problems = get_single_sysctl("net.inet.carp.demotion");
if (!empty($_POST['resetdemotion'])) {
- set_single_sysctl("net.inet.carp.demotion", "-{$carp_detected_problems}");
+ set_single_sysctl("net.inet.carp.demotion", 0 - $carp_detected_problems);
sleep(1);
$carp_detected_problems = get_single_sysctl("net.inet.carp.demotion");
}
@@ -172,18 +172,17 @@ if ($carpcount == 0) {
}
// Sadly this needs to be here so that it is inside the form
- if ($carp_detected_problems > 0) {
+ if ($carp_detected_problems != 0) {
print_info_box(
- gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") .
+ gettext("CARP has detected a problem and this unit has a non-zero demotion status.") .
"<br/>" .
- gettext("Check the link status on all interfaces with configured CARP VIPs.") .
- "<br/>" .
- sprintf(gettext('Search the %1$sSystem Log%2$s for CARP demotion-related events.'), "<a href=\"/status_logs.php?filtertext=carp%3A+demoted+by\">", "</a>") .
+ gettext("Check the link status on all interfaces configured with CARP VIPs and ") .
+ sprintf(gettext('search the %1$sSystem Log%2$s for CARP demotion-related events.'), "<a href=\"/status_logs.php?filtertext=carp%3A+demoted+by\">", "</a>") .
"<br/><br/>" .
'<button type="submit" class="btn btn-warning" name="resetdemotion" id="resetdemotion" value="' .
- gettext("Reset CARP Demotion Status.") .
+ gettext("Reset CARP Demotion Status") .
'"><i class="fa fa-undo icon-embed-btn"></i>' .
- gettext("Reset CARP Demotion Status.") .
+ gettext("Reset CARP Demotion Status") .
'</button>',
'danger'
);
OpenPOWER on IntegriCloud