diff options
author | Phil Davis <phil.davis@inf.org> | 2017-01-23 12:04:28 +0545 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-01-30 10:27:18 -0200 |
commit | 23f933dfc0bca33f03b66d88783363b9e886d9cb (patch) | |
tree | 4cea7c8a0c4425b93112e8ab70a2becb0dfbcf7d | |
parent | 5c914c00c5e0ddd9bf71a533334d8c97393cf554 (diff) | |
download | pfsense-23f933dfc0bca33f03b66d88783363b9e886d9cb.zip pfsense-23f933dfc0bca33f03b66d88783363b9e886d9cb.tar.gz |
Required fields in Interfaces pages
(cherry picked from commit 1095b20410963e748fe13268e6fa8f35ccce2319)
-rw-r--r-- | src/usr/local/www/interfaces.php | 22 | ||||
-rw-r--r-- | src/usr/local/www/interfaces_bridge_edit.php | 2 | ||||
-rw-r--r-- | src/usr/local/www/interfaces_gif_edit.php | 6 | ||||
-rw-r--r-- | src/usr/local/www/interfaces_gre_edit.php | 6 | ||||
-rw-r--r-- | src/usr/local/www/interfaces_groups_edit.php | 2 | ||||
-rw-r--r-- | src/usr/local/www/interfaces_lagg_edit.php | 2 | ||||
-rw-r--r-- | src/usr/local/www/interfaces_ppps_edit.php | 29 | ||||
-rw-r--r-- | src/usr/local/www/interfaces_qinq_edit.php | 2 | ||||
-rw-r--r-- | src/usr/local/www/interfaces_vlan_edit.php | 2 |
9 files changed, 46 insertions, 27 deletions
diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php index b2578a4..0f33780 100644 --- a/src/usr/local/www/interfaces.php +++ b/src/usr/local/www/interfaces.php @@ -1755,7 +1755,7 @@ $section->addInput(new Form_Checkbox( $section->addInput(new Form_Input( 'descr', - 'Description', + '*Description', 'text', $pconfig['descr'] ))->setHelp('Enter a description (name) for the interface here.'); @@ -1831,7 +1831,7 @@ $section->addClass('staticv4'); $section->addInput(new Form_IpAddress( 'ipaddr', - 'IPv4 Address', + '*IPv4 Address', $pconfig['ipaddr'], 'V4' ))->addMask('subnet', $pconfig['subnet'], 32); @@ -1865,7 +1865,7 @@ $section->addClass('staticv6'); $section->addInput(new Form_IpAddress( 'ipaddrv6', - 'IPv6 address', + '*IPv6 address', $pconfig['ipaddrv6'], 'V6' ))->addMask('subnetv6', $pconfig['subnetv6'], 128); @@ -2442,7 +2442,7 @@ $section->addInput(new Form_Input( $section->addInput(new Form_Input( 'gateway-6rd', - '6RD Border relay', + '*6RD Border relay', 'text', $pconfig['gateway-6rd'] ))->sethelp('6RD IPv4 gateway address assigned by the ISP'); @@ -2499,7 +2499,7 @@ function build_ipv6interface_list() { $section->addInput(new Form_Select( 'track6-interface', - 'IPv6 Interface', + '*IPv6 Interface', $pconfig['track6-interface'], build_ipv6interface_list() ))->setHelp('Selects the dynamic IPv6 WAN interface to track for configuration.'); @@ -2566,7 +2566,7 @@ $section->addPassword(new Form_Input( $section->addInput(new Form_Input( 'phone', - 'Phone number', + '*Phone number', 'text', $pconfig['phone'] ))->setHelp('Typically *99# for GSM networks and #777 for CDMA networks.'); @@ -2599,7 +2599,7 @@ function build_port_list() { $section->addInput(new Form_Select( 'port', - "Modem port", + "*Modem port", $pconfig['port'], build_port_list() )); @@ -2744,28 +2744,28 @@ $section->addClass('pptp'); $section->addInput(new Form_Input( 'pptp_username', - 'Username', + '*Username', 'text', $pconfig['pptp_username'] )); $section->addPassword(new Form_Input( 'pptp_password', - 'Password', + '*Password', 'password', $pconfig['pptp_password'] )); $section->addInput(new Form_IpAddress( 'pptp_local0', - 'Local IP address', + '*Local IP address', $pconfig['pptp_localip'][0], 'V4' ))->addMask('pptp_subnet0', $pconfig['pptp_subnet'][0]); $section->addInput(new Form_IpAddress( 'pptp_remote0', - 'Remote IP address', + '*Remote IP address', $pconfig['pptp_remote'][0], 'HOSTV4' )); diff --git a/src/usr/local/www/interfaces_bridge_edit.php b/src/usr/local/www/interfaces_bridge_edit.php index e982c7f..46cc53e 100644 --- a/src/usr/local/www/interfaces_bridge_edit.php +++ b/src/usr/local/www/interfaces_bridge_edit.php @@ -429,7 +429,7 @@ $memberslist = build_port_list($pconfig['members']); $section->addInput(new Form_Select( 'members', - 'Member Interfaces', + '*Member Interfaces', $memberslist['selected'], $memberslist['list'], true // Allow multiples diff --git a/src/usr/local/www/interfaces_gif_edit.php b/src/usr/local/www/interfaces_gif_edit.php index 9286c07..5560b82 100644 --- a/src/usr/local/www/interfaces_gif_edit.php +++ b/src/usr/local/www/interfaces_gif_edit.php @@ -215,19 +215,19 @@ $section->addInput(new Form_Select( $section->addInput(new Form_IpAddress( 'remote-addr', - 'GIF Remote Address', + '*GIF Remote Address', $pconfig['remote-addr'] ))->setHelp('Peer address where encapsulated gif packets will be sent.'); $section->addInput(new Form_IpAddress( 'tunnel-local-addr', - 'GIF tunnel local address', + '*GIF tunnel local address', $pconfig['tunnel-local-addr'] ))->setHelp('Local gif tunnel endpoint.'); $section->addInput(new Form_IpAddress( 'tunnel-remote-addr', - 'GIF tunnel remote address', + '*GIF tunnel remote address', $pconfig['tunnel-remote-addr'] ))->setHelp('Remote GIF address endpoint.'); diff --git a/src/usr/local/www/interfaces_gre_edit.php b/src/usr/local/www/interfaces_gre_edit.php index 5598ca0..dbc4d5c 100644 --- a/src/usr/local/www/interfaces_gre_edit.php +++ b/src/usr/local/www/interfaces_gre_edit.php @@ -209,19 +209,19 @@ $section->addInput(new Form_Select( $section->addInput(new Form_IpAddress( 'remote-addr', - 'GRE Remote Address', + '*GRE Remote Address', $pconfig['remote-addr'] ))->setHelp('Peer address where encapsulated GRE packets will be sent.'); $section->addInput(new Form_IpAddress( 'tunnel-local-addr', - 'GRE tunnel local address', + '*GRE tunnel local address', $pconfig['tunnel-local-addr'] ))->setHelp('Local GRE tunnel endpoint.'); $section->addInput(new Form_IpAddress( 'tunnel-remote-addr', - 'GRE tunnel remote address', + '*GRE tunnel remote address', $pconfig['tunnel-remote-addr'] ))->setHelp('Remote GRE address endpoint.'); diff --git a/src/usr/local/www/interfaces_groups_edit.php b/src/usr/local/www/interfaces_groups_edit.php index cc9745a..b7ae1df 100644 --- a/src/usr/local/www/interfaces_groups_edit.php +++ b/src/usr/local/www/interfaces_groups_edit.php @@ -241,7 +241,7 @@ $section = new Form_Section('Interface Group Configuration'); $section->addInput(new Form_Input( 'ifname', - 'Group Name', + '*Group Name', 'text', $pconfig['ifname'], ['placeholder' => 'Group Name', 'maxlength' => "16"] diff --git a/src/usr/local/www/interfaces_lagg_edit.php b/src/usr/local/www/interfaces_lagg_edit.php index 46fe123..0ae4d38 100644 --- a/src/usr/local/www/interfaces_lagg_edit.php +++ b/src/usr/local/www/interfaces_lagg_edit.php @@ -268,7 +268,7 @@ $memberslist = build_member_list(); $section->addInput(new Form_Select( 'members', - 'Parent Interfaces', + '*Parent Interfaces', $memberslist['selected'], $memberslist['list'], true // Allow multiples diff --git a/src/usr/local/www/interfaces_ppps_edit.php b/src/usr/local/www/interfaces_ppps_edit.php index 70e6909..12ac03f 100644 --- a/src/usr/local/www/interfaces_ppps_edit.php +++ b/src/usr/local/www/interfaces_ppps_edit.php @@ -605,7 +605,7 @@ $section = new Form_Section('PPP Configuration'); $section->addInput(new Form_Select( 'type', - 'Link Type', + '*Link Type', $pconfig['type'], $types )); @@ -614,7 +614,7 @@ $linklist = build_link_list(); $section->addInput(new Form_Select( 'interfaces', - 'Link Interface(s)', + '*Link Interface(s)', $linklist['selected'], $linklist['list'], true // Allow multiples @@ -648,16 +648,25 @@ $section->addInput(new Form_Select( [] ))->setHelp('Select to fill in service provider data.'); +$username_label = 'Username'; +$password_label = 'Password'; + +if ($pconfig['type'] != 'ppp') { + // Username and Password fields are required for types other than ppp. + $username_label = "*" . $username_label; + $password_label = "*" . $password_label; +} + $section->addInput(new Form_Input( 'username', - 'Username', + $username_label, 'text', $pconfig['username'] )); $section->addPassword(new Form_Input( 'passwordfld', - 'Password', + $password_label, 'password', $pconfig['password'] )); @@ -692,7 +701,7 @@ if ($pconfig['type'] == 'pptp' || $pconfig['type'] == 'l2tp') { if ($pconfig['type'] == 'ppp') { $section->addInput(new Form_Input( 'phone', - 'Phone number', + '*Phone number', 'text', $pconfig['phone'] ))->setHelp('Typically *99# for GSM networks and #777 for CDMA networks'); @@ -1186,6 +1195,10 @@ events.push(function() { }); } + function setDialOnDemandItems() { + setRequired('idletimeout', $('#ondemand').prop('checked')); + } + $('#pppoe-reset-type').on('change', function() { hideResetDisplay(false); }); @@ -1215,6 +1228,10 @@ events.push(function() { prefill_provider(); }); + $('#ondemand').click(function () { + setDialOnDemandItems(); + }); + // Set element visibility on initial page load show_advopts(true); @@ -1235,6 +1252,8 @@ events.push(function() { providers_list(); hideInput('provider', false); } + + setDialOnDemandItems(); }); //]]> diff --git a/src/usr/local/www/interfaces_qinq_edit.php b/src/usr/local/www/interfaces_qinq_edit.php index 259dbc6..7258b9b 100644 --- a/src/usr/local/www/interfaces_qinq_edit.php +++ b/src/usr/local/www/interfaces_qinq_edit.php @@ -281,7 +281,7 @@ $section->addInput(new Form_Select( $section->addInput(new Form_Input( 'tag', - 'First level tag', + '*First level tag', 'number', $pconfig['tag'], ['max' => '4094', 'min' => '1'] diff --git a/src/usr/local/www/interfaces_vlan_edit.php b/src/usr/local/www/interfaces_vlan_edit.php index a15b7ba..da80d57 100644 --- a/src/usr/local/www/interfaces_vlan_edit.php +++ b/src/usr/local/www/interfaces_vlan_edit.php @@ -221,7 +221,7 @@ $section->addInput(new Form_Select( $section->addInput(new Form_Input( 'tag', - 'VLAN Tag', + '*VLAN Tag', 'text', $pconfig['tag'], ['placeholder' => '1'] |