From 0d97632543e3e98ac165025db75d10c1e678f178 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sun, 8 Nov 2015 21:25:14 +0545 Subject: Captive Portal code review Make the capitalisation of the various heading pages consistent. Fix various field var name errors observed. --- src/usr/local/www/services_captiveportal.php | 42 +++++++++++----------- .../www/services_captiveportal_filemanager.php | 6 ++-- .../local/www/services_captiveportal_hostname.php | 7 ++-- .../www/services_captiveportal_hostname_edit.php | 7 ++-- src/usr/local/www/services_captiveportal_ip.php | 4 +-- .../local/www/services_captiveportal_ip_edit.php | 2 +- src/usr/local/www/services_captiveportal_mac.php | 6 ++-- .../local/www/services_captiveportal_mac_edit.php | 2 +- .../local/www/services_captiveportal_vouchers.php | 8 ++--- .../www/services_captiveportal_vouchers_edit.php | 2 +- src/usr/local/www/services_captiveportal_zones.php | 4 +-- .../www/services_captiveportal_zones_edit.php | 2 +- 12 files changed, 49 insertions(+), 43 deletions(-) diff --git a/src/usr/local/www/services_captiveportal.php b/src/usr/local/www/services_captiveportal.php index 27ff6fe..4b5cc64 100644 --- a/src/usr/local/www/services_captiveportal.php +++ b/src/usr/local/www/services_captiveportal.php @@ -96,7 +96,7 @@ if (!is_array($config['captiveportal'])) { } $a_cp =& $config['captiveportal']; -$pgtitle = array(gettext("Services"), gettext("Captive portal"), $a_cp[$cpzone]['zone']); +$pgtitle = array(gettext("Services"), gettext("Captive Portal"), $a_cp[$cpzone]['zone']); $shortcut_section = "captiveportal"; if ($_GET['act'] == "viewhtml") { @@ -301,7 +301,7 @@ if ($_POST) { } if ($_POST['timeout'] > $deftime) { - $input_errors[] = gettext("Hard timeout must be less or equal Default lease time set on DHCP Server"); + $input_errors[] = gettext("Hard timeout must be less than or equal to the Default lease time set on DHCP Server"); } } } @@ -558,9 +558,9 @@ if ($savemsg) print_info_box($savemsg, 'success'); $tab_array = array(); -$tab_array[] = array(gettext("Captive portal(s)"), true, "services_captiveportal.php?zone={$cpzone}"); +$tab_array[] = array(gettext("Captive Portal(s)"), true, "services_captiveportal.php?zone={$cpzone}"); $tab_array[] = array(gettext("MAC"), false, "services_captiveportal_mac.php?zone={$cpzone}"); -$tab_array[] = array(gettext("Allowed IP addresses"), false, "services_captiveportal_ip.php?zone={$cpzone}"); +$tab_array[] = array(gettext("Allowed IP Addresses"), false, "services_captiveportal_ip.php?zone={$cpzone}"); $tab_array[] = array(gettext("Allowed Hostnames"), false, "services_captiveportal_hostname.php?zone={$cpzone}"); $tab_array[] = array(gettext("Vouchers"), false, "services_captiveportal_vouchers.php?zone={$cpzone}"); $tab_array[] = array(gettext("File Manager"), false, "services_captiveportal_filemanager.php?zone={$cpzone}"); @@ -785,7 +785,7 @@ $group->add(new Form_Checkbox( null, 'MSCHAPv2', $pconfig['radius_protocol'] == 'MSCHAPv2', - 'SCHAPv2' + 'MSCHAPv2' ))->displayasRadio(); $section->add($group); @@ -835,10 +835,10 @@ $group->add(new Form_Input( ))->setHelp('RADIUS port. Leave blank for default (1812)'); $group->add(new Form_Input( - 'radiuskey3', + 'radiuskey2', null, 'text', - $pconfig['radiuskey3'] + $pconfig['radiuskey2'] ))->setHelp('RADIUS shared secret. Leave blank to not use a shared secret (not recommended)'); $section->add($group); @@ -851,23 +851,23 @@ $section->addClass('Secondary'); $group = new Form_Group('Primary RADIUS server'); $group->add(new Form_IpAddress( - 'radiusip4', + 'radiusip3', null, - $pconfig['radiusip4'] + $pconfig['radiusip3'] )); $group->add(new Form_Input( - 'radiusport4', + 'radiusport3', null, 'number', - $pconfig['radiusport4'] + $pconfig['radiusport3'] )); $group->add(new Form_Input( - 'radiuskey4', + 'radiuskey3', null, 'text', - $pconfig['radiuskey4'] + $pconfig['radiuskey3'] )); $section->add($group); @@ -875,23 +875,23 @@ $section->add($group); $group = new Form_Group('Secondary RADIUS server'); $group->add(new Form_IpAddress( - 'radiusip', + 'radiusip4', null, - $pconfig['radiusip'] + $pconfig['radiusip4'] ))->setHelp('IP address of the RADIUS server to authenticate against.'); $group->add(new Form_Input( - 'radiusport', + 'radiusport4', null, 'number', - $pconfig['radiusport'] + $pconfig['radiusport4'] ))->setHelp('RADIUS port. Leave blank for default (1812)'); $group->add(new Form_Input( - 'radiuskey', + 'radiuskey4', null, 'text', - $pconfig['radiuskey'] + $pconfig['radiuskey4'] ))->setHelp('RADIUS shared secret. Leave blank to not use a shared secret (not recommended)'); $section->add($group); @@ -926,7 +926,7 @@ $group->add(new Form_Checkbox( $group->add(new Form_Checkbox( 'reauthenticateacct', null, - 'Stop/stop Accounting', + 'Stop/start Accounting', $pconfig['reauthenticateacct'] == 'stopstart' ))->displayasRadio(); @@ -1042,7 +1042,7 @@ $section->addInput(new Form_Input( $section->addInput(new Form_Select( 'certref', - 'SSL Certigicate', + 'SSL Certificate', $pconfig['certref'], build_cert_list() ))->setHelp('If no certificates are defined, you may define one here: ' . 'System > Cert Manager'); diff --git a/src/usr/local/www/services_captiveportal_filemanager.php b/src/usr/local/www/services_captiveportal_filemanager.php index c4d67ac..34be0fe 100644 --- a/src/usr/local/www/services_captiveportal_filemanager.php +++ b/src/usr/local/www/services_captiveportal_filemanager.php @@ -99,7 +99,7 @@ if (!is_array($config['captiveportal'])) { } $a_cp =& $config['captiveportal']; -$pgtitle = array(gettext("Services"), gettext("Captive portal"), $a_cp[$cpzone]['zone']); +$pgtitle = array(gettext("Services"), gettext("Captive Portal"), $a_cp[$cpzone]['zone']); $shortcut_section = "captiveportal"; if (!is_array($a_cp[$cpzone]['element'])) { @@ -171,9 +171,9 @@ if ($input_errors) print_input_errors($input_errors); $tab_array = array(); -$tab_array[] = array(gettext("Captive portal(s)"), false, "services_captiveportal.php?zone={$cpzone}"); +$tab_array[] = array(gettext("Captive Portal(s)"), false, "services_captiveportal.php?zone={$cpzone}"); $tab_array[] = array(gettext("MAC"), false, "services_captiveportal_mac.php?zone={$cpzone}"); -$tab_array[] = array(gettext("Allowed IP addresses"), false, "services_captiveportal_ip.php?zone={$cpzone}"); +$tab_array[] = array(gettext("Allowed IP Addresses"), false, "services_captiveportal_ip.php?zone={$cpzone}"); $tab_array[] = array(gettext("Allowed Hostnames"), false, "services_captiveportal_hostname.php?zone={$cpzone}"); $tab_array[] = array(gettext("Vouchers"), false, "services_captiveportal_vouchers.php?zone={$cpzone}"); $tab_array[] = array(gettext("File Manager"), true, "services_captiveportal_filemanager.php?zone={$cpzone}"); diff --git a/src/usr/local/www/services_captiveportal_hostname.php b/src/usr/local/www/services_captiveportal_hostname.php index c5937c6..3d695fa 100644 --- a/src/usr/local/www/services_captiveportal_hostname.php +++ b/src/usr/local/www/services_captiveportal_hostname.php @@ -1,4 +1,7 @@ addInput(new Form_Select( 'Direction', strtolower($pconfig['dir']), build_dir_list() -))->setHelp('Use "From" to always allow an Hostname through the captive portal (without authentication). ' . +))->setHelp('Use "From" to always allow a Hostname through the captive portal (without authentication). ' . 'Use "To" to allow access from all clients (even non-authenticated ones) behind the portal to this Hostname.'); $section->addInput(new Form_Input( diff --git a/src/usr/local/www/services_captiveportal_ip.php b/src/usr/local/www/services_captiveportal_ip.php index 37da965..2754375 100644 --- a/src/usr/local/www/services_captiveportal_ip.php +++ b/src/usr/local/www/services_captiveportal_ip.php @@ -95,7 +95,7 @@ if (isset($cpzone) && !empty($cpzone) && isset($a_cp[$cpzone]['zoneid'])) { $cpzoneid = $a_cp[$cpzone]['zoneid']; } -$pgtitle = array(gettext("Services"), gettext("Captive portal"), $a_cp[$cpzone]['zone']); +$pgtitle = array(gettext("Services"), gettext("Captive Portal"), $a_cp[$cpzone]['zone']); $shortcut_section = "captiveportal"; if ($_GET['act'] == "del" && !empty($cpzone) && isset($cpzoneid)) { @@ -131,7 +131,7 @@ if ($savemsg) print_info_box($savemsg); $tab_array = array(); -$tab_array[] = array(gettext("Captive portal(s)"), false, "services_captiveportal.php?zone={$cpzone}"); +$tab_array[] = array(gettext("Captive Portal(s)"), false, "services_captiveportal.php?zone={$cpzone}"); $tab_array[] = array(gettext("MAC"), false, "services_captiveportal_mac.php?zone={$cpzone}"); $tab_array[] = array(gettext("Allowed IP Addresses"), true, "services_captiveportal_ip.php?zone={$cpzone}"); $tab_array[] = array(gettext("Allowed Hostnames"), false, "services_captiveportal_hostname.php?zone={$cpzone}"); diff --git a/src/usr/local/www/services_captiveportal_ip_edit.php b/src/usr/local/www/services_captiveportal_ip_edit.php index 88f0a52..1ee804b 100644 --- a/src/usr/local/www/services_captiveportal_ip_edit.php +++ b/src/usr/local/www/services_captiveportal_ip_edit.php @@ -84,7 +84,7 @@ require_once("filter.inc"); require("shaper.inc"); require("captiveportal.inc"); -$pgtitle = array(gettext("Services"), gettext("Captive portal"), gettext("Edit allowed IP address")); +$pgtitle = array(gettext("Services"), gettext("Captive Portal"), gettext("Edit allowed IP address")); $shortcut_section = "captiveportal"; $cpzone = $_GET['zone']; diff --git a/src/usr/local/www/services_captiveportal_mac.php b/src/usr/local/www/services_captiveportal_mac.php index e45da34..9c81f2d 100644 --- a/src/usr/local/www/services_captiveportal_mac.php +++ b/src/usr/local/www/services_captiveportal_mac.php @@ -90,7 +90,7 @@ if (!is_array($config['captiveportal'])) { } $a_cp =& $config['captiveportal']; -$pgtitle = array(gettext("Services"), gettext("Captive portal"), $a_cp[$cpzone]['zone']); +$pgtitle = array(gettext("Services"), gettext("Captive Portal"), $a_cp[$cpzone]['zone']); $shortcut_section = "captiveportal"; $actsmbl = array('pass' => ' Pass', @@ -193,9 +193,9 @@ if (is_subsystem_dirty('passthrumac')) print_info_box_np(gettext("The captive portal MAC address configuration has been changed.
You must apply the changes in order for them to take effect.")); $tab_array = array(); -$tab_array[] = array(gettext("Captive portal(s)"), false, "services_captiveportal.php?zone={$cpzone}"); +$tab_array[] = array(gettext("Captive Portal(s)"), false, "services_captiveportal.php?zone={$cpzone}"); $tab_array[] = array(gettext("MAC"), true, "services_captiveportal_mac.php?zone={$cpzone}"); -$tab_array[] = array(gettext("Allowed IP addresses"), false, "services_captiveportal_ip.php?zone={$cpzone}"); +$tab_array[] = array(gettext("Allowed IP Addresses"), false, "services_captiveportal_ip.php?zone={$cpzone}"); $tab_array[] = array(gettext("Allowed Hostnames"), false, "services_captiveportal_hostname.php?zone={$cpzone}"); $tab_array[] = array(gettext("Vouchers"), false, "services_captiveportal_vouchers.php?zone={$cpzone}"); $tab_array[] = array(gettext("File Manager"), false, "services_captiveportal_filemanager.php?zone={$cpzone}"); diff --git a/src/usr/local/www/services_captiveportal_mac_edit.php b/src/usr/local/www/services_captiveportal_mac_edit.php index 3750b42..5de3e66 100644 --- a/src/usr/local/www/services_captiveportal_mac_edit.php +++ b/src/usr/local/www/services_captiveportal_mac_edit.php @@ -86,7 +86,7 @@ require("captiveportal.inc"); global $cpzone; global $cpzoneid; -$pgtitle = array(gettext("Services"), gettext("Captive portal"), gettext("Edit MAC address rules")); +$pgtitle = array(gettext("Services"), gettext("Captive Portal"), gettext("Edit MAC address rules")); $shortcut_section = "captiveportal"; $cpzone = $_GET['zone']; diff --git a/src/usr/local/www/services_captiveportal_vouchers.php b/src/usr/local/www/services_captiveportal_vouchers.php index e2a36c9..84e0e72 100644 --- a/src/usr/local/www/services_captiveportal_vouchers.php +++ b/src/usr/local/www/services_captiveportal_vouchers.php @@ -111,7 +111,7 @@ if (empty($a_cp[$cpzone])) { exit; } -$pgtitle = array(gettext("Services"), gettext("Captive portal"), gettext("Vouchers"), $a_cp[$cpzone]['zone']); +$pgtitle = array(gettext("Services"), gettext("Captive Portal"), gettext("Vouchers"), $a_cp[$cpzone]['zone']); $shortcut_section = "captiveportal-vouchers"; if (!is_array($config['voucher'][$cpzone]['roll'])) { @@ -430,9 +430,9 @@ if ($savemsg) print_info_box($savemsg. 'success'); $tab_array = array(); -$tab_array[] = array(gettext("Captive portal(s)"), false, "services_captiveportal.php?zone={$cpzone}"); +$tab_array[] = array(gettext("Captive Portal(s)"), false, "services_captiveportal.php?zone={$cpzone}"); $tab_array[] = array(gettext("MAC"), false, "services_captiveportal_mac.php?zone={$cpzone}"); -$tab_array[] = array(gettext("Allowed IP addresses"), false, "services_captiveportal_ip.php?zone={$cpzone}"); +$tab_array[] = array(gettext("Allowed IP Addresses"), false, "services_captiveportal_ip.php?zone={$cpzone}"); $tab_array[] = array(gettext("Allowed Hostnames"), false, "services_captiveportal_hostname.php?zone={$cpzone}"); $tab_array[] = array(gettext("Vouchers"), true, "services_captiveportal_vouchers.php?zone={$cpzone}"); $tab_array[] = array(gettext("File Manager"), false, "services_captiveportal_filemanager.php?zone={$cpzone}"); @@ -613,7 +613,7 @@ $section->addInput(new Form_Input( 'vouchersyncpass', 'Voucher sync password', 'password', - $pconfig['vouchersyncuserpass'] + $pconfig['vouchersyncpass'] ))->setHelp('This is the password of the master voucher nodes webConfigurator.'); $section->addInput(new Form_Input( diff --git a/src/usr/local/www/services_captiveportal_vouchers_edit.php b/src/usr/local/www/services_captiveportal_vouchers_edit.php index 2ee9d43..f58cdc2 100644 --- a/src/usr/local/www/services_captiveportal_vouchers_edit.php +++ b/src/usr/local/www/services_captiveportal_vouchers_edit.php @@ -71,7 +71,7 @@ require("shaper.inc"); require("captiveportal.inc"); require_once("voucher.inc"); -$pgtitle = array(gettext("Services"), gettext("Captive portal"), gettext("Edit Voucher Rolls")); +$pgtitle = array(gettext("Services"), gettext("Captive Portal"), gettext("Edit Voucher Rolls")); $shortcut_section = "captiveportal-vouchers"; $cpzone = $_GET['zone']; diff --git a/src/usr/local/www/services_captiveportal_zones.php b/src/usr/local/www/services_captiveportal_zones.php index 62b8583..338bb41 100644 --- a/src/usr/local/www/services_captiveportal_zones.php +++ b/src/usr/local/www/services_captiveportal_zones.php @@ -98,11 +98,11 @@ if ($savemsg) print_info_box($savemsg, success); if (is_subsystem_dirty('captiveportal')) - print_info_box_np(gettext("The CaptivePortal entry list has been changed") . ".
" . gettext("You must apply the changes in order for them to take effect.")); + print_info_box_np(gettext("The Captive Portal entry list has been changed") . ".
" . gettext("You must apply the changes in order for them to take effect.")); ?>
-

+

diff --git a/src/usr/local/www/services_captiveportal_zones_edit.php b/src/usr/local/www/services_captiveportal_zones_edit.php index 6804525..275af01 100644 --- a/src/usr/local/www/services_captiveportal_zones_edit.php +++ b/src/usr/local/www/services_captiveportal_zones_edit.php @@ -69,7 +69,7 @@ require_once("filter.inc"); require("shaper.inc"); require("captiveportal.inc"); -$pgtitle = array(gettext("Services"), gettext("Captive portal"), gettext("Edit Zones")); +$pgtitle = array(gettext("Services"), gettext("Captive Portal"), gettext("Edit Zones")); $shortcut_section = "captiveportal"; if (!is_array($config['captiveportal'])) { -- cgit v1.1