From e65a15e49efbdeb6cef19a7beec1c28fc76c4c29 Mon Sep 17 00:00:00 2001 From: Steve Beaver Date: Wed, 31 Oct 2018 10:34:55 -0400 Subject: [PATCH] Add help text to sshguard whitelist Reduce delete button size Change label text to "Add address" (cherry picked from commit 5514e368421171482e3e5b945f4c999cc0153fa8) --- src/usr/local/www/system_advanced_admin.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/usr/local/www/system_advanced_admin.php b/src/usr/local/www/system_advanced_admin.php index 1ecf744344..545d880390 100644 --- a/src/usr/local/www/system_advanced_admin.php +++ b/src/usr/local/www/system_advanced_admin.php @@ -626,7 +626,9 @@ $section->addinput(new form_input( $counter = 0; $addresses = explode(' ', $pconfig['sshguard_whitelist']); -while ($counter < count($addresses)) { +$numaddrs = count($addresses); + +while ($counter < $numaddrs) { list($address, $address_subnet) = explode("/", $addresses[$counter]); $group = new Form_Group($counter == 0 ? 'Whitelist' : ''); @@ -644,7 +646,12 @@ while ($counter < count($addresses)) { 'Delete', null, 'fa-trash' - ))->addClass('btn-warning'); + ))->addClass('btn-warning btn-xs'); + + if ($counter == ($numaddrs - 1)) { + $group->setHelp(gettext(sprintf("%sAddresses added to the whitelist will bypass login protection.%s", + '', ''))); + } $section->add($group); $counter++; @@ -712,8 +719,9 @@ print $form; //" === "true"); // ---------- Click checkbox handlers --------------------------------------------------------- - $('[name=webguiproto]').click(function () { hideInput('ssl-certref', $('input[name=webguiproto]:checked').val() == 'http'); hideCheckbox('webgui-hsts', $('input[name=webguiproto]:checked').val() == 'http');