1 |
04ad7c7c
|
Scott Ullrich
|
<?php
|
2 |
62d01225
|
Bill Marquette
|
/* $Id$ */
|
3 |
5b237745
|
Scott Ullrich
|
/*
|
4 |
|
|
system.php
|
5 |
|
|
part of m0n0wall (http://m0n0.ch/wall)
|
6 |
04ad7c7c
|
Scott Ullrich
|
|
7 |
5b237745
|
Scott Ullrich
|
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
8 |
|
|
All rights reserved.
|
9 |
04ad7c7c
|
Scott Ullrich
|
|
10 |
5b237745
|
Scott Ullrich
|
Redistribution and use in source and binary forms, with or without
|
11 |
|
|
modification, are permitted provided that the following conditions are met:
|
12 |
04ad7c7c
|
Scott Ullrich
|
|
13 |
5b237745
|
Scott Ullrich
|
1. Redistributions of source code must retain the above copyright notice,
|
14 |
|
|
this list of conditions and the following disclaimer.
|
15 |
04ad7c7c
|
Scott Ullrich
|
|
16 |
5b237745
|
Scott Ullrich
|
2. Redistributions in binary form must reproduce the above copyright
|
17 |
|
|
notice, this list of conditions and the following disclaimer in the
|
18 |
|
|
documentation and/or other materials provided with the distribution.
|
19 |
04ad7c7c
|
Scott Ullrich
|
|
20 |
5b237745
|
Scott Ullrich
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
21 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
22 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
23 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
24 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
30 |
|
|
*/
|
31 |
1d333258
|
Scott Ullrich
|
/*
|
32 |
|
|
pfSense_BUILDER_BINARIES: /bin/kill /usr/bin/tar
|
33 |
|
|
pfSense_MODULE: system
|
34 |
|
|
*/
|
35 |
5b237745
|
Scott Ullrich
|
|
36 |
6b07c15a
|
Matthew Grooms
|
##|+PRIV
|
37 |
|
|
##|*IDENT=page-system-generalsetup
|
38 |
|
|
##|*NAME=System: General Setup page
|
39 |
|
|
##|*DESCR=Allow access to the 'System: General Setup' page.
|
40 |
|
|
##|*MATCH=system.php*
|
41 |
|
|
##|-PRIV
|
42 |
|
|
|
43 |
5b237745
|
Scott Ullrich
|
require("guiconfig.inc");
|
44 |
7a927e67
|
Scott Ullrich
|
require_once("functions.inc");
|
45 |
|
|
require_once("filter.inc");
|
46 |
|
|
require_once("shaper.inc");
|
47 |
5b237745
|
Scott Ullrich
|
|
48 |
|
|
$pconfig['hostname'] = $config['system']['hostname'];
|
49 |
|
|
$pconfig['domain'] = $config['system']['domain'];
|
50 |
93e0800d
|
Scott Ullrich
|
list($pconfig['dns1'],$pconfig['dns2'],$pconfig['dns3'],$pconfig['dns4']) = $config['system']['dnsserver'];
|
51 |
0d8a219e
|
Scott Ullrich
|
|
52 |
e180a6e3
|
Scott Ullrich
|
$pconfig['dns1gwint'] = $config['system']['dns1gwint'];
|
53 |
|
|
$pconfig['dns2gwint'] = $config['system']['dns2gwint'];
|
54 |
93e0800d
|
Scott Ullrich
|
$pconfig['dns3gwint'] = $config['system']['dns3gwint'];
|
55 |
|
|
$pconfig['dns4gwint'] = $config['system']['dns4gwint'];
|
56 |
e180a6e3
|
Scott Ullrich
|
|
57 |
5b237745
|
Scott Ullrich
|
$pconfig['dnsallowoverride'] = isset($config['system']['dnsallowoverride']);
|
58 |
|
|
$pconfig['timezone'] = $config['system']['timezone'];
|
59 |
|
|
$pconfig['timeupdateinterval'] = $config['system']['time-update-interval'];
|
60 |
|
|
$pconfig['timeservers'] = $config['system']['timeservers'];
|
61 |
f0f7a3eb
|
Scott Ullrich
|
$pconfig['theme'] = $config['system']['theme'];
|
62 |
5b237745
|
Scott Ullrich
|
|
63 |
|
|
if (!isset($pconfig['timeupdateinterval']))
|
64 |
|
|
$pconfig['timeupdateinterval'] = 300;
|
65 |
|
|
if (!$pconfig['timezone'])
|
66 |
|
|
$pconfig['timezone'] = "Etc/UTC";
|
67 |
|
|
if (!$pconfig['timeservers'])
|
68 |
|
|
$pconfig['timeservers'] = "pool.ntp.org";
|
69 |
04ad7c7c
|
Scott Ullrich
|
|
70 |
79eaddf4
|
Renato Botelho
|
$changedesc = gettext("System") . ": ";
|
71 |
62d01225
|
Bill Marquette
|
$changecount = 0;
|
72 |
417c6042
|
Bill Marquette
|
|
73 |
5b237745
|
Scott Ullrich
|
function is_timezone($elt) {
|
74 |
|
|
return !preg_match("/\/$/", $elt);
|
75 |
|
|
}
|
76 |
|
|
|
77 |
aa1ab1da
|
Scott Ullrich
|
if($pconfig['timezone'] <> $_POST['timezone']) {
|
78 |
|
|
/* restart firewall log dumper helper */
|
79 |
|
|
require_once("functions.inc");
|
80 |
87c20eb5
|
Bill Marquette
|
$pid = `ps awwwux | grep -v "grep" | grep "tcpdump -v -l -n -e -ttt -i pflog0" | awk '{ print $2 }'`;
|
81 |
aa1ab1da
|
Scott Ullrich
|
if($pid) {
|
82 |
1d333258
|
Scott Ullrich
|
mwexec("/bin/kill $pid");
|
83 |
aa1ab1da
|
Scott Ullrich
|
usleep(1000);
|
84 |
|
|
}
|
85 |
|
|
filter_pflog_start();
|
86 |
|
|
}
|
87 |
|
|
|
88 |
5b237745
|
Scott Ullrich
|
exec('/usr/bin/tar -tzf /usr/share/zoneinfo.tgz', $timezonelist);
|
89 |
|
|
$timezonelist = array_filter($timezonelist, 'is_timezone');
|
90 |
|
|
sort($timezonelist);
|
91 |
|
|
|
92 |
77446beb
|
Matthew Grooms
|
$multiwan = false;
|
93 |
7922db8a
|
Seth Mos
|
$interfaces = get_configured_interface_list();
|
94 |
|
|
foreach($interfaces as $interface) {
|
95 |
|
|
if(interface_has_gateway($interface)) {
|
96 |
77446beb
|
Matthew Grooms
|
$multiwan = true;
|
97 |
7922db8a
|
Seth Mos
|
}
|
98 |
|
|
}
|
99 |
77446beb
|
Matthew Grooms
|
|
100 |
5b237745
|
Scott Ullrich
|
if ($_POST) {
|
101 |
|
|
|
102 |
c668c964
|
Scott Ullrich
|
$changecount++;
|
103 |
e180a6e3
|
Scott Ullrich
|
|
104 |
5b237745
|
Scott Ullrich
|
unset($input_errors);
|
105 |
|
|
$pconfig = $_POST;
|
106 |
|
|
|
107 |
|
|
/* input validation */
|
108 |
ec5a5d65
|
Scott Dale
|
$reqdfields = split(" ", "hostname domain");
|
109 |
38fb1109
|
Vinicius Coque
|
$reqdfieldsn = array(gettext("Hostname"),gettext("Domain"));
|
110 |
04ad7c7c
|
Scott Ullrich
|
|
111 |
5b237745
|
Scott Ullrich
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
|
112 |
04ad7c7c
|
Scott Ullrich
|
|
113 |
5b237745
|
Scott Ullrich
|
if ($_POST['hostname'] && !is_hostname($_POST['hostname'])) {
|
114 |
7465d12c
|
Carlos Eduardo Ramos
|
$input_errors[] = gettext("The hostname may only contain the characters a-z, 0-9 and '-'.");
|
115 |
5b237745
|
Scott Ullrich
|
}
|
116 |
|
|
if ($_POST['domain'] && !is_domain($_POST['domain'])) {
|
117 |
7465d12c
|
Carlos Eduardo Ramos
|
$input_errors[] = gettext("The domain may only contain the characters a-z, 0-9, '-' and '.'.");
|
118 |
5b237745
|
Scott Ullrich
|
}
|
119 |
|
|
if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2']))) {
|
120 |
7465d12c
|
Carlos Eduardo Ramos
|
$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS server.");
|
121 |
5b237745
|
Scott Ullrich
|
}
|
122 |
93e0800d
|
Scott Ullrich
|
if (($_POST['dns3'] && !is_ipaddr($_POST['dns3'])) || ($_POST['dns4'] && !is_ipaddr($_POST['dns4']))) {
|
123 |
7465d12c
|
Carlos Eduardo Ramos
|
$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS server.");
|
124 |
93e0800d
|
Scott Ullrich
|
}
|
125 |
04ad7c7c
|
Scott Ullrich
|
if ($_POST['webguiport'] && (!is_numericint($_POST['webguiport']) ||
|
126 |
5b237745
|
Scott Ullrich
|
($_POST['webguiport'] < 1) || ($_POST['webguiport'] > 65535))) {
|
127 |
7465d12c
|
Carlos Eduardo Ramos
|
$input_errors[] = gettext("A valid TCP/IP port must be specified for the webConfigurator port.");
|
128 |
5b237745
|
Scott Ullrich
|
}
|
129 |
04ad7c7c
|
Scott Ullrich
|
|
130 |
985fc0fb
|
Ermal Lu?i
|
$direct_networks_list = explode(" ", filter_get_direct_networks_list());
|
131 |
c98d28e1
|
Seth Mos
|
for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
|
132 |
|
|
$dnsitem = "dns{$dnscounter}";
|
133 |
|
|
$dnsgwitem = "dns{$dnscounter}gwint";
|
134 |
|
|
if ($_POST[$dnsgwitem]) {
|
135 |
|
|
if(interface_has_gateway($_POST[$dnsgwitem])) {
|
136 |
|
|
foreach($direct_networks_list as $direct_network) {
|
137 |
|
|
if(ip_in_subnet($_POST[$dnsitem], $direct_network)) {
|
138 |
7465d12c
|
Carlos Eduardo Ramos
|
$input_errors[] = gettext("You can not assign a gateway to DNS '{$_POST[$dnsitem]}' server which is on a directly connected network.");
|
139 |
c98d28e1
|
Seth Mos
|
}
|
140 |
|
|
}
|
141 |
|
|
}
|
142 |
|
|
}
|
143 |
|
|
}
|
144 |
|
|
|
145 |
5b237745
|
Scott Ullrich
|
$t = (int)$_POST['timeupdateinterval'];
|
146 |
|
|
if (($t < 0) || (($t > 0) && ($t < 6)) || ($t > 1440)) {
|
147 |
7465d12c
|
Carlos Eduardo Ramos
|
$input_errors[] = gettext("The time update interval must be either 0 (disabled) or between 6 and 1440.");
|
148 |
5b237745
|
Scott Ullrich
|
}
|
149 |
|
|
foreach (explode(' ', $_POST['timeservers']) as $ts) {
|
150 |
|
|
if (!is_domain($ts)) {
|
151 |
7465d12c
|
Carlos Eduardo Ramos
|
$input_errors[] = gettext("A NTP Time Server name may only contain the characters a-z, 0-9, '-' and '.'.");
|
152 |
5b237745
|
Scott Ullrich
|
}
|
153 |
|
|
}
|
154 |
|
|
|
155 |
|
|
if (!$input_errors) {
|
156 |
9eab73da
|
Bill Marquette
|
update_if_changed("hostname", $config['system']['hostname'], strtolower($_POST['hostname']));
|
157 |
|
|
update_if_changed("domain", $config['system']['domain'], strtolower($_POST['domain']));
|
158 |
79f8694f
|
Bill Marquette
|
|
159 |
9eab73da
|
Bill Marquette
|
update_if_changed("timezone", $config['system']['timezone'], $_POST['timezone']);
|
160 |
|
|
update_if_changed("NTP servers", $config['system']['timeservers'], strtolower($_POST['timeservers']));
|
161 |
|
|
update_if_changed("NTP update interval", $config['system']['time-update-interval'], $_POST['timeupdateinterval']);
|
162 |
04ad7c7c
|
Scott Ullrich
|
|
163 |
f0f7a3eb
|
Scott Ullrich
|
/* pfSense themes */
|
164 |
7321c93c
|
Chris Buechler
|
if (! $g['disablethemeselection']) {
|
165 |
|
|
update_if_changed("System Theme", $config['theme'], $_POST['theme']);
|
166 |
|
|
}
|
167 |
f0f7a3eb
|
Scott Ullrich
|
|
168 |
4fbf63aa
|
Bill Marquette
|
/* XXX - billm: these still need updating after figuring out how to check if they actually changed */
|
169 |
5b237745
|
Scott Ullrich
|
unset($config['system']['dnsserver']);
|
170 |
|
|
if ($_POST['dns1'])
|
171 |
|
|
$config['system']['dnsserver'][] = $_POST['dns1'];
|
172 |
|
|
if ($_POST['dns2'])
|
173 |
|
|
$config['system']['dnsserver'][] = $_POST['dns2'];
|
174 |
93e0800d
|
Scott Ullrich
|
if ($_POST['dns3'])
|
175 |
|
|
$config['system']['dnsserver'][] = $_POST['dns3'];
|
176 |
|
|
if ($_POST['dns4'])
|
177 |
|
|
$config['system']['dnsserver'][] = $_POST['dns4'];
|
178 |
04ad7c7c
|
Scott Ullrich
|
|
179 |
07bd3f83
|
Scott Ullrich
|
$olddnsallowoverride = $config['system']['dnsallowoverride'];
|
180 |
20b90e0a
|
Scott Ullrich
|
|
181 |
0d8a219e
|
Scott Ullrich
|
unset($config['system']['dnsallowoverride']);
|
182 |
5b237745
|
Scott Ullrich
|
$config['system']['dnsallowoverride'] = $_POST['dnsallowoverride'] ? true : false;
|
183 |
e180a6e3
|
Scott Ullrich
|
|
184 |
|
|
/* which interface should the dns servers resolve through? */
|
185 |
|
|
if($_POST['dns1gwint'])
|
186 |
|
|
$config['system']['dns1gwint'] = $pconfig['dns1gwint'];
|
187 |
|
|
else
|
188 |
|
|
unset($config['system']['dns1gwint']);
|
189 |
3537ac27
|
Seth Mos
|
|
190 |
e180a6e3
|
Scott Ullrich
|
if($_POST['dns2gwint'])
|
191 |
|
|
$config['system']['dns2gwint'] = $pconfig['dns2gwint'];
|
192 |
|
|
else
|
193 |
|
|
unset($config['system']['dns2gwint']);
|
194 |
3537ac27
|
Seth Mos
|
|
195 |
93e0800d
|
Scott Ullrich
|
if($_POST['dns3gwint'])
|
196 |
5aaf13c4
|
Seth Mos
|
$config['system']['dns3gwint'] = $pconfig['dns3gwint'];
|
197 |
93e0800d
|
Scott Ullrich
|
else
|
198 |
|
|
unset($config['system']['dns3gwint']);
|
199 |
3537ac27
|
Seth Mos
|
|
200 |
93e0800d
|
Scott Ullrich
|
if($_POST['dns4gwint'])
|
201 |
|
|
$config['system']['dns4gwint'] = $pconfig['dns4gwint'];
|
202 |
|
|
else
|
203 |
|
|
unset($config['system']['dns4gwint']);
|
204 |
04ad7c7c
|
Scott Ullrich
|
|
205 |
62d01225
|
Bill Marquette
|
if ($changecount > 0)
|
206 |
|
|
write_config($changedesc);
|
207 |
04ad7c7c
|
Scott Ullrich
|
|
208 |
5b237745
|
Scott Ullrich
|
$retval = 0;
|
209 |
3cfdba5f
|
Scott Ullrich
|
$retval = system_hostname_configure();
|
210 |
|
|
$retval |= system_hosts_generate();
|
211 |
|
|
$retval |= system_resolvconf_generate();
|
212 |
|
|
$retval |= services_dnsmasq_configure();
|
213 |
|
|
$retval |= system_timezone_configure();
|
214 |
|
|
$retval |= system_ntp_configure();
|
215 |
|
|
|
216 |
|
|
if ($olddnsallowoverride != $config['system']['dnsallowoverride'])
|
217 |
b8292903
|
Ermal
|
$retval |= send_event("service reload dns");
|
218 |
3cfdba5f
|
Scott Ullrich
|
|
219 |
e7d967d8
|
Scott Ullrich
|
// Reload the filter - plugins might need to be run.
|
220 |
0027de0a
|
Ermal Lu?i
|
$retval |= filter_configure();
|
221 |
e7d967d8
|
Scott Ullrich
|
|
222 |
5b237745
|
Scott Ullrich
|
$savemsg = get_std_save_message($retval);
|
223 |
|
|
}
|
224 |
|
|
}
|
225 |
4df96eff
|
Scott Ullrich
|
|
226 |
7465d12c
|
Carlos Eduardo Ramos
|
$pgtitle = array(gettext("System"),gettext("General Setup"));
|
227 |
4df96eff
|
Scott Ullrich
|
include("head.inc");
|
228 |
|
|
|
229 |
5b237745
|
Scott Ullrich
|
?>
|
230 |
4df96eff
|
Scott Ullrich
|
|
231 |
5b237745
|
Scott Ullrich
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
232 |
f0f7a3eb
|
Scott Ullrich
|
<?php
|
233 |
77446beb
|
Matthew Grooms
|
include("fbegin.inc");
|
234 |
|
|
if ($input_errors)
|
235 |
|
|
print_input_errors($input_errors);
|
236 |
|
|
if ($savemsg)
|
237 |
|
|
print_info_box($savemsg);
|
238 |
f0f7a3eb
|
Scott Ullrich
|
?>
|
239 |
77446beb
|
Matthew Grooms
|
<form action="system.php" method="post">
|
240 |
|
|
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
241 |
27b07eda
|
Ermal Lu?i
|
<tr>
|
242 |
|
|
<td id="mainarea">
|
243 |
|
|
<div class="tabcont">
|
244 |
|
|
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
245 |
77446beb
|
Matthew Grooms
|
<tr>
|
246 |
7465d12c
|
Carlos Eduardo Ramos
|
<td colspan="2" valign="top" class="listtopic"><?=gettext("System"); ?></td>
|
247 |
77446beb
|
Matthew Grooms
|
</tr>
|
248 |
|
|
<tr>
|
249 |
7465d12c
|
Carlos Eduardo Ramos
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Hostname"); ?></td>
|
250 |
77446beb
|
Matthew Grooms
|
<td width="78%" class="vtable"> <input name="hostname" type="text" class="formfld unknown" id="hostname" size="40" value="<?=htmlspecialchars($pconfig['hostname']);?>">
|
251 |
|
|
<br/>
|
252 |
|
|
<span class="vexpl">
|
253 |
22a11a58
|
Larry Gilbert
|
<?=gettext("Name of the firewall host, without domain part"); ?>
|
254 |
10e41b74
|
gnhb
|
<br/>
|
255 |
7465d12c
|
Carlos Eduardo Ramos
|
<?=gettext("e.g."); ?> <em>firewall</em>
|
256 |
77446beb
|
Matthew Grooms
|
</span>
|
257 |
|
|
</td>
|
258 |
|
|
</tr>
|
259 |
|
|
<tr>
|
260 |
7465d12c
|
Carlos Eduardo Ramos
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Domain"); ?></td>
|
261 |
77446beb
|
Matthew Grooms
|
<td width="78%" class="vtable"> <input name="domain" type="text" class="formfld unknown" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>">
|
262 |
|
|
<br/>
|
263 |
|
|
<span class="vexpl">
|
264 |
7465d12c
|
Carlos Eduardo Ramos
|
<?=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."); ?>
|
265 |
10e41b74
|
gnhb
|
<br/>
|
266 |
7465d12c
|
Carlos Eduardo Ramos
|
<?=gettext("e.g."); ?> <em><?=gettext("mycorp.com, home, office, private, etc."); ?></em>
|
267 |
77446beb
|
Matthew Grooms
|
</span>
|
268 |
|
|
</td>
|
269 |
|
|
</tr>
|
270 |
|
|
<tr>
|
271 |
7465d12c
|
Carlos Eduardo Ramos
|
<td width="22%" valign="top" class="vncell"><?=gettext("DNS servers"); ?></td>
|
272 |
77446beb
|
Matthew Grooms
|
<td width="78%" class="vtable">
|
273 |
|
|
<p>
|
274 |
|
|
<table>
|
275 |
|
|
<tr>
|
276 |
7465d12c
|
Carlos Eduardo Ramos
|
<td><b><?=gettext("DNS Server"); ?></b></td>
|
277 |
77446beb
|
Matthew Grooms
|
<?php if ($multiwan): ?>
|
278 |
7465d12c
|
Carlos Eduardo Ramos
|
<td><b><?=gettext("Use gateway"); ?></b></td>
|
279 |
77446beb
|
Matthew Grooms
|
<?php endif; ?>
|
280 |
|
|
</tr>
|
281 |
|
|
<?php
|
282 |
|
|
for ($dnscounter=1; $dnscounter<5; $dnscounter++):
|
283 |
|
|
$fldname="dns{$dnscounter}gwint";
|
284 |
|
|
?>
|
285 |
|
|
<tr>
|
286 |
|
|
<td>
|
287 |
c271c485
|
Seth Mos
|
<input name="dns<?php echo $dnscounter;?>" type="text" class="formfld unknown" id="dns<?php echo $dnscounter;?>" size="28" value="<?php echo $pconfig['dns'.$dnscounter];?>">
|
288 |
77446beb
|
Matthew Grooms
|
</td>
|
289 |
|
|
<td>
|
290 |
a077b479
|
Ermal Luçi
|
<?php if ($multiwan): ?>
|
291 |
3537ac27
|
Seth Mos
|
<select name='<?=$fldname;?>'>
|
292 |
77446beb
|
Matthew Grooms
|
<?php
|
293 |
7922db8a
|
Seth Mos
|
$interface = "none";
|
294 |
3537ac27
|
Seth Mos
|
$dnsgw = "dns{$dnscounter}gwint";
|
295 |
|
|
if($pconfig[$dnsgw] == $interface) {
|
296 |
|
|
$selected = "selected";
|
297 |
7922db8a
|
Seth Mos
|
} else {
|
298 |
77446beb
|
Matthew Grooms
|
$selected = "";
|
299 |
7922db8a
|
Seth Mos
|
}
|
300 |
3537ac27
|
Seth Mos
|
echo "<option value='$interface' $selected>". ucwords($interface) ."</option>\n";
|
301 |
7922db8a
|
Seth Mos
|
foreach($interfaces as $interface) {
|
302 |
|
|
if(interface_has_gateway($interface)) {
|
303 |
3537ac27
|
Seth Mos
|
if($pconfig[$dnsgw] == $interface) {
|
304 |
|
|
$selected = "selected";
|
305 |
7922db8a
|
Seth Mos
|
} else {
|
306 |
|
|
$selected = "";
|
307 |
|
|
}
|
308 |
8ac4df97
|
Scott Ullrich
|
$friendly_interface = convert_friendly_interface_to_friendly_descr($interface);
|
309 |
|
|
echo "<option value='$interface' $selected>". ucwords($friendly_interface) ."</option>\n";
|
310 |
7922db8a
|
Seth Mos
|
}
|
311 |
|
|
}
|
312 |
77446beb
|
Matthew Grooms
|
?>
|
313 |
|
|
</select>
|
314 |
a077b479
|
Ermal Luçi
|
<?php endif; ?>
|
315 |
77446beb
|
Matthew Grooms
|
</td>
|
316 |
|
|
</tr>
|
317 |
|
|
<?php endfor; ?>
|
318 |
|
|
</table>
|
319 |
|
|
<br>
|
320 |
|
|
<span class="vexpl">
|
321 |
29645da6
|
Carlos Eduardo Ramos
|
<?=gettext("IP addresses: these are also used for the DHCP " .
|
322 |
f0d1af93
|
Carlos Eduardo Ramos
|
"service, DNS forwarder and for PPTP VPN clients."); ?>
|
323 |
77446beb
|
Matthew Grooms
|
<br/>
|
324 |
|
|
<?php if($multiwan): ?>
|
325 |
|
|
<br/>
|
326 |
29645da6
|
Carlos Eduardo Ramos
|
<?=gettext("In addition, select the gateway for each DNS server. " .
|
327 |
f0d1af93
|
Carlos Eduardo Ramos
|
"You should have a unique DNS server per gateway."); ?>
|
328 |
77446beb
|
Matthew Grooms
|
<br/>
|
329 |
|
|
<?php endif; ?>
|
330 |
|
|
<br/>
|
331 |
|
|
<input name="dnsallowoverride" type="checkbox" id="dnsallowoverride" value="yes" <?php if ($pconfig['dnsallowoverride']) echo "checked"; ?>>
|
332 |
|
|
<strong>
|
333 |
ad5b5f61
|
Renato Botelho
|
<?=gettext("Allow DNS server list to be overridden by DHCP/PPP on WAN"); ?>
|
334 |
77446beb
|
Matthew Grooms
|
</strong>
|
335 |
|
|
<br/>
|
336 |
ea6be4a7
|
Erik Fonnesbeck
|
<?php printf(gettext("If this option is set, %s will " .
|
337 |
f49a012c
|
Renato Botelho
|
"use DNS servers assigned by a DHCP/PPP server on WAN " .
|
338 |
|
|
"for its own purposes (including the DNS forwarder). " .
|
339 |
|
|
"However, they will not be assigned to DHCP and PPTP " .
|
340 |
|
|
"VPN clients."), $g['product_name']); ?>
|
341 |
77446beb
|
Matthew Grooms
|
</span>
|
342 |
|
|
</p>
|
343 |
|
|
</td>
|
344 |
|
|
</tr>
|
345 |
|
|
<tr>
|
346 |
7465d12c
|
Carlos Eduardo Ramos
|
<td width="22%" valign="top" class="vncell"><?=gettext("Time zone"); ?></td>
|
347 |
77446beb
|
Matthew Grooms
|
<td width="78%" class="vtable">
|
348 |
|
|
<select name="timezone" id="timezone">
|
349 |
|
|
<?php foreach ($timezonelist as $value): ?>
|
350 |
5c1f3ed2
|
sullrich
|
<?php if(strstr($value, "GMT")) continue; ?>
|
351 |
77446beb
|
Matthew Grooms
|
<option value="<?=htmlspecialchars($value);?>" <?php if ($value == $pconfig['timezone']) echo "selected"; ?>>
|
352 |
|
|
<?=htmlspecialchars($value);?>
|
353 |
|
|
</option>
|
354 |
|
|
<?php endforeach; ?>
|
355 |
f0f7a3eb
|
Scott Ullrich
|
</select>
|
356 |
77446beb
|
Matthew Grooms
|
<br/>
|
357 |
|
|
<span class="vexpl">
|
358 |
7465d12c
|
Carlos Eduardo Ramos
|
<?=gettext("Select the location closest to you"); ?>
|
359 |
77446beb
|
Matthew Grooms
|
</span>
|
360 |
|
|
</td>
|
361 |
|
|
</tr>
|
362 |
|
|
<!--
|
363 |
|
|
<tr>
|
364 |
|
|
<td width="22%" valign="top" class="vncell">Time update interval</td>
|
365 |
|
|
<td width="78%" class="vtable">
|
366 |
|
|
<input name="timeupdateinterval" type="text" class="formfld unknown" id="timeupdateinterval" size="4" value="<?=htmlspecialchars($pconfig['timeupdateinterval']);?>">
|
367 |
|
|
<br/>
|
368 |
|
|
<span class="vexpl">
|
369 |
|
|
Minutes between network time sync. 300 recommended,
|
370 |
|
|
or 0 to disable
|
371 |
|
|
</span>
|
372 |
|
|
</td>
|
373 |
|
|
</tr>
|
374 |
|
|
-->
|
375 |
|
|
<tr>
|
376 |
7465d12c
|
Carlos Eduardo Ramos
|
<td width="22%" valign="top" class="vncell"><?=gettext("NTP time server"); ?></td>
|
377 |
77446beb
|
Matthew Grooms
|
<td width="78%" class="vtable">
|
378 |
|
|
<input name="timeservers" type="text" class="formfld unknown" id="timeservers" size="40" value="<?=htmlspecialchars($pconfig['timeservers']);?>">
|
379 |
|
|
<br/>
|
380 |
|
|
<span class="vexpl">
|
381 |
f0d1af93
|
Carlos Eduardo Ramos
|
<?=gettext("Use a space to separate multiple hosts (only one " .
|
382 |
|
|
"required). Remember to set up at least one DNS server " .
|
383 |
|
|
"if you enter a host name here!"); ?>
|
384 |
77446beb
|
Matthew Grooms
|
</span>
|
385 |
|
|
</td>
|
386 |
|
|
</tr>
|
387 |
|
|
<tr>
|
388 |
|
|
<td colspan="2" class="list" height="12"> </td>
|
389 |
|
|
</tr>
|
390 |
8b289232
|
Chris Buechler
|
<?php if (! $g['disablethemeselection']): ?>
|
391 |
77446beb
|
Matthew Grooms
|
<tr>
|
392 |
7465d12c
|
Carlos Eduardo Ramos
|
<td colspan="2" valign="top" class="listtopic"><?=gettext("Theme"); ?></td>
|
393 |
77446beb
|
Matthew Grooms
|
</tr>
|
394 |
|
|
<tr>
|
395 |
|
|
<td width="22%" valign="top" class="vncell"> </td>
|
396 |
|
|
<td width="78%" class="vtable">
|
397 |
|
|
<select name="theme">
|
398 |
|
|
<?php
|
399 |
|
|
$files = return_dir_as_array("/usr/local/www/themes/");
|
400 |
|
|
foreach($files as $f):
|
401 |
|
|
if ((substr($f, 0, 1) == "_") && !isset($config['system']['developer']))
|
402 |
|
|
continue;
|
403 |
|
|
if ($f == "CVS")
|
404 |
|
|
continue;
|
405 |
|
|
$curtheme = "pfsense";
|
406 |
|
|
if ($config['theme'])
|
407 |
|
|
$curtheme = $config['theme'];
|
408 |
|
|
$selected = "";
|
409 |
|
|
if($f == $curtheme)
|
410 |
|
|
$selected = " SELECTED";
|
411 |
|
|
?>
|
412 |
|
|
<option <?=$selected;?>><?=$f;?></option>
|
413 |
|
|
<?php endforeach; ?>
|
414 |
|
|
</select>
|
415 |
|
|
<strong>
|
416 |
7465d12c
|
Carlos Eduardo Ramos
|
<?=gettext("This will change the look and feel of"); ?>
|
417 |
77446beb
|
Matthew Grooms
|
<?=$g['product_name'];?>.
|
418 |
|
|
</strong>
|
419 |
|
|
</td>
|
420 |
|
|
</tr>
|
421 |
8b289232
|
Chris Buechler
|
<?php endif; ?>
|
422 |
306f082a
|
Scott Ullrich
|
<tr>
|
423 |
|
|
<td colspan="2" class="list" height="12"> </td>
|
424 |
|
|
</tr>
|
425 |
77446beb
|
Matthew Grooms
|
<tr>
|
426 |
|
|
<td width="22%" valign="top"> </td>
|
427 |
|
|
<td width="78%">
|
428 |
e454bcd3
|
Vinicius Coque
|
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>">
|
429 |
f0f7a3eb
|
Scott Ullrich
|
</td>
|
430 |
77446beb
|
Matthew Grooms
|
</tr>
|
431 |
|
|
</table>
|
432 |
27b07eda
|
Ermal Lu?i
|
</div>
|
433 |
|
|
</td></tr>
|
434 |
|
|
</table>
|
435 |
77446beb
|
Matthew Grooms
|
</form>
|
436 |
5b237745
|
Scott Ullrich
|
<?php include("fend.inc"); ?>
|
437 |
2f3f316c
|
Scott Ullrich
|
</body>
|
438 |
|
|
</html>
|