Project

General

Profile

Download (25.7 KB) Statistics
| Branch: | Tag: | Revision:
1
<?xml version="1.0" encoding="utf-8" ?>
2
<pfsensewizard>
3
<copyright>
4
/* $Id$ */
5
/*
6
	setup_wizard.xml
7
        part of pfSense (https://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>10</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.&lt;br/&gt;&lt;br/&gt; The wizard may be stopped at any time by clicking the logo image at the top of the screen.</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>Bling your pfSense with pfSense Gold</title>
55
	<disableheader>true</disableheader>
56
	<description>Feel the power of a pfSense Gold subscription. Receive special benefits while supporting ongoing development of the Open Source pfSense project.&lt;br/&gt; &lt;br/&gt; Benefits include access to our AutoConfigBackup secure cloud based backup service for up to 10 hosts, pre-publication access to the updated pfSense: The Definitive Guide book in PDF, fully updated for the pfSense 2.1 release, and a monthly online MeetUp! Video conference to discuss and demonstrate advanced features and architectures using pfSense. &lt;br/&gt; &lt;br/&gt; Go to &lt;a href="https://www.pfsense.org/gold" target="_blank"&gt; pfSense Gold Subscriptions&lt;/a&gt; to sign up now &lt;br/&gt; &lt;br/&gt; </description>
57
	<fields>
58
		<field>
59
			<name>Next</name>
60
			<type>submit</type>
61
		</field>
62
	</fields>
63
</step>
64
<step>
65
	<id>3</id>
66
	<title>General Information</title>
67
	<description>On this screen you will set the general pfSense parameters.</description>
68
	<fields>
69
		<field>
70
			<name>Hostname</name>
71
			<type>input</type>
72
			<bindstofield>wizardtemp->system->hostname</bindstofield>
73
			<description>EXAMPLE: myserver</description>
74
			<validate>^[a-z0-9.|-]+$</validate>
75
			<message>Invalid Hostname</message>
76
		</field>
77
		<field>
78
			<name>Domain</name>
79
			<type>input</type>
80
			<bindstofield>wizardtemp->system->domain</bindstofield>
81
			<description>EXAMPLE: mydomain.com</description>
82
			<validate>^[a-z0-9.|-]+$</validate>
83
			<message>Domain name field is invalid</message>
84
		</field>
85
		<field>
86
			<name>DNS Resolver Behavior</name>
87
			<type>text</type>
88
			<description>The default behavior of the DNS Resolver will ignore manually configured DNS servers for client queries and query root DNS servers directly. To use the manually configured DNS servers below for client queries, visit Services &gt; DNS Resolver and enable DNS Query Forwarding after completing the wizard.</description>
89
		</field>
90
		<field>
91
			<name>Primary DNS Server</name>
92
			<type>input</type>
93
			<bindstofield>system->dnsserver</bindstofield>
94
			<!-- we must unset the fields because this is an array. -->
95
			<unsetfield>yes</unsetfield>
96
			<arraynum>0</arraynum>
97
			<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>
98
			<message>Primary DNS Server field is invalid</message>
99
		</field>
100
		<field>
101
			<name>Secondary DNS Server</name>
102
			<type>input</type>
103
			<bindstofield>system->dnsserver</bindstofield>
104
			<arraynum>1</arraynum>
105
			<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>
106
			<message>Secondary DNS Server field is invalid</message>
107
		</field>
108
		<field>
109
			<name>Override DNS</name>
110
			<description>Allow DNS servers to be overridden by DHCP/PPP on WAN</description>
111
			<type>checkbox</type>
112
			<bindstofield>system->dnsallowoverride</bindstofield>
113
		</field>
114
		<field>
115
			<name>Next</name>
116
			<type>submit</type>
117
		</field>
118
	</fields>
119
	<stepbeforeformdisplay>
120
		<![CDATA[
121
		$config['wizardtemp'] = array();
122
		$config['wizardtemp']['system'] = array();
123
		$config['wizardtemp']['system']['hostname'] = $config['system']['hostname'];
124
		$config['wizardtemp']['system']['domain'] = $config['system']['domain'];
125
		]]>
126
	</stepbeforeformdisplay>
127
	<stepsubmitphpaction>
128
		<![CDATA[
129
		if(empty($_POST['hostname']) || !is_unqualified_hostname($_POST['hostname'])) {
130
			print_info_box_np("Hostname is invalid. Please press back in your browser window and correct.");
131
			die;
132
		}
133
		if(empty($_POST['domain']) || !is_domain($_POST['domain'])) {
134
			print_info_box_np("Domain is invalid. Please press back in your browser window and correct.");
135
			die;
136
		}
137
		if(!empty($_POST['primarydnsserver']) && !is_ipaddr($_POST['primarydnsserver'])) {
138
			print_info_box_np("Primary DNS server is invalid. Please press back in your browser window and correct.");
139
			die;
140
		}
141
		if(!empty($_POST['secondarydnsserver']) && !is_ipaddr($_POST['secondarydnsserver'])) {
142
			print_info_box_np("Second DNS server is invalid. Please press back in your browser window and correct.");
143
			die;
144
		}
145
		]]>
146
	</stepsubmitphpaction>
147
</step>
148
<step>
149
	<id>4</id>
150
	<title>Time Server Information</title>
151
	<description>Please enter the time, date and time zone.</description>
152
	<fields>
153
		<field>
154
			<name>Time server hostname</name>
155
			<description>Enter the hostname (FQDN) of the time server.</description>
156
			<type>input</type>
157
			<bindstofield>system->timeservers</bindstofield>
158
		</field>
159
		<field>
160
			<name>Timezone</name>
161
			<type>timezone_select</type>
162
			<bindstofield>system->timezone</bindstofield>
163
		</field>
164
		<field>
165
			<name>Next</name>
166
			<type>submit</type>
167
		</field>
168
	</fields>
169
	<stepsubmitphpaction>
170
		<![CDATA[
171
		foreach (explode(' ', $_POST['timeserverhostname']) as $ts) {
172
			if (!is_domain($ts)) {
173
				print_info_box_np(gettext("NTP Time Server names may only contain the characters a-z, 0-9, '-' and '.'. Entries may be separated by spaces. Please press back in your browser window and correct."));
174
				die;
175
			}
176
		}
177
		]]>
178
	</stepsubmitphpaction>
179
</step>
180
<step>
181
	<id>5</id>
182
	<disableallfieldsbydefault>true</disableallfieldsbydefault>
183
	<title>Configure WAN Interface</title>
184
	<description>On this screen we will configure the Wide Area Network information.</description>
185
	<javascriptafterformdisplay>
186
		var selectedItem = 0;
187
		if(document.forms[0].ipaddress.value == 'dhcp') {
188
			selectedItem = 1;
189
			document.forms[0].ipaddress.value = '';
190
		} else if(document.forms[0].ipaddress.value == 'pppoe') {
191
			selectedItem = 2;
192
			document.forms[0].ipaddress.value = '';
193
		} else if(document.forms[0].ipaddress.value == 'pptp') {
194
			selectedItem = 3;
195
			document.forms[0].ipaddress.value = '';
196
		} else if(document.forms[0].ipaddress.value == 'ppp' || document.forms[0].ipaddress.value == 'l2tp') {
197
			document.forms[0].ipaddress.value = '';
198
		} else {
199
			selectedItem = 0;
200
		}
201
		document.forms[0].selectedtype.selectedIndex = selectedItem;
202
		enableitems(selectedItem);
203
	</javascriptafterformdisplay>
204
	<fields>
205
		<field>
206
			<name>SelectedType</name>
207
			<type>select</type>
208
			<donotdisable>true</donotdisable>
209
			<options>
210
				<option>
211
					<name>Static</name>
212
					<value>Static</value>
213
					<enablefields>ipaddress,subnetmask,upstreamgateway</enablefields>
214
				</option>
215
				<option>
216
					<name>DHCP</name>
217
					<value>dhcp</value>
218
					<enablefields>dhcphostname</enablefields>
219
				</option>
220
				<option>
221
					<name>PPPoE</name>
222
					<value>pppoe</value>
223
					<enablefields>pppoeusername,pppoepassword,pppoeservicename,pppoedialondemand,pppoeidletimeout</enablefields>
224
				</option>
225
				<option>
226
					<name>PPTP</name>
227
					<value>pptp</value>
228
					<enablefields>pptpusername,pptppassword,pptplocalipaddress,pptplocalsubnet,pptpremoteipaddress,pptpdialondemand,pptpidletimeout
229
					</enablefields>
230
				</option>
231
			</options>
232
		</field>
233
		<field>
234
			<name>General configuration</name>
235
			<type>listtopic</type>
236
		</field>
237
		<field>
238
			<donotdisable>true</donotdisable>
239
			<name>MAC Address</name>
240
			<bindstofield>interfaces->wan->spoofmac</bindstofield>
241
			<type>input</type>
242
			<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>
243
			<validate>^([0-9a-f]{2}([:-]||$)){6}$</validate>
244
			<message>MAC Address field is invalid</message>
245
		</field>
246
		<field>
247
			<donotdisable>true</donotdisable>
248
			<name>MTU</name>
249
			<type>input</type>
250
			<bindstofield>interfaces->wan->mtu</bindstofield>
251
			<description> Set the MTU of the WAN interface. 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>
252
		</field>
253
		<field>
254
			<donotdisable>true</donotdisable>
255
			<name>MSS</name>
256
			<type>input</type>
257
			<bindstofield>interfaces->wan->mss</bindstofield>
258
			<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 MSS of 1492 bytes for PPPoE and 1500 bytes for all other connection types will be assumed. This should match the above MTU value in most all cases.</description>
259
		</field>
260
		<field>
261
			<name>Static IP Configuration</name>
262
			<type>listtopic</type>
263
		</field>
264
		<field>
265
			<name>IP Address</name>
266
			<bindstofield>interfaces->wan->ipaddr</bindstofield>
267
			<type>input</type>
268
			<typehint> / </typehint>
269
			<combinefieldsbegin>true</combinefieldsbegin>
270
			<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>
271
			<message>IP Address field is invalid</message>
272
		</field>
273
		<field>
274
			<combinefieldsend>true</combinefieldsend>
275
			<dontdisplayname>true</dontdisplayname>
276
			<dontcombinecells>true</dontcombinecells>
277
			<name>Subnet Mask</name>
278
			<bindstofield>interfaces->wan->subnet</bindstofield>
279
			<type>subnet_select</type>
280
		</field>
281
		<field>
282
			<name>Upstream Gateway</name>
283
			<bindstofield>wizardtemp->wangateway</bindstofield>
284
			<type>input</type>
285
			<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>
286
			<message>Gateway IP Address field is invalid</message>
287
		</field>
288
		<field>
289
			<name>DHCP client configuration</name>
290
			<type>listtopic</type>
291
		</field>
292
		<field>
293
			<name>DHCP Hostname</name>
294
			<type>input</type>
295
			<bindstofield>interfaces->wan->dhcphostname</bindstofield>
296
			<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>
297
		</field>
298
		<field>
299
			<name>PPPoE configuration</name>
300
			<type>listtopic</type>
301
		</field>
302
		<field>
303
			<name>PPPoE Username</name>
304
			<type>input</type>
305
			<bindstofield>wizardtemp->wan->username</bindstofield>
306
		</field>
307
		<field>
308
			<name>PPPoE Password</name>
309
			<type>input</type>
310
			<bindstofield>wizardtemp->wan->password</bindstofield>
311
		</field>
312
		<field>
313
			<name>PPPoE Service name</name>
314
			<type>input</type>
315
			<description>Hint: this field can usually be left empty</description>
316
			<bindstofield>wizardtemp->wan->provider</bindstofield>
317
		</field>
318
		<field>
319
			<name>PPPoE Dial on demand</name>
320
			<typehint>Enable Dial-On-Demand mode</typehint>
321
			<type>checkbox</type>
322
			<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>
323
			<bindstofield>wizardtemp->wan->ondemand</bindstofield>
324
		</field>
325
		<field>
326
			<name>PPPoE Idle timeout</name>
327
			<type>input</type>
328
			<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>
329
			<bindstofield>wizardtemp->wan->idletimeout</bindstofield>
330
		</field>
331
		<field>
332
			<name>PPTP configuration</name>
333
			<type>listtopic</type>
334
		</field>
335
		<field>
336
			<name>PPTP Username</name>
337
			<type>input</type>
338
			<bindstofield>wizardtemp->wan->pptpusername</bindstofield>
339
		</field>
340
		<field>
341
			<name>PPTP Password</name>
342
			<type>input</type>
343
			<bindstofield>wizardtemp->wan->pptppassword</bindstofield>
344
		</field>
345
		<field>
346
			<combinefieldsbegin>true</combinefieldsbegin>
347
			<name>PPTP Local IP Address</name>
348
			<type>input</type>
349
			<typehint> / </typehint>
350
			<bindstofield>wizardtemp->wan->localip</bindstofield>
351
			<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>
352
			<message>PPTP Local IP Address field is invalid</message>
353
		</field>
354
		<field>
355
			<combinefieldsend>true</combinefieldsend>
356
			<dontdisplayname>true</dontdisplayname>
357
			<dontcombinecells>true</dontcombinecells>
358
			<name>pptplocalsubnet</name>
359
			<bindstofield>wizardtemp->wan->subnet</bindstofield>
360
			<type>subnet_select</type>
361
		</field>
362
		<field>
363
			<name>PPTP Remote IP Address</name>
364
			<bindstofield>wizardtemp->wan->gateway</bindstofield>
365
			<type>input</type>
366
			<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>
367
			<message>PPTP Remote IP Address field is invalid</message>
368
		</field>
369
		<field>
370
			<name>PPTP Dial on demand</name>
371
			<typehint>Enable Dial-On-Demand mode</typehint>
372
			<type>checkbox</type>
373
			<bindstofield>wizardtemp->wan->pptpondemand</bindstofield>			
374
			<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>
375
		</field>
376
		<field>
377
			<name>PPTP Idle timeout</name>
378
			<type>input</type>			
379
			<bindstofield>wizardtemp->wan->pptpidletimeout</bindstofield>
380
			<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>
381
		</field>
382
		<field>
383
			<name>RFC1918 Networks</name>
384
			<type>listtopic</type>
385
		</field>
386
		<field>
387
			<donotdisable>true</donotdisable>
388
			<name>Block RFC1918 Private Networks</name>
389
			<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>
390
			<type>checkbox</type>
391
			<bindstofield>interfaces->wan->blockpriv</bindstofield>
392
			<typehint>Block private networks from entering via WAN</typehint>
393
		</field>
394
		<field>
395
			<name>Block bogon networks</name>
396
			<type>listtopic</type>
397
		</field>
398
		<field>
399
			<donotdisable>true</donotdisable>
400
			<name>Block bogon networks</name>
401
			<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>
402
			<type>checkbox</type>
403
			<bindstofield>interfaces->wan->blockbogons</bindstofield>
404
			<typehint>Block non-Internet routed networks from entering via WAN</typehint>
405
		</field>
406
		<field>
407
			<name>Next</name>
408
			<type>submit</type>
409
		</field>
410
	</fields>
411
	<stepbeforeformdisplay>
412
		<![CDATA[
413
		if (is_array($config['gateways']['gateway_item']))
414
			foreach ($config['gateways']['gateway_item'] as $gw)
415
				if ($gw['name'] == 'WANGW' || (!empty($config['wizardtemp']['wangateway']) && $gw['gateway'] == $config['wizardtemp']['wangateway']))
416
					$config['wizardtemp']['wangateway'] = $gw['gateway'];
417
		]]>
418
	</stepbeforeformdisplay>
419
	<stepsubmitphpaction>
420
		<![CDATA[
421
		if(!empty($_POST['mtu']) && ($_POST['mtu'] < 576)) {
422
			print_info_box_np("MTU Must be at least 576 (Per RFC 791). Please press back in your browser window and correct.");
423
			die;
424
		}
425
		if(!empty($_POST['macaddress']) && !is_macaddr($_POST['macaddress'])) {
426
			print_info_box_np("Invalid MAC Address. Please press back in your browser window and correct.");
427
			die;
428
		}
429
		if(!empty($_POST['ipaddress']) && ($_POST['selectedtype'] == "Static")) {
430
			if (!is_ipaddr($_POST['ipaddress'])) {
431
				print_info_box_np("Invalid WAN IP Address. Please press back in your browser window and correct.");
432
				die;
433
			}
434
			if ($_POST['subnetmask'] < 31 &&
435
			    ($_POST['ipaddress'] == gen_subnet($_POST['ipaddress'], $_POST['subnetmask']) ||
436
			     $_POST['ipaddress'] == gen_subnet_max($_POST['ipaddress'], $_POST['subnetmask']))) {
437
				print_info_box_np("Invalid WAN IP Address. Please press back in your browser window and correct.");
438
				die;
439
			}
440
		}
441
		if(!empty($_POST['dhcphostname']) && !is_hostname($_POST['dhcphostname'])) {
442
			print_info_box_np("Invalid DHCP Hostname. Please press back in your browser window and correct.");
443
			die;
444
		}
445
		if(!empty($_POST['pptplocalipaddress']) && !is_ipaddr($_POST['pptplocalipaddress'])) {
446
			print_info_box_np("Invalid PPTP Local IP Address. Please press back in your browser window and correct.");
447
			die;
448
		}
449
		if(!empty($_POST['pptpremoteipaddress']) && !is_ipaddr($_POST['pptpremoteipaddress'])) {
450
			print_info_box_np("Invalid PPTP Remopte IP Address. Please press back in your browser window and correct.");
451
			die;
452
		}
453
		$type = $_POST['selectedtype'];
454

    
455
		if (!is_array($config['ppps']['ppp']))
456
			$config['ppps']['ppp'] = array();
457
		if (count($config['ppps']['ppp'])) {
458
			foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
459
				if ($ppp['ptpid'] == "0") {
460
					if ((substr($config['interfaces']['wan']['if'],0,5) == "pppoe") || (substr($config['interfaces']['wan']['if'],0,4) == "pptp")) {
461
						$oldif = explode(",", $ppp['ports']);
462
						$config['interfaces']['wan']['if'] = $oldif[0];
463
					}
464
					if ($type == "pppoe" || $type == "pptp")
465
						unset($config['ppps']['ppp'][$pppid]);
466
				}
467
			}
468
		}
469

    
470
		if ($type == "pppoe" || $type == "pptp") {
471
			if ($type == "pptp") {
472
				$config['wizardtemp']['wan']['username'] = $config['wizardtemp']['wan']['pptpusername'];
473
				$config['wizardtemp']['wan']['password'] = $config['wizardtemp']['wan']['pptppassword'];
474
				$config['wizardtemp']['wan']['ondemand'] = $config['wizardtemp']['wan']['pptpondemand'];
475
				$config['wizardtemp']['wan']['idletimeout'] = $config['wizardtemp']['wan']['pptpidletimeout'];
476
				unset($config['wizardtemp']['wan']['pptpusername']);
477
				unset($config['wizardtemp']['wan']['pptppassword']);
478
				unset($config['wizardtemp']['wan']['pptpondemand']);
479
				unset($config['wizardtemp']['wan']['pptpidletimeout']);
480
			}
481
			$config['wizardtemp']['wan']['password'] = base64_encode($config['wizardtemp']['wan']['password']);
482
			$tmp = array();
483
			$tmp['ptpid'] = "0";
484
			$tmp['type'] = $type;
485
			$tmp['if'] = $type . "0";
486
			$tmp['ports'] = $config['interfaces']['wan']['if'];
487
			$config['ppps']['ppp'][] = array_merge($tmp, $config['wizardtemp']['wan']);
488
			unset($tmp);
489
			$config['interfaces']['wan']['if'] = $type."0";
490
		}
491
		unset($config['wizardtemp']['wan']);
492
		]]>
493
	</stepsubmitphpaction>
494
	<stepsubmitbeforesave>
495
		<![CDATA[
496
			if($_POST['selectedtype'] == "Static") { 
497
			
498
			} else {
499
				$_POST['ipaddress'] = $_POST['selectedtype'];
500
				$config['interfaces']['wan']['ipaddr'] = $_POST['selectedtype'];
501
				write_config();
502
				if(!$config['interfaces']['lan']) 
503
					header("Location: /wizard.php?xml=setup_wizard.xml&stepid=6&next=Next");
504
			}
505
		]]>
506
	</stepsubmitbeforesave>
507
</step>
508
<step>
509
	<id>6</id>
510
	<title>Configure LAN Interface</title>
511
	<description>On this screen we will configure the Local Area Network information.</description>
512
	<fields>
513
		<field>
514
			<name>LAN IP Address</name>
515
			<type>input</type>
516
			<bindstofield>interfaces->lan->ipaddr</bindstofield>
517
			<description>Type dhcp if this interface uses DHCP to obtain its IP address.</description>
518
			<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>
519
			<message>LAN IP Address field is invalid</message>
520
		</field>
521
				<field>
522
			<name>Subnet Mask</name>
523
			<type>subnet_select</type>
524
			<bindstofield>interfaces->lan->subnet</bindstofield>
525
		</field>
526
		<field>
527
			<name>Next</name>
528
			<type>submit</type>
529
		</field>
530
	</fields>
531
	<stepsubmitphpaction>
532
		<![CDATA[
533
		if(empty($_POST['lanipaddress']) || !is_ipaddr($_POST['lanipaddress'])) {
534
			print_info_box_np("Invalid LAN IP Address. Please press back in your browser window and correct.");
535
			die;
536
		}
537
		if ($_POST['subnetmask'] < 31 &&
538
		    ($_POST['lanipaddress'] == gen_subnet($_POST['lanipaddress'], $_POST['subnetmask']) ||
539
		     $_POST['lanipaddress'] == gen_subnet_max($_POST['lanipaddress'], $_POST['subnetmask']))) {
540
			print_info_box_np("Invalid LAN IP Address. Please press back in your browser window and correct.");
541
			die;
542
		}
543
		$ft = explode(".", $_POST['lanipaddress']);
544
		$ft_ip = $ft[0] . "." . $ft[1] . "." . $ft[2] . ".";
545
		$config['dhcpd']['lan']['range']['from'] = $ft_ip . "10";
546
		$highestip = gen_subnet_max($_POST['lanipaddress'], $config['interfaces']['lan']['subnet']);
547
		$hi = explode(".", $highestip);
548
		$highestip = $hi[3]-10;
549
		$config['dhcpd']['lan']['range']['to'] = $ft_ip . $highestip;
550
		]]>
551
	</stepsubmitphpaction>
552
</step>
553
<step>
554
	<id>7</id>
555
	<title>Set Admin WebGUI Password</title>
556
	<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>
557
	<fields>
558
		<field>
559
			<name>Admin Password</name>
560
			<type>password</type>
561
		</field>
562
		<field>
563
			<name>Admin Password AGAIN</name>
564
			<type>password</type>
565
		</field>
566
		<field>
567
			<name>Next</name>
568
			<type>submit</type>
569
		</field>
570
	</fields>
571
	<stepsubmitphpaction>
572
	if($_POST['adminpassword'] != "") {
573
		if($_POST['adminpassword'] == $_POST['adminpasswordagain']) {
574
			$admin_user =&amp; getUserEntryByUID(0);
575
			local_user_set_password($admin_user, $_POST['adminpassword']);
576
			local_user_set($admin_user);
577
			write_config();
578
		} else {
579
			print_info_box_np("Passwords do not match!  Please press back in your browser window and correct.");
580
			die;
581
		}
582
	}
583
	</stepsubmitphpaction>
584
</step>
585
<step>
586
	<id>8</id>
587
	<title>Reload configuration</title>
588
	<disableheader>true</disableheader>
589
	<description>Click 'Reload' to reload pfSense with new changes.</description>
590
	<fields>
591
		<field>
592
			<name>Reload</name>
593
			<type>submit</type>
594
		</field>
595
	</fields>
596
</step>
597
<step>
598
	<id>9</id>
599
	<title>Reload in progress</title>
600
	<description>
601
		A reload is now in progress.  Please wait. &lt;p&gt; 
602
		&lt;meta http-equiv="refresh" content="5; url=wizard.php?xml=setup_wizard.xml&amp;stepid=9" &gt;
603
		&lt;p&gt;
604
		The wizard will redirect to the next step once the reload is completed.
605
	</description>
606
	<stepafterformdisplay>
607
		<![CDATA[
608
		$config['system']['hostname'] = $config['wizardtemp']['system']['hostname'];
609
		$config['system']['domain'] = $config['wizardtemp']['system']['domain'];
610
		if (!empty($config['wizardtemp']['wangateway'])) {
611
			if (!is_array($config['gateways']['gateway_item']))
612
				$config['gateways']['gateway_item'] = array();
613
			$found = false;
614
			$defaultgw_found = false;
615
			foreach ($config['gateways']['gateway_item'] as & $gw) {
616
				if ($gw['interface'] != "wan")
617
					continue;
618
				if (isset($gw['defaultgw']))
619
					$defaultgw_found = true;
620
				if ($gw['name'] == 'WANGW' || (!empty($config['wizardtemp']['wangateway']) && $gw['gateway'] == $config['wizardtemp']['wangateway'])) {
621
					$found = true;
622
					$gw['gateway'] = $config['wizardtemp']['wangateway'];
623
					$config['interfaces']['wan']['gateway'] = $gw['name'];
624
				}
625
			}
626
			if (!$found) {
627
				$newgw = array();
628
				$newgw['interface'] = "wan";
629
				$newgw['gateway'] = $config['wizardtemp']['wangateway'];
630
				$newgw['name'] = "WANGW";
631
				$newgw['weight'] = 1;
632
				$newgw['descr'] = "WAN Gateway";
633
				$newgw['defaultgw'] = !$defaultgw_found;
634
				$config['gateways']['gateway_item'][] = $newgw;
635
				$config['interfaces']['wan']['gateway'] = "WANGW";
636
			}
637
		}
638
		unset($config['wizardtemp']);
639
		write_config();
640
		reload_all();
641
		mwexec_bg("/etc/rc.update_bogons.sh now");
642
		]]>
643
	</stepafterformdisplay>
644
</step>
645
<step>
646
	<id>10</id>
647
	<title>Wizard completed.</title>
648
	<stepbeforeformdisplay>
649
	<![CDATA[
650
		if($g['product_name'] <> 'pfSense') {
651
			header("Location: " . fixup_string("\$myurl"));
652
			exit;
653
		}	
654
	]]>
655
	</stepbeforeformdisplay>
656
	<description>
657
	<![CDATA[
658
		Congratulations!  pfSense is now configured.<p/>
659
		Please consider contributing back to the project!<p/>
660
		Click <a target='_new' href='https://www.pfsense.org/get-involved/index.html'>here</a> to purchase services offered by the pfSense team and find other ways to contribute.<p/>
661
		Click <a href='$myurl'>here</a> to continue on to pfSense webConfigurator.
662
	]]>
663
	</description>
664
</step>
665
</pfsensewizard>
(3-3/7)