summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-05-30 12:52:54 +0545
committerPhil Davis <phil.davis@inf.org>2015-05-30 12:52:54 +0545
commit2ee8dea1357deb254f46ead392ecca6d95af4cf7 (patch)
tree6bc69471fe0777ca125497801a916ff7e1e1e25c /usr/local/www/system.php
parent5dcec9f242a94894086dd425ecf9d2f00ccdebd5 (diff)
downloadpfsense-2ee8dea1357deb254f46ead392ecca6d95af4cf7.zip
pfsense-2ee8dea1357deb254f46ead392ecca6d95af4cf7.tar.gz
Code style system a
Diffstat (limited to 'usr/local/www/system.php')
-rw-r--r--usr/local/www/system.php550
1 files changed, 292 insertions, 258 deletions
diff --git a/usr/local/www/system.php b/usr/local/www/system.php
index 5202112..12444ec 100644
--- a/usr/local/www/system.php
+++ b/usr/local/www/system.php
@@ -48,7 +48,7 @@ require_once("shaper.inc");
$pconfig['hostname'] = $config['system']['hostname'];
$pconfig['domain'] = $config['system']['domain'];
-list($pconfig['dns1'],$pconfig['dns2'],$pconfig['dns3'],$pconfig['dns4']) = $config['system']['dnsserver'];
+list($pconfig['dns1'], $pconfig['dns2'], $pconfig['dns3'], $pconfig['dns4']) = $config['system']['dnsserver'];
$arr_gateways = return_gateways_array();
@@ -66,12 +66,15 @@ $pconfig['language'] = $config['system']['language'];
$pconfig['dnslocalhost'] = isset($config['system']['dnslocalhost']);
-if (!isset($pconfig['timeupdateinterval']))
+if (!isset($pconfig['timeupdateinterval'])) {
$pconfig['timeupdateinterval'] = 300;
-if (!$pconfig['timezone'])
+}
+if (!$pconfig['timezone']) {
$pconfig['timezone'] = "Etc/UTC";
-if (!$pconfig['timeservers'])
+}
+if (!$pconfig['timeservers']) {
$pconfig['timeservers'] = "pool.ntp.org";
+}
$changedesc = gettext("System") . ": ";
$changecount = 0;
@@ -80,7 +83,7 @@ function is_timezone($elt) {
return !preg_match("/\/$/", $elt);
}
-if($pconfig['timezone'] <> $_POST['timezone']) {
+if ($pconfig['timezone'] <> $_POST['timezone']) {
filter_pflog_start(true);
}
@@ -90,8 +93,8 @@ sort($timezonelist);
$multiwan = false;
$interfaces = get_configured_interface_list();
-foreach($interfaces as $interface) {
- if(interface_has_gateway($interface)) {
+foreach ($interfaces as $interface) {
+ if (interface_has_gateway($interface)) {
$multiwan = true;
}
}
@@ -99,13 +102,13 @@ foreach($interfaces as $interface) {
if ($_POST) {
$changecount++;
-
+
unset($input_errors);
$pconfig = $_POST;
/* input validation */
$reqdfields = explode(" ", "hostname domain");
- $reqdfieldsn = array(gettext("Hostname"),gettext("Domain"));
+ $reqdfieldsn = array(gettext("Hostname"), gettext("Domain"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
@@ -124,19 +127,19 @@ if ($_POST) {
$ignore_posted_dnsgw = array();
- for ($dnscounter=1; $dnscounter<5; $dnscounter++){
+ for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
$dnsname="dns{$dnscounter}";
$dnsgwname="dns{$dnscounter}gw";
if (($_POST[$dnsname] && !is_ipaddr($_POST[$dnsname]))) {
$input_errors[] = gettext("A valid IP address must be specified for DNS server $dnscounter.");
} else {
- if(($_POST[$dnsgwname] <> "") && ($_POST[$dnsgwname] <> "none")) {
+ if (($_POST[$dnsgwname] <> "") && ($_POST[$dnsgwname] <> "none")) {
// A real gateway has been selected.
if (is_ipaddr($_POST[$dnsname])) {
- if ((is_ipaddrv4($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false )) {
+ if ((is_ipaddrv4($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false)) {
$input_errors[] = gettext("You can not specify IPv6 gateway '{$_POST[$dnsgwname]}' for IPv4 DNS server '{$_POST[$dnsname]}'");
}
- if ((is_ipaddrv6($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false )) {
+ if ((is_ipaddrv6($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false)) {
$input_errors[] = gettext("You can not specify IPv4 gateway '{$_POST[$dnsgwname]}' for IPv6 DNS server '{$_POST[$dnsname]}'");
}
} else {
@@ -152,10 +155,10 @@ if ($_POST) {
$dnsitem = "dns{$dnscounter}";
$dnsgwitem = "dns{$dnscounter}gw";
if ($_POST[$dnsgwitem]) {
- if(interface_has_gateway($_POST[$dnsgwitem])) {
- foreach($direct_networks_list as $direct_network) {
- if(ip_in_subnet($_POST[$dnsitem], $direct_network)) {
- $input_errors[] = sprintf(gettext("You can not assign a gateway to DNS '%s' server which is on a directly connected network."),$_POST[$dnsitem]);
+ if (interface_has_gateway($_POST[$dnsgwitem])) {
+ foreach ($direct_networks_list as $direct_network) {
+ if (ip_in_subnet($_POST[$dnsitem], $direct_network)) {
+ $input_errors[] = sprintf(gettext("You can not assign a gateway to DNS '%s' server which is on a directly connected network."), $_POST[$dnsitem]);
}
}
}
@@ -183,37 +186,42 @@ if ($_POST) {
update_if_changed("NTP servers", $config['system']['timeservers'], strtolower($_POST['timeservers']));
update_if_changed("NTP update interval", $config['system']['time-update-interval'], $_POST['timeupdateinterval']);
- if($_POST['language'] && $_POST['language'] != $config['system']['language']) {
+ if ($_POST['language'] && $_POST['language'] != $config['system']['language']) {
$config['system']['language'] = $_POST['language'];
set_language($config['system']['language']);
}
/* pfSense themes */
- if (! $g['disablethemeselection']) {
- update_if_changed("System Theme", $config['theme'], $_POST['theme']);
+ if (!$g['disablethemeselection']) {
+ update_if_changed("System Theme", $config['theme'], $_POST['theme']);
}
/* XXX - billm: these still need updating after figuring out how to check if they actually changed */
$olddnsservers = $config['system']['dnsserver'];
unset($config['system']['dnsserver']);
- if ($_POST['dns1'])
+ if ($_POST['dns1']) {
$config['system']['dnsserver'][] = $_POST['dns1'];
- if ($_POST['dns2'])
+ }
+ if ($_POST['dns2']) {
$config['system']['dnsserver'][] = $_POST['dns2'];
- if ($_POST['dns3'])
+ }
+ if ($_POST['dns3']) {
$config['system']['dnsserver'][] = $_POST['dns3'];
- if ($_POST['dns4'])
+ }
+ if ($_POST['dns4']) {
$config['system']['dnsserver'][] = $_POST['dns4'];
+ }
$olddnsallowoverride = $config['system']['dnsallowoverride'];
unset($config['system']['dnsallowoverride']);
$config['system']['dnsallowoverride'] = $_POST['dnsallowoverride'] ? true : false;
- if($_POST['dnslocalhost'] == "yes")
+ if ($_POST['dnslocalhost'] == "yes") {
$config['system']['dnslocalhost'] = true;
- else
+ } else {
unset($config['system']['dnslocalhost']);
+ }
/* which interface should the dns servers resolve through? */
$outdnscounter = 0;
@@ -222,10 +230,11 @@ if ($_POST) {
$dnsgwname="dns{$dnscounter}gw";
$olddnsgwname = $config['system'][$dnsgwname];
- if ($ignore_posted_dnsgw[$dnsgwname])
+ if ($ignore_posted_dnsgw[$dnsgwname]) {
$thisdnsgwname = "none";
- else
+ } else {
$thisdnsgwname = $pconfig[$dnsgwname];
+ }
// "Blank" out the settings for this index, then we set them below using the "outdnscounter" index.
$config['system'][$dnsgwname] = "none";
@@ -240,7 +249,7 @@ if ($_POST) {
$outdnsname="dns{$outdnscounter}";
$outdnsgwname="dns{$outdnscounter}gw";
$pconfig[$outdnsname] = $_POST[$dnsname];
- if($_POST[$dnsgwname]) {
+ if ($_POST[$dnsgwname]) {
$config['system'][$outdnsgwname] = $thisdnsgwname;
$pconfig[$outdnsgwname] = $thisdnsgwname;
} else {
@@ -252,41 +261,46 @@ if ($_POST) {
if (($olddnsgwname != "") && ($olddnsgwname != "none") && (($olddnsgwname != $thisdnsgwname) || ($olddnsservers[$dnscounter-1] != $_POST[$dnsname]))) {
// A previous DNS GW name was specified. It has now gone or changed, or the DNS server address has changed.
// Remove the route. Later calls will add the correct new route if needed.
- if (is_ipaddrv4($olddnsservers[$dnscounter-1]))
+ if (is_ipaddrv4($olddnsservers[$dnscounter-1])) {
mwexec("/sbin/route delete " . escapeshellarg($olddnsservers[$dnscounter-1]));
- else
- if (is_ipaddrv6($olddnsservers[$dnscounter-1]))
+ } else {
+ if (is_ipaddrv6($olddnsservers[$dnscounter-1])) {
mwexec("/sbin/route delete -inet6 " . escapeshellarg($olddnsservers[$dnscounter-1]));
+ }
+ }
}
}
- if ($changecount > 0)
+ if ($changecount > 0) {
write_config($changedesc);
+ }
$retval = 0;
$retval = system_hostname_configure();
$retval |= system_hosts_generate();
$retval |= system_resolvconf_generate();
- if (isset($config['dnsmasq']['enable']))
+ if (isset($config['dnsmasq']['enable'])) {
$retval |= services_dnsmasq_configure();
- elseif (isset($config['unbound']['enable']))
+ } elseif (isset($config['unbound']['enable'])) {
$retval |= services_unbound_configure();
+ }
$retval |= system_timezone_configure();
$retval |= system_ntp_configure();
- if ($olddnsallowoverride != $config['system']['dnsallowoverride'])
+ if ($olddnsallowoverride != $config['system']['dnsallowoverride']) {
$retval |= send_event("service reload dns");
+ }
// Reload the filter - plugins might need to be run.
$retval |= filter_configure();
-
+
$savemsg = get_std_save_message($retval);
}
unset($ignore_posted_dnsgw);
}
-$pgtitle = array(gettext("System"),gettext("General Setup"));
+$pgtitle = array(gettext("System"), gettext("General Setup"));
include("head.inc");
?>
@@ -294,237 +308,257 @@ include("head.inc");
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php
include("fbegin.inc");
- if ($input_errors)
+ if ($input_errors) {
print_input_errors($input_errors);
- if ($savemsg)
+ }
+ if ($savemsg) {
print_info_box($savemsg);
+ }
?>
<form action="system.php" method="post">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="general setup">
- <tr>
- <td id="mainarea">
- <div class="tabcont">
- <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
<tr>
- <td colspan="2" valign="top" class="listtopic"><?=gettext("System"); ?></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Hostname"); ?></td>
- <td width="78%" class="vtable"> <input name="hostname" type="text" class="formfld unknown" id="hostname" size="40" value="<?=htmlspecialchars($pconfig['hostname']);?>" />
- <br />
- <span class="vexpl">
- <?=gettext("Name of the firewall host, without domain part"); ?>
- <br />
- <?=gettext("e.g."); ?> <em>firewall</em>
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Domain"); ?></td>
- <td width="78%" class="vtable"> <input name="domain" type="text" class="formfld unknown" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>" />
- <br />
- <span class="vexpl">
- <?=gettext("Do not use 'local' as a domain name. It will cause local hosts running mDNS (avahi, bonjour, etc.) to be unable to resolve local hosts not running mDNS."); ?>
- <br />
- <?=gettext("e.g."); ?> <em><?=gettext("mycorp.com, home, office, private, etc."); ?></em>
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("DNS servers"); ?></td>
- <td width="78%" class="vtable">
- <br />
- <table summary="dns servers and gateways">
- <tr>
- <td><b><?=gettext("DNS Server"); ?></b></td>
- <?php if ($multiwan): ?>
- <td><b><?=gettext("Use gateway"); ?></b></td>
- <?php endif; ?>
- </tr>
- <?php
- for ($dnscounter=1; $dnscounter<5; $dnscounter++):
- $fldname="dns{$dnscounter}gw";
- ?>
- <tr>
- <td>
- <input name="dns<?php echo $dnscounter;?>" type="text" class="formfld unknown" id="dns<?php echo $dnscounter;?>" size="28" value="<?php echo $pconfig['dns'.$dnscounter];?>" />
- </td>
- <td>
-<?php if ($multiwan): ?>
- <select name='<?=$fldname;?>'>
- <?php
- $gwname = "none";
- $dnsgw = "dns{$dnscounter}gw";
- if($pconfig[$dnsgw] == $gwname) {
- $selected = "selected=\"selected\"";
- } else {
- $selected = "";
- }
- echo "<option value='$gwname' $selected>$gwname</option>\n";
- foreach($arr_gateways as $gwname => $gwitem) {
- //echo $pconfig[$dnsgw];
- if((is_ipaddrv4(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv6($gwitem['gateway'])))) {
- continue;
- }
- if((is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv4($gwitem['gateway'])))) {
- continue;
- }
- if($pconfig[$dnsgw] == $gwname) {
- $selected = "selected=\"selected\"";
- } else {
- $selected = "";
- }
- echo "<option value='$gwname' $selected>$gwname - {$gwitem['friendlyiface']} - {$gwitem['gateway']}</option>\n";
- }
- ?>
- </select>
-<?php endif; ?>
- </td>
- </tr>
- <?php endfor; ?>
- </table>
- <br />
- <span class="vexpl">
- <?=gettext("Enter IP addresses to be used by the system for DNS resolution. " .
- "These are also used for the DHCP service, DNS forwarder and for PPTP VPN clients."); ?>
- <br />
- <?php if($multiwan): ?>
- <br />
- <?=gettext("In addition, optionally select the gateway for each DNS server. " .
- "When using multiple WAN connections there should be at least one unique DNS server per gateway."); ?>
- <br />
- <?php endif; ?>
- <br />
- <input name="dnsallowoverride" type="checkbox" id="dnsallowoverride" value="yes" <?php if ($pconfig['dnsallowoverride']) echo "checked=\"checked\""; ?> />
- <strong>
- <?=gettext("Allow DNS server list to be overridden by DHCP/PPP on WAN"); ?>
- </strong>
- <br />
- <?php printf(gettext("If this option is set, %s will " .
- "use DNS servers assigned by a DHCP/PPP server on WAN " .
- "for its own purposes (including the DNS forwarder). " .
- "However, they will not be assigned to DHCP and PPTP " .
- "VPN clients."), $g['product_name']); ?>
- <br />
- <br />
- <input name="dnslocalhost" type="checkbox" id="dnslocalhost" value="yes" <?php if ($pconfig['dnslocalhost']) echo "checked=\"checked\""; ?> />
- <strong>
- <?=gettext("Do not use the DNS Forwarder as a DNS server for the firewall"); ?>
- </strong>
- <br />
- <?=gettext("By default localhost (127.0.0.1) will be used as the first DNS server where the DNS Forwarder or DNS Resolver is enabled and set to listen on Localhost, so system can use the local DNS service to perform lookups. ".
- "Checking this box omits localhost from the list of DNS servers."); ?>
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Time zone"); ?></td>
- <td width="78%" class="vtable">
- <select name="timezone" id="timezone">
- <?php foreach ($timezonelist as $value): ?>
- <?php if(strstr($value, "GMT")) continue; ?>
- <option value="<?=htmlspecialchars($value);?>" <?php if ($value == $pconfig['timezone']) echo "selected=\"selected\""; ?>>
- <?=htmlspecialchars($value);?>
- </option>
- <?php endforeach; ?>
- </select>
- <br />
- <span class="vexpl">
- <?=gettext("Select the location closest to you"); ?>
- </span>
- </td>
- </tr>
+ <td id="mainarea">
+ <div class="tabcont">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("System"); ?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Hostname"); ?></td>
+ <td width="78%" class="vtable"> <input name="hostname" type="text" class="formfld unknown" id="hostname" size="40" value="<?=htmlspecialchars($pconfig['hostname']);?>" />
+ <br />
+ <span class="vexpl">
+ <?=gettext("Name of the firewall host, without domain part"); ?>
+ <br />
+ <?=gettext("e.g."); ?> <em>firewall</em>
+ </span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Domain"); ?></td>
+ <td width="78%" class="vtable"> <input name="domain" type="text" class="formfld unknown" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>" />
+ <br />
+ <span class="vexpl">
+ <?=gettext("Do not use 'local' as a domain name. It will cause local hosts running mDNS (avahi, bonjour, etc.) to be unable to resolve local hosts not running mDNS."); ?>
+ <br />
+ <?=gettext("e.g."); ?> <em><?=gettext("mycorp.com, home, office, private, etc."); ?></em>
+ </span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("DNS servers"); ?></td>
+ <td width="78%" class="vtable">
+ <br />
+ <table summary="dns servers and gateways">
+ <tr>
+ <td><b><?=gettext("DNS Server"); ?></b></td>
+ <?php if ($multiwan): ?>
+ <td><b><?=gettext("Use gateway"); ?></b></td>
+ <?php endif; ?>
+ </tr>
+<?php
+ for ($dnscounter = 1; $dnscounter < 5; $dnscounter++):
+ $fldname="dns{$dnscounter}gw";
+?>
+ <tr>
+ <td>
+ <input name="dns<?php echo $dnscounter;?>" type="text" class="formfld unknown" id="dns<?php echo $dnscounter;?>" size="28" value="<?php echo $pconfig['dns'.$dnscounter];?>" />
+ </td>
+ <td>
+<?php
+ if ($multiwan):
+?>
+ <select name='<?=$fldname;?>'>
+<?php
+ $gwname = "none";
+ $dnsgw = "dns{$dnscounter}gw";
+ if ($pconfig[$dnsgw] == $gwname) {
+ $selected = "selected=\"selected\"";
+ } else {
+ $selected = "";
+ }
+ echo "<option value='$gwname' $selected>$gwname</option>\n";
+ foreach ($arr_gateways as $gwname => $gwitem) {
+ //echo $pconfig[$dnsgw];
+ if ((is_ipaddrv4(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv6($gwitem['gateway'])))) {
+ continue;
+ }
+ if ((is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv4($gwitem['gateway'])))) {
+ continue;
+ }
+ if ($pconfig[$dnsgw] == $gwname) {
+ $selected = "selected=\"selected\"";
+ } else {
+ $selected = "";
+ }
+ echo "<option value='$gwname' $selected>$gwname - {$gwitem['friendlyiface']} - {$gwitem['gateway']}</option>\n";
+ }
+?>
+ </select>
+<?php
+ endif;
+?>
+ </td>
+ </tr>
+<?php
+ endfor;
+?>
+ </table>
+ <br />
+ <span class="vexpl">
+ <?=gettext("Enter IP addresses to be used by the system for DNS resolution. " .
+ "These are also used for the DHCP service, DNS forwarder and for PPTP VPN clients."); ?>
+ <br />
+ <?php if ($multiwan): ?>
+ <br />
+ <?=gettext("In addition, optionally select the gateway for each DNS server. " .
+ "When using multiple WAN connections there should be at least one unique DNS server per gateway."); ?>
+ <br />
+ <?php endif; ?>
+ <br />
+ <input name="dnsallowoverride" type="checkbox" id="dnsallowoverride" value="yes" <?php if ($pconfig['dnsallowoverride']) echo "checked=\"checked\""; ?> />
+ <strong>
+ <?=gettext("Allow DNS server list to be overridden by DHCP/PPP on WAN"); ?>
+ </strong>
+ <br />
+ <?php printf(gettext("If this option is set, %s will " .
+ "use DNS servers assigned by a DHCP/PPP server on WAN " .
+ "for its own purposes (including the DNS forwarder). " .
+ "However, they will not be assigned to DHCP and PPTP " .
+ "VPN clients."), $g['product_name']); ?>
+ <br />
+ <br />
+ <input name="dnslocalhost" type="checkbox" id="dnslocalhost" value="yes" <?php if ($pconfig['dnslocalhost']) echo "checked=\"checked\""; ?> />
+ <strong>
+ <?=gettext("Do not use the DNS Forwarder as a DNS server for the firewall"); ?>
+ </strong>
+ <br />
+ <?=gettext("By default localhost (127.0.0.1) will be used as the first DNS server where the DNS Forwarder or DNS Resolver is enabled and set to listen on Localhost, so system can use the local DNS service to perform lookups. ".
+ "Checking this box omits localhost from the list of DNS servers."); ?>
+ </span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Time zone"); ?></td>
+ <td width="78%" class="vtable">
+ <select name="timezone" id="timezone">
+ <?php foreach ($timezonelist as $value): ?>
+ <?php if (strstr($value, "GMT")) continue; ?>
+ <option value="<?=htmlspecialchars($value);?>" <?php if ($value == $pconfig['timezone']) echo "selected=\"selected\""; ?>>
+ <?=htmlspecialchars($value);?>
+ </option>
+ <?php endforeach; ?>
+ </select>
+ <br />
+ <span class="vexpl">
+ <?=gettext("Select the location closest to you"); ?>
+ </span>
+ </td>
+ </tr>
<!--
- <tr>
- <td width="22%" valign="top" class="vncell">Time update interval</td>
- <td width="78%" class="vtable">
- <input name="timeupdateinterval" type="text" class="formfld unknown" id="timeupdateinterval" size="4" value="<?=htmlspecialchars($pconfig['timeupdateinterval']);?>" />
- <br />
- <span class="vexpl">
- Minutes between network time sync. 300 recommended,
- or 0 to disable
- </span>
- </td>
- </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Time update interval</td>
+ <td width="78%" class="vtable">
+ <input name="timeupdateinterval" type="text" class="formfld unknown" id="timeupdateinterval" size="4" value="<?=htmlspecialchars($pconfig['timeupdateinterval']);?>" />
+ <br />
+ <span class="vexpl">
+ Minutes between network time sync. 300 recommended,
+ or 0 to disable
+ </span>
+ </td>
+ </tr>
-->
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("NTP time server"); ?></td>
- <td width="78%" class="vtable">
- <input name="timeservers" type="text" class="formfld unknown" id="timeservers" size="40" value="<?=htmlspecialchars($pconfig['timeservers']);?>" />
- <br />
- <span class="vexpl">
- <?=gettext("Use a space to separate multiple hosts (only one " .
- "required). Remember to set up at least one DNS server " .
- "if you enter a host name here!"); ?>
- </span>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?php echo gettext("Language");?></td>
- <td width="78%" class="vtable">
- <select name="language">
- <?php
- foreach(get_locale_list() as $lcode => $ldesc) {
- $selected = ' selected="selected"';
- if($lcode != $pconfig['language'])
- $selected = '';
- echo "<option value=\"{$lcode}\"{$selected}>{$ldesc}</option>";
- }
- ?>
- </select>
- <strong>
- <?=gettext("Choose a language for the webConfigurator"); ?>
- </strong>
- </td>
- </tr>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <?php if (! $g['disablethemeselection']): ?>
- <tr>
- <td colspan="2" valign="top" class="listtopic"><?=gettext("Theme"); ?></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <select name="theme">
- <?php
- $files = return_dir_as_array("/usr/local/www/themes/");
- foreach($files as $f):
- if ((substr($f, 0, 1) == "_") && !isset($config['system']['developer']))
- continue;
- if ($f == "CVS")
- continue;
- $curtheme = "pfsense";
- if ($config['theme'])
- $curtheme = $config['theme'];
- $selected = "";
- if($f == $curtheme)
- $selected = " selected=\"selected\"";
- ?>
- <option <?=$selected;?>><?=$f;?></option>
- <?php endforeach; ?>
- </select>
- <strong>
- <?=gettext("This will change the look and feel of"); ?>
- <?=$g['product_name'];?>.
- </strong>
- </td>
- </tr>
- <?php endif; ?>
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("NTP time server"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="timeservers" type="text" class="formfld unknown" id="timeservers" size="40" value="<?=htmlspecialchars($pconfig['timeservers']);?>" />
+ <br />
+ <span class="vexpl">
+ <?=gettext("Use a space to separate multiple hosts (only one " .
+ "required). Remember to set up at least one DNS server " .
+ "if you enter a host name here!"); ?>
+ </span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?php echo gettext("Language");?></td>
+ <td width="78%" class="vtable">
+ <select name="language">
+ <?php
+ foreach (get_locale_list() as $lcode => $ldesc) {
+ $selected = ' selected="selected"';
+ if ($lcode != $pconfig['language']) {
+ $selected = '';
+ }
+ echo "<option value=\"{$lcode}\"{$selected}>{$ldesc}</option>";
+ }
+ ?>
+ </select>
+ <strong>
+ <?=gettext("Choose a language for the webConfigurator"); ?>
+ </strong>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" class="list" height="12">&nbsp;</td>
+ </tr>
+<?php
+ if (!$g['disablethemeselection']):
+?>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("Theme"); ?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">&nbsp;</td>
+ <td width="78%" class="vtable">
+ <select name="theme">
+<?php
+ $files = return_dir_as_array("/usr/local/www/themes/");
+ foreach ($files as $f):
+ if ((substr($f, 0, 1) == "_") && !isset($config['system']['developer'])) {
+ continue;
+ }
+ if ($f == "CVS") {
+ continue;
+ }
+ $curtheme = "pfsense";
+ if ($config['theme']) {
+ $curtheme = $config['theme'];
+ }
+ $selected = "";
+ if ($f == $curtheme) {
+ $selected = " selected=\"selected\"";
+ }
+?>
+ <option <?=$selected;?>><?=$f;?></option>
+<?php
+ endforeach;
+?>
+ </select>
+ <strong>
+ <?=gettext("This will change the look and feel of"); ?>
+ <?=$g['product_name'];?>.
+ </strong>
+ </td>
+ </tr>
+<?php
+ endif;
+?>
+ <tr>
+ <td colspan="2" class="list" height="12">&nbsp;</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
+ </td>
+ </tr>
+ </table>
+ </div>
</td>
</tr>
</table>
- </div>
- </td></tr>
- </table>
</form>
<?php include("fend.inc"); ?>
</body>
OpenPOWER on IntegriCloud