Project

General

Profile

Download (22.7 KB) Statistics
| Branch: | Tag: | Revision:
1 7a23e419 Scott Ullrich
<?xml version="1.0" encoding="utf-8" ?>
2 e48fc17d Scott Ullrich
<pfsensewizard>
3 6aed3a2e Bill Marquette
<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 51b9e41d Scott Ullrich
<totalsteps>9</totalsteps>
35 19fd2947 Scott Ullrich
<step>
36
	<id>1</id>
37
	<title>pfSense Setup Wizard</title>
38 34b5c5a0 Scott Ullrich
	<disableheader>true</disableheader>
39 2a8143e5 Scott Ullrich
	<description>This wizard will guide you through the initial configuration of pfSense.</description>
40 19fd2947 Scott Ullrich
	<fields>
41 e48fc17d Scott Ullrich
		<field>
42
			<name>Next</name>
43
			<type>submit</type>
44
		</field>
45 19fd2947 Scott Ullrich
	</fields>
46 e2c8c1aa Scott Ullrich
	<stepbeforeformdisplay>
47 2131ed2f Scott Ullrich
		conf_mount_rw();
48
		unlink_if_exists('/conf/trigger_initial_wizard');
49
		conf_mount_ro();
50
	</stepbeforeformdisplay>
51 19fd2947 Scott Ullrich
</step>
52
<step>
53
	<id>2</id>
54 8773b899 Scott Ullrich
	<title>General Information</title>
55 22a11a58 Larry Gilbert
	<description>On this screen you will set the general pfSense parameters.</description>
56 8773b899 Scott Ullrich
	<fields>
57 4de543fa Scott Ullrich
		<field>
58
			<name>Hostname</name>
59
			<type>input</type>
60 0bee2010 Erik Fonnesbeck
			<bindstofield>wizardtemp->system->hostname</bindstofield>
61 4de543fa Scott Ullrich
			<description>EXAMPLE: myserver</description>
62 618e43ca jim-p
			<validate>^[a-z0-9.|-]+$</validate>
63
			<message>Invalid Hostname</message>
64 4de543fa Scott Ullrich
		</field>
65
		<field>
66
			<name>Domain</name>
67
			<type>input</type>
68 0bee2010 Erik Fonnesbeck
			<bindstofield>wizardtemp->system->domain</bindstofield>
69 4de543fa Scott Ullrich
			<description>EXAMPLE: mydomain.com</description>
70 f4da1ccd Scott Ullrich
			<validate>^[a-z0-9.|-]+$</validate>
71 6bb5c9aa Bill Marquette
			<message>Domain name field is invalid</message>
72 dd627071 Scott Ullrich
		</field>
73 8773b899 Scott Ullrich
		<field>
74
			<name>Primary DNS Server</name>
75
			<type>input</type>
76 e48fc17d Scott Ullrich
			<bindstofield>system->dnsserver</bindstofield>
77
			<!-- we must unset the fields because this is an array. -->
78
			<unsetfield>yes</unsetfield>
79 a8df0181 Scott Ullrich
			<arraynum>0</arraynum>
80 618e43ca jim-p
			<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 dd627071 Scott Ullrich
		</field>
83 8773b899 Scott Ullrich
		<field>
84
			<name>Secondary DNS Server</name>
85
			<type>input</type>
86 e48fc17d Scott Ullrich
			<bindstofield>system->dnsserver</bindstofield>
87 a8df0181 Scott Ullrich
			<arraynum>1</arraynum>
88 618e43ca jim-p
			<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 8773b899 Scott Ullrich
		</field>
91 f39fe79e Ermal Lu?i
		<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 8773b899 Scott Ullrich
		<field>
98
			<name>Next</name>
99
			<type>submit</type>
100
		</field>
101
	</fields>
102 0bee2010 Erik Fonnesbeck
	<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 618e43ca jim-p
	<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 dd627071 Scott Ullrich
</step>
131 8773b899 Scott Ullrich
<step>
132
	<id>3</id>
133 4de543fa Scott Ullrich
	<title>Time Server Information</title>
134 19fd2947 Scott Ullrich
	<description>Please enter the time, date and time zone.</description>
135
	<fields>
136 ac60cb51 Scott Ullrich
		<field>
137 703539b6 Chris Buechler
			<name>Time server hostname</name>
138
			<description>Enter the hostname (FQDN) of the time server.</description>
139 ac60cb51 Scott Ullrich
			<type>input</type>
140 4de543fa Scott Ullrich
			<bindstofield>system->timeservers</bindstofield>
141 ff93a5c1 jim-p
			<validate>^[a-z0-9.|-]+$</validate>
142
			<message>Invalid Time Server Field</message>
143 8773b899 Scott Ullrich
		</field>
144
		<field>
145
			<name>Timezone</name>
146 bd31336e Scott Ullrich
			<type>timezone_select</type>
147
			<bindstofield>system->timezone</bindstofield>
148 8773b899 Scott Ullrich
		</field>
149
		<field>
150
			<name>Next</name>
151
			<type>submit</type>
152 dd627071 Scott Ullrich
		</field>
153 19fd2947 Scott Ullrich
	</fields>
154 ff93a5c1 jim-p
	<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 19fd2947 Scott Ullrich
</step>
163 8773b899 Scott Ullrich
<step>
164
	<id>4</id>
165 34b5c5a0 Scott Ullrich
	<disableallfieldsbydefault>true</disableallfieldsbydefault>
166 e48fc17d Scott Ullrich
	<title>Configure WAN Interface</title>
167 8773b899 Scott Ullrich
	<description>On this screen we will configure the Wide Area Network information.</description>
168 34b5c5a0 Scott Ullrich
	<javascriptafterformdisplay>
169 ffe75109 Scott Ullrich
		var selectedItem = 0;
170
		if(document.forms[0].ipaddress.value == 'dhcp') {
171
			selectedItem = 1;
172
			document.forms[0].ipaddress.value = '';
173 389c778e gnhb
		} else if(document.forms[0].ipaddress.value == 'pppoe') {
174 ffe75109 Scott Ullrich
			selectedItem = 2;
175
			document.forms[0].ipaddress.value = '';
176 389c778e gnhb
		} else if(document.forms[0].ipaddress.value == 'pptp') {
177 ffe75109 Scott Ullrich
			selectedItem = 3;
178
			document.forms[0].ipaddress.value = '';
179 389c778e gnhb
		} else if(document.forms[0].ipaddress.value == 'ppp' || document.forms[0].ipaddress.value == 'l2tp') {
180 ffe75109 Scott Ullrich
			document.forms[0].ipaddress.value = '';
181
		} else {
182 dd627071 Scott Ullrich
			selectedItem = 0;
183 ffe75109 Scott Ullrich
		}
184 b1919dd0 Scott Ullrich
		document.forms[0].selectedtype.selectedIndex = selectedItem;
185 ffe75109 Scott Ullrich
		enableitems(selectedItem);
186 dd627071 Scott Ullrich
	</javascriptafterformdisplay>
187 8773b899 Scott Ullrich
	<fields>
188 dd627071 Scott Ullrich
		<field>
189 34b5c5a0 Scott Ullrich
			<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 dd627071 Scott Ullrich
				</option>
198 34b5c5a0 Scott Ullrich
				<option>
199
					<name>DHCP</name>
200
					<value>dhcp</value>
201 dd627071 Scott Ullrich
					<enablefields>dhcphostname</enablefields>
202 34b5c5a0 Scott Ullrich
				</option>
203
				<option>
204
					<name>PPPoE</name>
205 9e9a6bd1 Scott Ullrich
					<value>pppoe</value>
206 dd627071 Scott Ullrich
					<enablefields>pppoeusername,pppoepassword,pppoeservicename,pppoedialondemand,pppoeidletimeout</enablefields>
207 34b5c5a0 Scott Ullrich
				</option>
208
				<option>
209
					<name>PPTP</name>
210 9e9a6bd1 Scott Ullrich
					<value>pptp</value>
211 34b5c5a0 Scott Ullrich
					<enablefields>pptpusername,pptppassword,pptplocalipaddress,pptplocalsubnet,pptpremoteipaddress,pptpdialondemand,pptpidletimeout
212 dd627071 Scott Ullrich
					</enablefields>
213
				</option>
214 34b5c5a0 Scott Ullrich
			</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 22a11a58 Larry Gilbert
			<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 85ee0940 jim-p
			<validate>^([0-9a-f]{2}([:-]||$)){6}$</validate>
227
			<message>MAC Address field is invalid</message>
228 dd627071 Scott Ullrich
		</field>
229 8773b899 Scott Ullrich
		<field>
230 34b5c5a0 Scott Ullrich
			<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 4de543fa Scott Ullrich
			<bindstofield>interfaces->wan->ipaddr</bindstofield>
243 8773b899 Scott Ullrich
			<type>input</type>
244 34b5c5a0 Scott Ullrich
			<typehint> / </typehint>
245
			<combinefieldsbegin>true</combinefieldsbegin>
246 85ee0940 jim-p
			<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 8773b899 Scott Ullrich
		</field>
249
		<field>
250 34b5c5a0 Scott Ullrich
			<combinefieldsend>true</combinefieldsend>
251
			<dontdisplayname>true</dontdisplayname>
252 dd627071 Scott Ullrich
			<dontcombinecells>true</dontcombinecells>
253 8773b899 Scott Ullrich
			<name>Subnet Mask</name>
254 4de543fa Scott Ullrich
			<bindstofield>interfaces->wan->subnet</bindstofield>
255 bd31336e Scott Ullrich
			<type>subnet_select</type>
256 8773b899 Scott Ullrich
		</field>
257 34b5c5a0 Scott Ullrich
		<field>
258
			<name>Gateway</name>
259 e121bebd jim-p
			<bindstofield>wizardtemp->wangateway</bindstofield>
260 34b5c5a0 Scott Ullrich
			<type>input</type>
261 85ee0940 jim-p
			<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 dd627071 Scott Ullrich
		</field>
264 34b5c5a0 Scott Ullrich
		<field>
265
			<name>DHCP client configuration</name>
266
			<type>listtopic</type>
267 dd627071 Scott Ullrich
		</field>
268 34b5c5a0 Scott Ullrich
		<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 dd627071 Scott Ullrich
		</field>
278 34b5c5a0 Scott Ullrich
		<field>
279
			<name>PPPoE Username</name>
280
			<type>input</type>
281 389c778e gnhb
			<bindstofield>interfaces->tmp->username</bindstofield>
282 34b5c5a0 Scott Ullrich
		</field>
283
		<field>
284
			<name>PPPoE Password</name>
285
			<type>input</type>
286 389c778e gnhb
			<bindstofield>interfaces->tmp->password</bindstofield>
287 34b5c5a0 Scott Ullrich
		</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 389c778e gnhb
			<bindstofield>interfaces->tmp->provider</bindstofield>
293 34b5c5a0 Scott Ullrich
		</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 389c778e gnhb
			<bindstofield>interfaces->tmp->ondemand</bindstofield>
300 dd627071 Scott Ullrich
		</field>
301 34b5c5a0 Scott Ullrich
		<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 389c778e gnhb
			<bindstofield>interfaces->tmp->idletimeout</bindstofield>
306 34b5c5a0 Scott Ullrich
		</field>
307
		<field>
308
			<name>PPTP configuration</name>
309
			<type>listtopic</type>
310 dd627071 Scott Ullrich
		</field>
311 34b5c5a0 Scott Ullrich
		<field>
312
			<name>PPTP Username</name>
313
			<type>input</type>
314 389c778e gnhb
			<bindstofield>interfaces->tmp->pptpusername</bindstofield>
315 34b5c5a0 Scott Ullrich
		</field>
316
		<field>
317
			<name>PPTP Password</name>
318
			<type>input</type>
319 389c778e gnhb
			<bindstofield>interfaces->tmp->pptppassword</bindstofield>
320 34b5c5a0 Scott Ullrich
		</field>
321
		<field>
322
			<combinefieldsbegin>true</combinefieldsbegin>
323
			<name>PPTP Local IP Address</name>
324
			<type>input</type>
325
			<typehint> / </typehint>
326 389c778e gnhb
			<bindstofield>interfaces->tmp->localip</bindstofield>
327 85ee0940 jim-p
			<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 34b5c5a0 Scott Ullrich
		</field>
330
		<field>
331
			<combinefieldsend>true</combinefieldsend>
332
			<dontdisplayname>true</dontdisplayname>
333
			<dontcombinecells>true</dontcombinecells>
334
			<name>pptplocalsubnet</name>
335 389c778e gnhb
			<bindstofield>interfaces->tmp->subnet</bindstofield>
336 bd31336e Scott Ullrich
			<type>subnet_select</type>
337 34b5c5a0 Scott Ullrich
		</field>
338
		<field>
339
			<name>PPTP Remote IP Address</name>
340 389c778e gnhb
			<bindstofield>interfaces->tmp->gateway</bindstofield>
341 34b5c5a0 Scott Ullrich
			<type>input</type>
342 85ee0940 jim-p
			<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 34b5c5a0 Scott Ullrich
		</field>
345
		<field>
346
			<name>PPTP Dial on demand</name>
347
			<typehint>Enable Dial-On-Demand mode</typehint>
348
			<type>checkbox</type>
349 389c778e gnhb
			<bindstofield>interfaces->tmp->pptpondemand</bindstofield>			
350 34b5c5a0 Scott Ullrich
			<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 dd627071 Scott Ullrich
		</field>
352 34b5c5a0 Scott Ullrich
		<field>
353
			<name>PPTP Idle timeout</name>
354 ebfcc98d Scott Ullrich
			<type>input</type>			
355 389c778e gnhb
			<bindstofield>interfaces->tmp->pptpidletimeout</bindstofield>
356 34b5c5a0 Scott Ullrich
			<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 ca07f232 Scott Ullrich
		<field>
371
			<name>Block bogon networks</name>
372
			<type>listtopic</type>
373 2131ed2f Scott Ullrich
		</field>
374 ca07f232 Scott Ullrich
		<field>
375
			<donotdisable>true</donotdisable>
376
			<name>Block bogon networks</name>
377 22a11a58 Larry Gilbert
			<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 ca07f232 Scott Ullrich
			<type>checkbox</type>
379
			<bindstofield>interfaces->wan->blockbogons</bindstofield>
380 0119fc69 Scott Ullrich
			<typehint>Block non-Internet routed networks from entering via WAN</typehint>
381 2131ed2f Scott Ullrich
		</field>
382 8773b899 Scott Ullrich
		<field>
383
			<name>Next</name>
384
			<type>submit</type>
385 dd627071 Scott Ullrich
		</field>
386 8773b899 Scott Ullrich
	</fields>
387 389c778e gnhb
	<stepbeforeformdisplay>
388
		<![CDATA[
389
		$config['interfaces']['tmp'] = array();
390 e121bebd jim-p
391
		if (is_array($config['gateways']['gateway_item']))
392
			foreach ($config['gateways']['gateway_item'] as $gw)
393
				if ($gw['name'] == 'WANGW')
394
					$config['wizardtemp']['wangateway'] = $gw['gateway'];
395 389c778e gnhb
		]]>
396
	</stepbeforeformdisplay>
397 5fe3b651 jim-p
	<stepsubmitphpaction>
398
		<![CDATA[
399 85ee0940 jim-p
		if(!empty($_POST['mtu']) && ($_POST['mtu'] < 576)) {
400
			print_info_box_np("MTU Must be at least 576 (Per RFC 791). Please press back in your browser window and correct.");
401
			die;
402
		}
403
		if(!empty($_POST['macaddress']) && !is_macaddr($_POST['macaddress'])) {
404
			print_info_box_np("Invalid MAC Address. Please press back in your browser window and correct.");
405
			die;
406
		}
407
		if(!empty($_POST['ipaddress']) && ($_POST['selectedtype'] == "Static") && (!is_ipaddr($_POST['ipaddress']))) {
408
			print_info_box_np("Invalid WAN IP Address. Please press back in your browser window and correct.");
409
			die;
410
		}
411
		if(!empty($_POST['dhcphostname']) && !is_hostname($_POST['dhcphostname'])) {
412
			print_info_box_np("Invalid DHCP Hostname. Please press back in your browser window and correct.");
413
			die;
414
		}
415
		if(!empty($_POST['pptplocalipaddress']) && !is_ipaddr($_POST['pptplocalipaddress'])) {
416
			print_info_box_np("Invalid PPTP Local IP Address. Please press back in your browser window and correct.");
417
			die;
418
		}
419
		if(!empty($_POST['pptpremoteipaddress']) && !is_ipaddr($_POST['pptpremoteipaddress'])) {
420
			print_info_box_np("Invalid PPTP Remopte IP Address. Please press back in your browser window and correct.");
421
			die;
422 5fe3b651 jim-p
		}
423 389c778e gnhb
		$type = $_POST['selectedtype'];
424
		if ($type == "pppoe" || $type == "pptp") {
425
			if (!is_array($config['ppps']['ppp']))
426
				$config['ppps']['ppp'] = array();
427
			if (count($config['ppps']['ppp'])) {
428
				foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
429
					if ($ppp['ptpid'] == "0") {
430
						unset($config['ppps']['ppp'][$pppid]);
431
						// break;
432
					}
433
					
434
				}
435
			}
436
			if ($type == "pptp") {
437
				$config['interfaces']['tmp']['username'] = $config['interfaces']['tmp']['pptpusername'];
438
				$config['interfaces']['tmp']['password'] = $config['interfaces']['tmp']['pptppassword'];
439
				$config['interfaces']['tmp']['ondemand'] = $config['interfaces']['tmp']['pptpondemand'];
440
				$config['interfaces']['tmp']['idletimeout'] = $config['interfaces']['tmp']['pptpidletimeout'];
441
				unset($config['interfaces']['tmp']['pptpusername']);
442
				unset($config['interfaces']['tmp']['pptppassword']);
443
				unset($config['interfaces']['tmp']['pptpondemand']);
444
				unset($config['interfaces']['tmp']['pptpidletimeout']);
445
			}
446
			$config['interfaces']['tmp']['password'] = base64_encode($config['interfaces']['tmp']['password']);
447
			$tmp = array();
448
			$tmp['ptpid'] = "0";
449
			$tmp['type'] = $type;
450
			$tmp['if'] = $type . "0";
451
			$tmp['ports'] = $config['interfaces']['wan']['if'];
452
			$config['ppps']['ppp'][] = array_merge($tmp, $config['interfaces']['tmp']);
453
			unset($tmp);
454
			$config['interfaces']['wan']['if'] = $type."0";
455
		}
456
		unset($config['interfaces']['tmp']);
457 5fe3b651 jim-p
		]]>
458
	</stepsubmitphpaction>
459 b1919dd0 Scott Ullrich
	<stepsubmitbeforesave>
460 fa6a664d sullrich
		<![CDATA[
461
			if($_POST['selectedtype'] == "Static") { 
462
			
463
			} else {
464
				$_POST['ipaddress'] = $_POST['selectedtype'];
465
				$config['interfaces']['wan']['ipaddr'] = $_POST['selectedtype'];
466
				write_config();
467
				if(!$config['interfaces']['lan']) 
468 95dd7e9d sullrich
					Header("Location: /wizard.php?xml=setup_wizard.xml&stepid=5&next=Next");
469 fa6a664d sullrich
			}
470
		]]>
471 b1919dd0 Scott Ullrich
	</stepsubmitbeforesave>
472 8773b899 Scott Ullrich
</step>
473
<step>
474
	<id>5</id>
475 e48fc17d Scott Ullrich
	<title>Configure LAN Interface</title>
476 8773b899 Scott Ullrich
	<description>On this screen we will configure the Local Area Network information.</description>
477
	<fields>
478
		<field>
479 e48fc17d Scott Ullrich
			<name>LAN IP Address</name>
480 8773b899 Scott Ullrich
			<type>input</type>
481 4de543fa Scott Ullrich
			<bindstofield>interfaces->lan->ipaddr</bindstofield>
482 eb29fd9b Chris Buechler
			<description>Type dhcp if this interface uses DHCP to obtain its IP address.</description>
483 85ee0940 jim-p
			<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>
484
			<message>LAN IP Address field is invalid</message>
485 8773b899 Scott Ullrich
		</field>
486
				<field>
487
			<name>Subnet Mask</name>
488 4aea0386 Scott Ullrich
			<type>subnet_select</type>
489 4de543fa Scott Ullrich
			<bindstofield>interfaces->lan->subnet</bindstofield>
490 8773b899 Scott Ullrich
		</field>
491 4de543fa Scott Ullrich
		<field>
492
			<name>Next</name>
493
			<type>submit</type>
494 dd627071 Scott Ullrich
		</field>
495 8773b899 Scott Ullrich
	</fields>
496 4aea0386 Scott Ullrich
	<stepsubmitphpaction>
497 85ee0940 jim-p
		<![CDATA[
498
		if(empty($_POST['lanipaddress']) || !is_ipaddr($_POST['lanipaddress'])) {
499
			print_info_box_np("Invalid LAN IP Address. Please press back in your browser window and correct.");
500
			die;
501
		}
502 f63becab Scott Ullrich
		$ft = split("\.", $_POST['lanipaddress']);
503 4aea0386 Scott Ullrich
		$ft_ip = $ft[0] . "." . $ft[1] . "." . $ft[2] . ".";
504 735ab270 Seth Mos
		$config['dhcpd']['lan']['range']['from'] = $ft_ip . "10";
505 f63becab Scott Ullrich
		$highestip = gen_subnet_max($_POST['lanipaddress'], $config['interfaces']['lan']['subnet']);
506 97737adf Scott Ullrich
		$hi = split("\.", $highestip);
507 735ab270 Seth Mos
		$highestip = $hi[3]-10;
508 97737adf Scott Ullrich
		$config['dhcpd']['lan']['range']['to'] = $ft_ip . $highestip;
509 85ee0940 jim-p
		]]>
510 4aea0386 Scott Ullrich
	</stepsubmitphpaction>
511 8773b899 Scott Ullrich
</step>
512
<step>
513
	<id>6</id>
514 cc0ef90e Scott Ullrich
	<title>Set Admin WebGUI Password</title>
515 22a11a58 Larry Gilbert
	<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>
516 8773b899 Scott Ullrich
	<fields>
517
		<field>
518 25a4bcd2 Scott Ullrich
			<name>Admin Password</name>
519 8773b899 Scott Ullrich
			<type>password</type>
520
		</field>
521 4de543fa Scott Ullrich
		<field>
522 25a4bcd2 Scott Ullrich
			<name>Admin Password AGAIN</name>
523 4de543fa Scott Ullrich
			<type>password</type>
524
		</field>
525 8773b899 Scott Ullrich
		<field>
526
			<name>Next</name>
527
			<type>submit</type>
528 dd627071 Scott Ullrich
		</field>
529 8773b899 Scott Ullrich
	</fields>
530 3ed807e4 Scott Ullrich
	<stepsubmitphpaction>
531
	if($_POST['adminpassword'] != "") {
532
		if($_POST['adminpassword'] == $_POST['adminpasswordagain']) {
533 0b31cf3e Matthew Grooms
			$admin_user =&amp; getUserEntryByUID(0);
534
			local_user_set_password($admin_user, $_POST['adminpassword']);
535
			local_user_set($admin_user);
536 3ed807e4 Scott Ullrich
			write_config();
537
		} else {
538
			print_info_box_np("Passwords do not match!  Please press back in your browser window and correct.");
539
			die;
540
		}
541
	}
542
	</stepsubmitphpaction>
543 8773b899 Scott Ullrich
</step>
544
<step>
545
	<id>7</id>
546 2e1c1991 Scott Ullrich
	<title>Reload configuration</title>
547 34b5c5a0 Scott Ullrich
	<disableheader>true</disableheader>
548 7a23e419 Scott Ullrich
	<description>Click 'Reload' to reload pfSense with new changes.  If you changed the password, pfSense will ask you to log in again.</description>
549 8773b899 Scott Ullrich
	<fields>
550
		<field>
551 2e1c1991 Scott Ullrich
			<name>Reload</name>
552 8773b899 Scott Ullrich
			<type>submit</type>
553
		</field>
554
	</fields>
555 4de543fa Scott Ullrich
</step>
556
<step>
557 cc0ef90e Scott Ullrich
	<id>8</id>
558 0b1138de Scott Ullrich
	<title>Reload in progress</title>
559 51b9e41d Scott Ullrich
	<description>
560
		A reload is now in progress.  Please wait. &lt;p&gt; 
561
		&lt;meta http-equiv="refresh" content="60; url=wizard.php?xml=setup_wizard.xml&amp;stepid=8" &gt;
562
		&lt;p&gt;
563
		The wizard will redirect to the next step once the reload is completed.
564
	</description>
565 34b5c5a0 Scott Ullrich
	<stepafterformdisplay>
566 e121bebd jim-p
		<![CDATA[
567 0bee2010 Erik Fonnesbeck
		$config['system']['hostname'] = $config['wizardtemp']['system']['hostname'];
568
		$config['system']['domain'] = $config['wizardtemp']['system']['domain'];
569 566193a5 jim-p
		if (!empty($config['wizardtemp']['wangateway'])) {
570
			if (!is_array($config['gateways']['gateway_item']))
571
				$config['gateways']['gateway_item'] = array();
572
			$found = false;
573
			foreach ($config['gateways']['gateway_item'] as & $gw) {
574
				if ($gw['name'] == 'WANGW') {
575
					$found = true;
576
					$gw['gateway'] = $config['wizardtemp']['wangateway'];
577
				}
578 e121bebd jim-p
			}
579 566193a5 jim-p
			if (!$found) {
580
				$newgw = array();
581
				$newgw['interface'] = "wan";
582
				$newgw['gateway'] = $config['wizardtemp']['wangateway'];
583
				$newgw['name'] = "WANGW";
584
				$newgw['weight'] = 1;
585
				$newgw['descr'] = "WAN Gateway";
586
				$newgw['defaultgw'] = true;
587
				$config['gateways']['gateway_item'][] = $newgw;
588
			}
589
			$config['interfaces']['wan']['gateway'] = "WANGW";
590 e121bebd jim-p
		}
591 0bee2010 Erik Fonnesbeck
		unset($config['wizardtemp']);
592
		write_config();
593 44a4d54d jim-p
		interface_reconfigure("wan");
594
		interface_reconfigure("lan");
595 eb06ca8e Scott Ullrich
		reload_all();
596 e121bebd jim-p
		mwexec_bg("/etc/rc.update_bogons.sh now");
597
		]]>
598 dd627071 Scott Ullrich
	</stepafterformdisplay>
599 8773b899 Scott Ullrich
</step>
600 51b9e41d Scott Ullrich
<step>
601
	<id>9</id>
602
	<title>Wizard completed.</title>
603 b148ab81 Scott Ullrich
	<stepbeforeformdisplay>
604
	<![CDATA[
605
		if($g['product_name'] <> 'pfSense') {
606
			Header("Location: $myurl");
607
			exit;
608
		}	
609
	]]>
610
	</stepbeforeformdisplay>
611 51b9e41d Scott Ullrich
	<description>
612
	<![CDATA[
613
		Congratulations!  pfSense is now configured.<p/>
614
		Please consider donating to the project to help us with our overheads costs.<p/>
615
		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/>
616
		Click <a href='$myurl'>here</a> to continue on to pfSense webConfigurator.
617
	]]>
618
	</description>
619
</step>
620 6bb5c9aa Bill Marquette
</pfsensewizard>