Project

General

Profile

Download (22.9 KB) Statistics
| Branch: | Tag: | Revision:
1
<?xml version="1.0" encoding="utf-8" ?>
2
<pfsensewizard>
3
<copyright>
4
/* $Id$ */
5
/*
6
	setup.xml
7
        part of pfSense (http://www.pfsense.org/)
8

    
9
	Copyright (C) 2004, 2005 Scott Ullrich
10
        All rights reserved.
11

    
12
        Redistribution and use in source and binary forms, with or without
13
        modification, are permitted provided that the following conditions are met:
14

    
15
        1. Redistributions of source code must retain the above copyright notice,
16
           this list of conditions and the following disclaimer.
17

    
18
        2. Redistributions in binary form must reproduce the above copyright
19
           notice, this list of conditions and the following disclaimer in the
20
           documentation and/or other materials provided with the distribution.
21

    
22
        THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
        INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
        AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
        AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26
        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
        INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
        CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
        ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
        POSSIBILITY OF SUCH DAMAGE.
32
*/
33
</copyright>
34
<totalsteps>9</totalsteps>
35
<step>
36
	<id>1</id>
37
	<title>pfSense Setup Wizard</title>
38
	<disableheader>true</disableheader>
39
	<description>This wizard will guide you through the initial configuration of pfSense.</description>
40
	<fields>
41
		<field>
42
			<name>Next</name>
43
			<type>submit</type>
44
		</field>
45
	</fields>
46
	<stepbeforeformdisplay>
47
		conf_mount_rw();
48
		unlink_if_exists('/conf/trigger_initial_wizard');
49
		conf_mount_ro();
50
	</stepbeforeformdisplay>
51
</step>
52
<step>
53
	<id>2</id>
54
	<title>General Information</title>
55
	<description>On this screen you will set the general pfSense parameters.</description>
56
	<fields>
57
		<field>
58
			<name>Hostname</name>
59
			<type>input</type>
60
			<bindstofield>wizardtemp->system->hostname</bindstofield>
61
			<description>EXAMPLE: myserver</description>
62
			<validate>^[a-z0-9.|-]+$</validate>
63
			<message>Invalid Hostname</message>
64
		</field>
65
		<field>
66
			<name>Domain</name>
67
			<type>input</type>
68
			<bindstofield>wizardtemp->system->domain</bindstofield>
69
			<description>EXAMPLE: mydomain.com</description>
70
			<validate>^[a-z0-9.|-]+$</validate>
71
			<message>Domain name field is invalid</message>
72
		</field>
73
		<field>
74
			<name>Primary DNS Server</name>
75
			<type>input</type>
76
			<bindstofield>system->dnsserver</bindstofield>
77
			<!-- we must unset the fields because this is an array. -->
78
			<unsetfield>yes</unsetfield>
79
			<arraynum>0</arraynum>
80
			<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
81
			<message>Primary DNS Server field is invalid</message>
82
		</field>
83
		<field>
84
			<name>Secondary DNS Server</name>
85
			<type>input</type>
86
			<bindstofield>system->dnsserver</bindstofield>
87
			<arraynum>1</arraynum>
88
			<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
89
			<message>Secondary DNS Server field is invalid</message>
90
		</field>
91
		<field>
92
			<name>Override DNS</name>
93
			<description>Allow DNS servers to be overridden by DHCP/PPP on WAN</description>
94
			<type>checkbox</type>
95
			<bindstofield>system->dnsallowoverride</bindstofield>
96
		</field>
97
		<field>
98
			<name>Next</name>
99
			<type>submit</type>
100
		</field>
101
	</fields>
102
	<stepbeforeformdisplay>
103
		<![CDATA[
104
		$config['wizardtemp'] = array();
105
		$config['wizardtemp']['system'] = array();
106
		$config['wizardtemp']['system']['hostname'] = $config['system']['hostname'];
107
		$config['wizardtemp']['system']['domain'] = $config['system']['domain'];
108
		]]>
109
	</stepbeforeformdisplay>
110
	<stepsubmitphpaction>
111
		<![CDATA[
112
		if(empty($_POST['hostname']) || !is_hostname($_POST['hostname'])) {
113
			print_info_box_np("Hostname is invalid. Please press back in your browser window and correct.");
114
			die;
115
		}
116
		if(empty($_POST['domain']) || !is_domain($_POST['domain'])) {
117
			print_info_box_np("Domain is invalid. Please press back in your browser window and correct.");
118
			die;
119
		}
120
		if(!empty($_POST['primarydnsserver']) && !is_ipaddr($_POST['primarydnsserver'])) {
121
			print_info_box_np("Primary DNS server is invalid. Please press back in your browser window and correct.");
122
			die;
123
		}
124
		if(!empty($_POST['secondarydnsserver']) && !is_ipaddr($_POST['secondarydnsserver'])) {
125
			print_info_box_np("Second DNS server is invalid. Please press back in your browser window and correct.");
126
			die;
127
		}
128
		]]>
129
	</stepsubmitphpaction>
130
</step>
131
<step>
132
	<id>3</id>
133
	<title>Time Server Information</title>
134
	<description>Please enter the time, date and time zone.</description>
135
	<fields>
136
		<field>
137
			<name>Time server hostname</name>
138
			<description>Enter the hostname (FQDN) of the time server.</description>
139
			<type>input</type>
140
			<bindstofield>system->timeservers</bindstofield>
141
			<validate>^[a-z0-9.|-]+$</validate>
142
			<message>Invalid Time Server Field</message>
143
		</field>
144
		<field>
145
			<name>Timezone</name>
146
			<type>timezone_select</type>
147
			<bindstofield>system->timezone</bindstofield>
148
		</field>
149
		<field>
150
			<name>Next</name>
151
			<type>submit</type>
152
		</field>
153
	</fields>
154
	<stepsubmitphpaction>
155
		<![CDATA[
156
		if(!empty($_POST['timeserverhostname']) && !(is_hostname($_POST['timeserverhostname']) || is_ipaddr($_POST['timeserverhostname']))) {
157
			print_info_box_np("Invalid Time Server. Please press back in your browser window and correct.");
158
			die;
159
		}
160
		]]>
161
	</stepsubmitphpaction>
162
</step>
163
<step>
164
	<id>4</id>
165
	<disableallfieldsbydefault>true</disableallfieldsbydefault>
166
	<title>Configure WAN Interface</title>
167
	<description>On this screen we will configure the Wide Area Network information.</description>
168
	<javascriptafterformdisplay>
169
		var selectedItem = 0;
170
		if(document.forms[0].ipaddress.value == 'dhcp') {
171
			selectedItem = 1;
172
			document.forms[0].ipaddress.value = '';
173
		} else if(document.forms[0].ipaddress.value == 'pppoe') {
174
			selectedItem = 2;
175
			document.forms[0].ipaddress.value = '';
176
		} else if(document.forms[0].ipaddress.value == 'pptp') {
177
			selectedItem = 3;
178
			document.forms[0].ipaddress.value = '';
179
		} else if(document.forms[0].ipaddress.value == 'ppp' || document.forms[0].ipaddress.value == 'l2tp') {
180
			document.forms[0].ipaddress.value = '';
181
		} else {
182
			selectedItem = 0;
183
		}
184
		document.forms[0].selectedtype.selectedIndex = selectedItem;
185
		enableitems(selectedItem);
186
	</javascriptafterformdisplay>
187
	<fields>
188
		<field>
189
			<name>SelectedType</name>
190
			<type>select</type>
191
			<donotdisable>true</donotdisable>
192
			<options>
193
				<option>
194
					<name>Static</name>
195
					<value>Static</value>
196
					<enablefields>ipaddress,subnetmask,gateway</enablefields>
197
				</option>
198
				<option>
199
					<name>DHCP</name>
200
					<value>dhcp</value>
201
					<enablefields>dhcphostname</enablefields>
202
				</option>
203
				<option>
204
					<name>PPPoE</name>
205
					<value>pppoe</value>
206
					<enablefields>pppoeusername,pppoepassword,pppoeservicename,pppoedialondemand,pppoeidletimeout</enablefields>
207
				</option>
208
				<option>
209
					<name>PPTP</name>
210
					<value>pptp</value>
211
					<enablefields>pptpusername,pptppassword,pptplocalipaddress,pptplocalsubnet,pptpremoteipaddress,pptpdialondemand,pptpidletimeout
212
					</enablefields>
213
				</option>
214
			</options>
215
		</field>
216
		<field>
217
			<name>General configuration</name>
218
			<type>listtopic</type>
219
		</field>
220
		<field>
221
			<donotdisable>true</donotdisable>
222
			<name>MAC Address</name>
223
			<bindstofield>interfaces->wan->spoofmac</bindstofield>
224
			<type>input</type>
225
			<description> This field can be used to modify ("spoof") the MAC address of the WAN interface (may be required with some cable connections). Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx or leave blank.</description>
226
			<validate>^([0-9a-f]{2}([:-]||$)){6}$</validate>
227
			<message>MAC Address field is invalid</message>
228
		</field>
229
		<field>
230
			<donotdisable>true</donotdisable>
231
			<name>MTU</name>
232
			<type>input</type>
233
			<bindstofield>interfaces->wan->mtu</bindstofield>
234
			<description> If you enter a value in this field, then MSS clamping for TCP connections to the value entered above minus 40 (TCP/IP header size) will be in effect. If you leave this field blank, an MTU of 1492 bytes for PPPoE and 1500 bytes for all other connection types will be assumed.</description>
235
		</field>
236
		<field>
237
			<name>Static IP Configuration</name>
238
			<type>listtopic</type>
239
		</field>
240
		<field>
241
			<name>IP Address</name>
242
			<bindstofield>interfaces->wan->ipaddr</bindstofield>
243
			<type>input</type>
244
			<typehint> / </typehint>
245
			<combinefieldsbegin>true</combinefieldsbegin>
246
			<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
247
			<message>IP Address field is invalid</message>
248
		</field>
249
		<field>
250
			<combinefieldsend>true</combinefieldsend>
251
			<dontdisplayname>true</dontdisplayname>
252
			<dontcombinecells>true</dontcombinecells>
253
			<name>Subnet Mask</name>
254
			<bindstofield>interfaces->wan->subnet</bindstofield>
255
			<type>subnet_select</type>
256
		</field>
257
		<field>
258
			<name>Gateway</name>
259
			<bindstofield>wizardtemp->wangateway</bindstofield>
260
			<type>input</type>
261
			<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
262
			<message>Gateway IP Address field is invalid</message>
263
		</field>
264
		<field>
265
			<name>DHCP client configuration</name>
266
			<type>listtopic</type>
267
		</field>
268
		<field>
269
			<name>DHCP Hostname</name>
270
			<type>input</type>
271
			<bindstofield>interfaces->wan->dhcphostname</bindstofield>
272
			<description> The value in this field is sent as the DHCP client identifier and hostname when requesting a DHCP lease. Some ISPs may require this (for client identification).</description>
273
		</field>
274
		<field>
275
			<name>PPPoE configuration</name>
276
			<type>listtopic</type>
277
		</field>
278
		<field>
279
			<name>PPPoE Username</name>
280
			<type>input</type>
281
			<bindstofield>wizardtemp->wan->username</bindstofield>
282
		</field>
283
		<field>
284
			<name>PPPoE Password</name>
285
			<type>input</type>
286
			<bindstofield>wizardtemp->wan->password</bindstofield>
287
		</field>
288
		<field>
289
			<name>PPPoE Service name</name>
290
			<type>input</type>
291
			<description>Hint: this field can usually be left empty</description>
292
			<bindstofield>wizardtemp->wan->provider</bindstofield>
293
		</field>
294
		<field>
295
			<name>PPPoE Dial on demand</name>
296
			<typehint>Enable Dial-On-Demand mode</typehint>
297
			<type>checkbox</type>
298
			<description>This option causes the interface to operate in dial-on-demand mode, allowing you to have a virtual full time connection. The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected.</description>
299
			<bindstofield>wizardtemp->wan->ondemand</bindstofield>
300
		</field>
301
		<field>
302
			<name>PPPoE Idle timeout</name>
303
			<type>input</type>
304
			<description>If no qualifying outgoing packets are transmitted for the specified number of seconds, the connection is brought down. An idle timeout of zero disables this feature.</description>
305
			<bindstofield>wizardtemp->wan->idletimeout</bindstofield>
306
		</field>
307
		<field>
308
			<name>PPTP configuration</name>
309
			<type>listtopic</type>
310
		</field>
311
		<field>
312
			<name>PPTP Username</name>
313
			<type>input</type>
314
			<bindstofield>wizardtemp->wan->pptpusername</bindstofield>
315
		</field>
316
		<field>
317
			<name>PPTP Password</name>
318
			<type>input</type>
319
			<bindstofield>wizardtemp->wan->pptppassword</bindstofield>
320
		</field>
321
		<field>
322
			<combinefieldsbegin>true</combinefieldsbegin>
323
			<name>PPTP Local IP Address</name>
324
			<type>input</type>
325
			<typehint> / </typehint>
326
			<bindstofield>wizardtemp->wan->localip</bindstofield>
327
			<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
328
			<message>PPTP Local IP Address field is invalid</message>
329
		</field>
330
		<field>
331
			<combinefieldsend>true</combinefieldsend>
332
			<dontdisplayname>true</dontdisplayname>
333
			<dontcombinecells>true</dontcombinecells>
334
			<name>pptplocalsubnet</name>
335
			<bindstofield>wizardtemp->wan->subnet</bindstofield>
336
			<type>subnet_select</type>
337
		</field>
338
		<field>
339
			<name>PPTP Remote IP Address</name>
340
			<bindstofield>wizardtemp->wan->gateway</bindstofield>
341
			<type>input</type>
342
			<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
343
			<message>PPTP Remote IP Address field is invalid</message>
344
		</field>
345
		<field>
346
			<name>PPTP Dial on demand</name>
347
			<typehint>Enable Dial-On-Demand mode</typehint>
348
			<type>checkbox</type>
349
			<bindstofield>wizardtemp->wan->pptpondemand</bindstofield>			
350
			<description>This option causes the interface to operate in dial-on-demand mode, allowing you to have a virtual full time connection. The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected.</description>
351
		</field>
352
		<field>
353
			<name>PPTP Idle timeout</name>
354
			<type>input</type>			
355
			<bindstofield>wizardtemp->wan->pptpidletimeout</bindstofield>
356
			<description>If no qualifying outgoing packets are transmitted for the specified number of seconds, the connection is brought down. An idle timeout of zero disables this feature.</description>
357
		</field>
358
		<field>
359
			<name>RFC1918 Networks</name>
360
			<type>listtopic</type>
361
		</field>
362
		<field>
363
			<donotdisable>true</donotdisable>
364
			<name>Block RFC1918 Private Networks</name>
365
			<description> When set, this option blocks traffic from IP addresses that are reserved for private networks as per RFC 1918 (10/8, 172.16/12, 192.168/16) as well as loopback addresses (127/8). You should generally leave this option turned on, unless your WAN network lies in such a private address space, too.</description>
366
			<type>checkbox</type>
367
			<bindstofield>interfaces->wan->blockpriv</bindstofield>
368
			<typehint>Block private networks from entering via WAN</typehint>
369
		</field>
370
		<field>
371
			<name>Block bogon networks</name>
372
			<type>listtopic</type>
373
		</field>
374
		<field>
375
			<donotdisable>true</donotdisable>
376
			<name>Block bogon networks</name>
377
			<description>When set, this option blocks traffic from IP addresses that are reserved (but not RFC 1918) or not yet assigned by IANA. Bogons are prefixes that should never appear in the Internet routing table, and obviously should not appear as the source address in any packets you receive.</description>
378
			<type>checkbox</type>
379
			<bindstofield>interfaces->wan->blockbogons</bindstofield>
380
			<typehint>Block non-Internet routed networks from entering via WAN</typehint>
381
		</field>
382
		<field>
383
			<name>Next</name>
384
			<type>submit</type>
385
		</field>
386
	</fields>
387
	<stepbeforeformdisplay>
388
		<![CDATA[
389
		if (is_array($config['gateways']['gateway_item']))
390
			foreach ($config['gateways']['gateway_item'] as $gw)
391
				if ($gw['name'] == 'WANGW')
392
					$config['wizardtemp']['wangateway'] = $gw['gateway'];
393
		]]>
394
	</stepbeforeformdisplay>
395
	<stepsubmitphpaction>
396
		<![CDATA[
397
		if(!empty($_POST['mtu']) && ($_POST['mtu'] < 576)) {
398
			print_info_box_np("MTU Must be at least 576 (Per RFC 791). Please press back in your browser window and correct.");
399
			die;
400
		}
401
		if(!empty($_POST['macaddress']) && !is_macaddr($_POST['macaddress'])) {
402
			print_info_box_np("Invalid MAC Address. Please press back in your browser window and correct.");
403
			die;
404
		}
405
		if(!empty($_POST['ipaddress']) && ($_POST['selectedtype'] == "Static") && (!is_ipaddr($_POST['ipaddress']))) {
406
			print_info_box_np("Invalid WAN IP Address. Please press back in your browser window and correct.");
407
			die;
408
		}
409
		if(!empty($_POST['dhcphostname']) && !is_hostname($_POST['dhcphostname'])) {
410
			print_info_box_np("Invalid DHCP Hostname. Please press back in your browser window and correct.");
411
			die;
412
		}
413
		if(!empty($_POST['pptplocalipaddress']) && !is_ipaddr($_POST['pptplocalipaddress'])) {
414
			print_info_box_np("Invalid PPTP Local IP Address. Please press back in your browser window and correct.");
415
			die;
416
		}
417
		if(!empty($_POST['pptpremoteipaddress']) && !is_ipaddr($_POST['pptpremoteipaddress'])) {
418
			print_info_box_np("Invalid PPTP Remopte IP Address. Please press back in your browser window and correct.");
419
			die;
420
		}
421
		$type = $_POST['selectedtype'];
422

    
423
		if (!is_array($config['ppps']['ppp']))
424
			$config['ppps']['ppp'] = array();
425
		if (count($config['ppps']['ppp'])) {
426
			foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
427
				if ($ppp['ptpid'] == "0") {
428
					if ((substr($config['interfaces']['wan']['if'],0,5) == "pppoe") || (substr($config['interfaces']['wan']['if'],0,4) == "pptp")) {
429
						$oldif = explode(",", $ppp['ports']);
430
						$config['interfaces']['wan']['if'] = $oldif[0];
431
					}
432
					if ($type == "pppoe" || $type == "pptp")
433
						unset($config['ppps']['ppp'][$pppid]);
434
				}
435
			}
436
		}
437

    
438
		if ($type == "pppoe" || $type == "pptp") {
439
			if ($type == "pptp") {
440
				$config['wizardtemp']['wan']['username'] = $config['wizardtemp']['wan']['pptpusername'];
441
				$config['wizardtemp']['wan']['password'] = $config['wizardtemp']['wan']['pptppassword'];
442
				$config['wizardtemp']['wan']['ondemand'] = $config['wizardtemp']['wan']['pptpondemand'];
443
				$config['wizardtemp']['wan']['idletimeout'] = $config['wizardtemp']['wan']['pptpidletimeout'];
444
				unset($config['wizardtemp']['wan']['pptpusername']);
445
				unset($config['wizardtemp']['wan']['pptppassword']);
446
				unset($config['wizardtemp']['wan']['pptpondemand']);
447
				unset($config['wizardtemp']['wan']['pptpidletimeout']);
448
			}
449
			$config['wizardtemp']['wan']['password'] = base64_encode($config['wizardtemp']['wan']['password']);
450
			$tmp = array();
451
			$tmp['ptpid'] = "0";
452
			$tmp['type'] = $type;
453
			$tmp['if'] = $type . "0";
454
			$tmp['ports'] = $config['interfaces']['wan']['if'];
455
			$config['ppps']['ppp'][] = array_merge($tmp, $config['wizardtemp']['wan']);
456
			unset($tmp);
457
			$config['interfaces']['wan']['if'] = $type."0";
458
		}
459
		unset($config['wizardtemp']['wan']);
460
		]]>
461
	</stepsubmitphpaction>
462
	<stepsubmitbeforesave>
463
		<![CDATA[
464
			if($_POST['selectedtype'] == "Static") { 
465
			
466
			} else {
467
				$_POST['ipaddress'] = $_POST['selectedtype'];
468
				$config['interfaces']['wan']['ipaddr'] = $_POST['selectedtype'];
469
				write_config();
470
				if(!$config['interfaces']['lan']) 
471
					Header("Location: /wizard.php?xml=setup_wizard.xml&stepid=5&next=Next");
472
			}
473
		]]>
474
	</stepsubmitbeforesave>
475
</step>
476
<step>
477
	<id>5</id>
478
	<title>Configure LAN Interface</title>
479
	<description>On this screen we will configure the Local Area Network information.</description>
480
	<fields>
481
		<field>
482
			<name>LAN IP Address</name>
483
			<type>input</type>
484
			<bindstofield>interfaces->lan->ipaddr</bindstofield>
485
			<description>Type dhcp if this interface uses DHCP to obtain its IP address.</description>
486
			<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
487
			<message>LAN IP Address field is invalid</message>
488
		</field>
489
				<field>
490
			<name>Subnet Mask</name>
491
			<type>subnet_select</type>
492
			<bindstofield>interfaces->lan->subnet</bindstofield>
493
		</field>
494
		<field>
495
			<name>Next</name>
496
			<type>submit</type>
497
		</field>
498
	</fields>
499
	<stepsubmitphpaction>
500
		<![CDATA[
501
		if(empty($_POST['lanipaddress']) || !is_ipaddr($_POST['lanipaddress'])) {
502
			print_info_box_np("Invalid LAN IP Address. Please press back in your browser window and correct.");
503
			die;
504
		}
505
		$ft = explode(".", $_POST['lanipaddress']);
506
		$ft_ip = $ft[0] . "." . $ft[1] . "." . $ft[2] . ".";
507
		$config['dhcpd']['lan']['range']['from'] = $ft_ip . "10";
508
		$highestip = gen_subnet_max($_POST['lanipaddress'], $config['interfaces']['lan']['subnet']);
509
		$hi = explode(".", $highestip);
510
		$highestip = $hi[3]-10;
511
		$config['dhcpd']['lan']['range']['to'] = $ft_ip . $highestip;
512
		]]>
513
	</stepsubmitphpaction>
514
</step>
515
<step>
516
	<id>6</id>
517
	<title>Set Admin WebGUI Password</title>
518
	<description>On this screen we will set the admin password, which is used to access the WebGUI and also SSH services if you wish to enable them.</description>
519
	<fields>
520
		<field>
521
			<name>Admin Password</name>
522
			<type>password</type>
523
		</field>
524
		<field>
525
			<name>Admin Password AGAIN</name>
526
			<type>password</type>
527
		</field>
528
		<field>
529
			<name>Next</name>
530
			<type>submit</type>
531
		</field>
532
	</fields>
533
	<stepsubmitphpaction>
534
	if($_POST['adminpassword'] != "") {
535
		if($_POST['adminpassword'] == $_POST['adminpasswordagain']) {
536
			$admin_user =&amp; getUserEntryByUID(0);
537
			local_user_set_password($admin_user, $_POST['adminpassword']);
538
			local_user_set($admin_user);
539
			write_config();
540
		} else {
541
			print_info_box_np("Passwords do not match!  Please press back in your browser window and correct.");
542
			die;
543
		}
544
	}
545
	</stepsubmitphpaction>
546
</step>
547
<step>
548
	<id>7</id>
549
	<title>Reload configuration</title>
550
	<disableheader>true</disableheader>
551
	<description>Click 'Reload' to reload pfSense with new changes.  If you changed the password, pfSense will ask you to log in again.</description>
552
	<fields>
553
		<field>
554
			<name>Reload</name>
555
			<type>submit</type>
556
		</field>
557
	</fields>
558
</step>
559
<step>
560
	<id>8</id>
561
	<title>Reload in progress</title>
562
	<description>
563
		A reload is now in progress.  Please wait. &lt;p&gt; 
564
		&lt;meta http-equiv="refresh" content="60; url=wizard.php?xml=setup_wizard.xml&amp;stepid=8" &gt;
565
		&lt;p&gt;
566
		The wizard will redirect to the next step once the reload is completed.
567
	</description>
568
	<stepafterformdisplay>
569
		<![CDATA[
570
		$config['system']['hostname'] = $config['wizardtemp']['system']['hostname'];
571
		$config['system']['domain'] = $config['wizardtemp']['system']['domain'];
572
		if (!empty($config['wizardtemp']['wangateway'])) {
573
			if (!is_array($config['gateways']['gateway_item']))
574
				$config['gateways']['gateway_item'] = array();
575
			$found = false;
576
			foreach ($config['gateways']['gateway_item'] as & $gw) {
577
				if ($gw['name'] == 'WANGW') {
578
					$found = true;
579
					$gw['gateway'] = $config['wizardtemp']['wangateway'];
580
				}
581
			}
582
			if (!$found) {
583
				$newgw = array();
584
				$newgw['interface'] = "wan";
585
				$newgw['gateway'] = $config['wizardtemp']['wangateway'];
586
				$newgw['name'] = "WANGW";
587
				$newgw['weight'] = 1;
588
				$newgw['descr'] = "WAN Gateway";
589
				$newgw['defaultgw'] = true;
590
				$config['gateways']['gateway_item'][] = $newgw;
591
			}
592
			$config['interfaces']['wan']['gateway'] = "WANGW";
593
		}
594
		unset($config['wizardtemp']);
595
		write_config();
596
		interface_reconfigure("wan");
597
		interface_reconfigure("lan");
598
		reload_all();
599
		mwexec_bg("/etc/rc.update_bogons.sh now");
600
		]]>
601
	</stepafterformdisplay>
602
</step>
603
<step>
604
	<id>9</id>
605
	<title>Wizard completed.</title>
606
	<stepbeforeformdisplay>
607
	<![CDATA[
608
		if($g['product_name'] <> 'pfSense') {
609
			Header("Location: " . fixup_string("\$myurl"));
610
			exit;
611
		}	
612
	]]>
613
	</stepbeforeformdisplay>
614
	<description>
615
	<![CDATA[
616
		Congratulations!  pfSense is now configured.<p/>
617
		Please consider donating to the project to help us with our overheads costs.<p/>
618
		Click <a target='_new' href='http://www.pfsense.org/j.php?jumpto=donate'>here</a> to donate or purchase services offered by the pfSense team.<p/>
619
		Click <a href='$myurl'>here</a> to continue on to pfSense webConfigurator.
620
	]]>
621
	</description>
622
</step>
623
</pfsensewizard>
(3-3/11)