Project

General

Profile

Download (24.4 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 c7281770 Chris Buechler
        part of pfSense (https://www.pfsense.org/)
8 6aed3a2e Bill Marquette
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 5dc0c7b1 jim-p
	<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 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 8773b899 Scott Ullrich
		</field>
142
		<field>
143
			<name>Timezone</name>
144 bd31336e Scott Ullrich
			<type>timezone_select</type>
145
			<bindstofield>system->timezone</bindstofield>
146 8773b899 Scott Ullrich
		</field>
147
		<field>
148
			<name>Next</name>
149
			<type>submit</type>
150 dd627071 Scott Ullrich
		</field>
151 19fd2947 Scott Ullrich
	</fields>
152 ff93a5c1 jim-p
	<stepsubmitphpaction>
153
		<![CDATA[
154 a338d381 jim-p
		foreach (explode(' ', $_POST['timeserverhostname']) as $ts) {
155
			if (!is_domain($ts)) {
156
				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."));
157
				die;
158
			}
159 ff93a5c1 jim-p
		}
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 b36aad25 Phillip Davis
					<enablefields>ipaddress,subnetmask,upstreamgateway</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 a6c03297 Chris Buechler
			<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>
235
		</field>
236
		<field>
237
			<donotdisable>true</donotdisable>
238
			<name>MSS</name>
239
			<type>input</type>
240
			<bindstofield>interfaces->wan->mss</bindstofield>
241
			<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>
242 34b5c5a0 Scott Ullrich
		</field>
243
		<field>
244
			<name>Static IP Configuration</name>
245
			<type>listtopic</type>
246
		</field>
247
		<field>
248
			<name>IP Address</name>
249 4de543fa Scott Ullrich
			<bindstofield>interfaces->wan->ipaddr</bindstofield>
250 8773b899 Scott Ullrich
			<type>input</type>
251 34b5c5a0 Scott Ullrich
			<typehint> / </typehint>
252
			<combinefieldsbegin>true</combinefieldsbegin>
253 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>
254
			<message>IP Address field is invalid</message>
255 8773b899 Scott Ullrich
		</field>
256
		<field>
257 34b5c5a0 Scott Ullrich
			<combinefieldsend>true</combinefieldsend>
258
			<dontdisplayname>true</dontdisplayname>
259 dd627071 Scott Ullrich
			<dontcombinecells>true</dontcombinecells>
260 8773b899 Scott Ullrich
			<name>Subnet Mask</name>
261 4de543fa Scott Ullrich
			<bindstofield>interfaces->wan->subnet</bindstofield>
262 bd31336e Scott Ullrich
			<type>subnet_select</type>
263 8773b899 Scott Ullrich
		</field>
264 34b5c5a0 Scott Ullrich
		<field>
265 b36aad25 Phillip Davis
			<name>Upstream Gateway</name>
266 e121bebd jim-p
			<bindstofield>wizardtemp->wangateway</bindstofield>
267 34b5c5a0 Scott Ullrich
			<type>input</type>
268 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>
269
			<message>Gateway IP Address field is invalid</message>
270 dd627071 Scott Ullrich
		</field>
271 34b5c5a0 Scott Ullrich
		<field>
272
			<name>DHCP client configuration</name>
273
			<type>listtopic</type>
274 dd627071 Scott Ullrich
		</field>
275 34b5c5a0 Scott Ullrich
		<field>
276
			<name>DHCP Hostname</name>
277
			<type>input</type>
278
			<bindstofield>interfaces->wan->dhcphostname</bindstofield>
279
			<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>
280
		</field>
281
		<field>
282
			<name>PPPoE configuration</name>
283
			<type>listtopic</type>
284 dd627071 Scott Ullrich
		</field>
285 34b5c5a0 Scott Ullrich
		<field>
286
			<name>PPPoE Username</name>
287
			<type>input</type>
288 43d8f1cc Ermal
			<bindstofield>wizardtemp->wan->username</bindstofield>
289 34b5c5a0 Scott Ullrich
		</field>
290
		<field>
291
			<name>PPPoE Password</name>
292
			<type>input</type>
293 43d8f1cc Ermal
			<bindstofield>wizardtemp->wan->password</bindstofield>
294 34b5c5a0 Scott Ullrich
		</field>
295
		<field>
296
			<name>PPPoE Service name</name>
297
			<type>input</type>
298
			<description>Hint: this field can usually be left empty</description>
299 43d8f1cc Ermal
			<bindstofield>wizardtemp->wan->provider</bindstofield>
300 34b5c5a0 Scott Ullrich
		</field>
301
		<field>
302
			<name>PPPoE Dial on demand</name>
303
			<typehint>Enable Dial-On-Demand mode</typehint>
304
			<type>checkbox</type>
305
			<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>
306 43d8f1cc Ermal
			<bindstofield>wizardtemp->wan->ondemand</bindstofield>
307 dd627071 Scott Ullrich
		</field>
308 34b5c5a0 Scott Ullrich
		<field>
309
			<name>PPPoE Idle timeout</name>
310
			<type>input</type>
311
			<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>
312 43d8f1cc Ermal
			<bindstofield>wizardtemp->wan->idletimeout</bindstofield>
313 34b5c5a0 Scott Ullrich
		</field>
314
		<field>
315
			<name>PPTP configuration</name>
316
			<type>listtopic</type>
317 dd627071 Scott Ullrich
		</field>
318 34b5c5a0 Scott Ullrich
		<field>
319
			<name>PPTP Username</name>
320
			<type>input</type>
321 43d8f1cc Ermal
			<bindstofield>wizardtemp->wan->pptpusername</bindstofield>
322 34b5c5a0 Scott Ullrich
		</field>
323
		<field>
324
			<name>PPTP Password</name>
325
			<type>input</type>
326 43d8f1cc Ermal
			<bindstofield>wizardtemp->wan->pptppassword</bindstofield>
327 34b5c5a0 Scott Ullrich
		</field>
328
		<field>
329
			<combinefieldsbegin>true</combinefieldsbegin>
330
			<name>PPTP Local IP Address</name>
331
			<type>input</type>
332
			<typehint> / </typehint>
333 43d8f1cc Ermal
			<bindstofield>wizardtemp->wan->localip</bindstofield>
334 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>
335
			<message>PPTP Local IP Address field is invalid</message>
336 34b5c5a0 Scott Ullrich
		</field>
337
		<field>
338
			<combinefieldsend>true</combinefieldsend>
339
			<dontdisplayname>true</dontdisplayname>
340
			<dontcombinecells>true</dontcombinecells>
341
			<name>pptplocalsubnet</name>
342 43d8f1cc Ermal
			<bindstofield>wizardtemp->wan->subnet</bindstofield>
343 bd31336e Scott Ullrich
			<type>subnet_select</type>
344 34b5c5a0 Scott Ullrich
		</field>
345
		<field>
346
			<name>PPTP Remote IP Address</name>
347 43d8f1cc Ermal
			<bindstofield>wizardtemp->wan->gateway</bindstofield>
348 34b5c5a0 Scott Ullrich
			<type>input</type>
349 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>
350
			<message>PPTP Remote IP Address field is invalid</message>
351 34b5c5a0 Scott Ullrich
		</field>
352
		<field>
353
			<name>PPTP Dial on demand</name>
354
			<typehint>Enable Dial-On-Demand mode</typehint>
355
			<type>checkbox</type>
356 43d8f1cc Ermal
			<bindstofield>wizardtemp->wan->pptpondemand</bindstofield>			
357 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>
358 dd627071 Scott Ullrich
		</field>
359 34b5c5a0 Scott Ullrich
		<field>
360
			<name>PPTP Idle timeout</name>
361 ebfcc98d Scott Ullrich
			<type>input</type>			
362 43d8f1cc Ermal
			<bindstofield>wizardtemp->wan->pptpidletimeout</bindstofield>
363 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>
364
		</field>
365
		<field>
366
			<name>RFC1918 Networks</name>
367
			<type>listtopic</type>
368
		</field>
369
		<field>
370
			<donotdisable>true</donotdisable>
371
			<name>Block RFC1918 Private Networks</name>
372
			<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>
373
			<type>checkbox</type>
374
			<bindstofield>interfaces->wan->blockpriv</bindstofield>
375
			<typehint>Block private networks from entering via WAN</typehint>
376
		</field>
377 ca07f232 Scott Ullrich
		<field>
378
			<name>Block bogon networks</name>
379
			<type>listtopic</type>
380 2131ed2f Scott Ullrich
		</field>
381 ca07f232 Scott Ullrich
		<field>
382
			<donotdisable>true</donotdisable>
383
			<name>Block bogon networks</name>
384 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>
385 ca07f232 Scott Ullrich
			<type>checkbox</type>
386
			<bindstofield>interfaces->wan->blockbogons</bindstofield>
387 0119fc69 Scott Ullrich
			<typehint>Block non-Internet routed networks from entering via WAN</typehint>
388 2131ed2f Scott Ullrich
		</field>
389 8773b899 Scott Ullrich
		<field>
390
			<name>Next</name>
391
			<type>submit</type>
392 dd627071 Scott Ullrich
		</field>
393 8773b899 Scott Ullrich
	</fields>
394 389c778e gnhb
	<stepbeforeformdisplay>
395
		<![CDATA[
396 e121bebd jim-p
		if (is_array($config['gateways']['gateway_item']))
397
			foreach ($config['gateways']['gateway_item'] as $gw)
398 004c1412 Renato Botelho
				if ($gw['name'] == 'WANGW' || (!empty($config['wizardtemp']['wangateway']) && $gw['gateway'] == $config['wizardtemp']['wangateway']))
399 e121bebd jim-p
					$config['wizardtemp']['wangateway'] = $gw['gateway'];
400 389c778e gnhb
		]]>
401
	</stepbeforeformdisplay>
402 5fe3b651 jim-p
	<stepsubmitphpaction>
403
		<![CDATA[
404 85ee0940 jim-p
		if(!empty($_POST['mtu']) && ($_POST['mtu'] < 576)) {
405
			print_info_box_np("MTU Must be at least 576 (Per RFC 791). Please press back in your browser window and correct.");
406
			die;
407
		}
408
		if(!empty($_POST['macaddress']) && !is_macaddr($_POST['macaddress'])) {
409
			print_info_box_np("Invalid MAC Address. Please press back in your browser window and correct.");
410
			die;
411
		}
412 20dda766 Renato Botelho
		if(!empty($_POST['ipaddress']) && ($_POST['selectedtype'] == "Static")) {
413
			if (!is_ipaddr($_POST['ipaddress'])) {
414
				print_info_box_np("Invalid WAN IP Address. Please press back in your browser window and correct.");
415
				die;
416
			}
417
			if ($_POST['subnetmask'] < 31 &&
418
			    ($_POST['ipaddress'] == gen_subnet($_POST['ipaddress'], $_POST['subnetmask']) ||
419
			     $_POST['ipaddress'] == gen_subnet_max($_POST['ipaddress'], $_POST['subnetmask']))) {
420
				print_info_box_np("Invalid WAN IP Address. Please press back in your browser window and correct.");
421
				die;
422
			}
423 85ee0940 jim-p
		}
424
		if(!empty($_POST['dhcphostname']) && !is_hostname($_POST['dhcphostname'])) {
425
			print_info_box_np("Invalid DHCP Hostname. Please press back in your browser window and correct.");
426
			die;
427
		}
428
		if(!empty($_POST['pptplocalipaddress']) && !is_ipaddr($_POST['pptplocalipaddress'])) {
429
			print_info_box_np("Invalid PPTP Local IP Address. Please press back in your browser window and correct.");
430
			die;
431
		}
432
		if(!empty($_POST['pptpremoteipaddress']) && !is_ipaddr($_POST['pptpremoteipaddress'])) {
433
			print_info_box_np("Invalid PPTP Remopte IP Address. Please press back in your browser window and correct.");
434
			die;
435 5fe3b651 jim-p
		}
436 389c778e gnhb
		$type = $_POST['selectedtype'];
437 8678130d jim-p
438 d3ce6a8b jim-p
		if (!is_array($config['ppps']['ppp']))
439
			$config['ppps']['ppp'] = array();
440
		if (count($config['ppps']['ppp'])) {
441
			foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
442
				if ($ppp['ptpid'] == "0") {
443
					if ((substr($config['interfaces']['wan']['if'],0,5) == "pppoe") || (substr($config['interfaces']['wan']['if'],0,4) == "pptp")) {
444
						$oldif = explode(",", $ppp['ports']);
445
						$config['interfaces']['wan']['if'] = $oldif[0];
446
					}
447
					if ($type == "pppoe" || $type == "pptp")
448
						unset($config['ppps']['ppp'][$pppid]);
449
				}
450
			}
451 8678130d jim-p
		}
452
453
		if ($type == "pppoe" || $type == "pptp") {
454 389c778e gnhb
			if ($type == "pptp") {
455 43d8f1cc Ermal
				$config['wizardtemp']['wan']['username'] = $config['wizardtemp']['wan']['pptpusername'];
456
				$config['wizardtemp']['wan']['password'] = $config['wizardtemp']['wan']['pptppassword'];
457
				$config['wizardtemp']['wan']['ondemand'] = $config['wizardtemp']['wan']['pptpondemand'];
458
				$config['wizardtemp']['wan']['idletimeout'] = $config['wizardtemp']['wan']['pptpidletimeout'];
459
				unset($config['wizardtemp']['wan']['pptpusername']);
460
				unset($config['wizardtemp']['wan']['pptppassword']);
461
				unset($config['wizardtemp']['wan']['pptpondemand']);
462
				unset($config['wizardtemp']['wan']['pptpidletimeout']);
463 389c778e gnhb
			}
464 43d8f1cc Ermal
			$config['wizardtemp']['wan']['password'] = base64_encode($config['wizardtemp']['wan']['password']);
465 389c778e gnhb
			$tmp = array();
466
			$tmp['ptpid'] = "0";
467
			$tmp['type'] = $type;
468
			$tmp['if'] = $type . "0";
469
			$tmp['ports'] = $config['interfaces']['wan']['if'];
470 43d8f1cc Ermal
			$config['ppps']['ppp'][] = array_merge($tmp, $config['wizardtemp']['wan']);
471 389c778e gnhb
			unset($tmp);
472
			$config['interfaces']['wan']['if'] = $type."0";
473
		}
474 43d8f1cc Ermal
		unset($config['wizardtemp']['wan']);
475 5fe3b651 jim-p
		]]>
476
	</stepsubmitphpaction>
477 b1919dd0 Scott Ullrich
	<stepsubmitbeforesave>
478 fa6a664d sullrich
		<![CDATA[
479
			if($_POST['selectedtype'] == "Static") { 
480
			
481
			} else {
482
				$_POST['ipaddress'] = $_POST['selectedtype'];
483
				$config['interfaces']['wan']['ipaddr'] = $_POST['selectedtype'];
484
				write_config();
485
				if(!$config['interfaces']['lan']) 
486 95dd7e9d sullrich
					Header("Location: /wizard.php?xml=setup_wizard.xml&stepid=5&next=Next");
487 fa6a664d sullrich
			}
488
		]]>
489 b1919dd0 Scott Ullrich
	</stepsubmitbeforesave>
490 8773b899 Scott Ullrich
</step>
491
<step>
492
	<id>5</id>
493 e48fc17d Scott Ullrich
	<title>Configure LAN Interface</title>
494 8773b899 Scott Ullrich
	<description>On this screen we will configure the Local Area Network information.</description>
495
	<fields>
496
		<field>
497 e48fc17d Scott Ullrich
			<name>LAN IP Address</name>
498 8773b899 Scott Ullrich
			<type>input</type>
499 4de543fa Scott Ullrich
			<bindstofield>interfaces->lan->ipaddr</bindstofield>
500 eb29fd9b Chris Buechler
			<description>Type dhcp if this interface uses DHCP to obtain its IP address.</description>
501 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>
502
			<message>LAN IP Address field is invalid</message>
503 8773b899 Scott Ullrich
		</field>
504
				<field>
505
			<name>Subnet Mask</name>
506 4aea0386 Scott Ullrich
			<type>subnet_select</type>
507 4de543fa Scott Ullrich
			<bindstofield>interfaces->lan->subnet</bindstofield>
508 8773b899 Scott Ullrich
		</field>
509 4de543fa Scott Ullrich
		<field>
510
			<name>Next</name>
511
			<type>submit</type>
512 dd627071 Scott Ullrich
		</field>
513 8773b899 Scott Ullrich
	</fields>
514 4aea0386 Scott Ullrich
	<stepsubmitphpaction>
515 85ee0940 jim-p
		<![CDATA[
516
		if(empty($_POST['lanipaddress']) || !is_ipaddr($_POST['lanipaddress'])) {
517
			print_info_box_np("Invalid LAN IP Address. Please press back in your browser window and correct.");
518 20dda766 Renato Botelho
			die;
519
		}
520
		if ($_POST['subnetmask'] < 31 &&
521
		    ($_POST['lanipaddress'] == gen_subnet($_POST['lanipaddress'], $_POST['subnetmask']) ||
522
		     $_POST['lanipaddress'] == gen_subnet_max($_POST['lanipaddress'], $_POST['subnetmask']))) {
523
			print_info_box_np("Invalid LAN IP Address. Please press back in your browser window and correct.");
524 85ee0940 jim-p
			die;
525
		}
526 2ce660ad smos
		$ft = explode(".", $_POST['lanipaddress']);
527 4aea0386 Scott Ullrich
		$ft_ip = $ft[0] . "." . $ft[1] . "." . $ft[2] . ".";
528 735ab270 Seth Mos
		$config['dhcpd']['lan']['range']['from'] = $ft_ip . "10";
529 f63becab Scott Ullrich
		$highestip = gen_subnet_max($_POST['lanipaddress'], $config['interfaces']['lan']['subnet']);
530 2ce660ad smos
		$hi = explode(".", $highestip);
531 735ab270 Seth Mos
		$highestip = $hi[3]-10;
532 97737adf Scott Ullrich
		$config['dhcpd']['lan']['range']['to'] = $ft_ip . $highestip;
533 85ee0940 jim-p
		]]>
534 4aea0386 Scott Ullrich
	</stepsubmitphpaction>
535 8773b899 Scott Ullrich
</step>
536
<step>
537
	<id>6</id>
538 cc0ef90e Scott Ullrich
	<title>Set Admin WebGUI Password</title>
539 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>
540 8773b899 Scott Ullrich
	<fields>
541
		<field>
542 25a4bcd2 Scott Ullrich
			<name>Admin Password</name>
543 8773b899 Scott Ullrich
			<type>password</type>
544
		</field>
545 4de543fa Scott Ullrich
		<field>
546 25a4bcd2 Scott Ullrich
			<name>Admin Password AGAIN</name>
547 4de543fa Scott Ullrich
			<type>password</type>
548
		</field>
549 8773b899 Scott Ullrich
		<field>
550
			<name>Next</name>
551
			<type>submit</type>
552 dd627071 Scott Ullrich
		</field>
553 8773b899 Scott Ullrich
	</fields>
554 3ed807e4 Scott Ullrich
	<stepsubmitphpaction>
555
	if($_POST['adminpassword'] != "") {
556
		if($_POST['adminpassword'] == $_POST['adminpasswordagain']) {
557 0b31cf3e Matthew Grooms
			$admin_user =&amp; getUserEntryByUID(0);
558
			local_user_set_password($admin_user, $_POST['adminpassword']);
559
			local_user_set($admin_user);
560 3ed807e4 Scott Ullrich
			write_config();
561
		} else {
562
			print_info_box_np("Passwords do not match!  Please press back in your browser window and correct.");
563
			die;
564
		}
565
	}
566
	</stepsubmitphpaction>
567 8773b899 Scott Ullrich
</step>
568
<step>
569
	<id>7</id>
570 2e1c1991 Scott Ullrich
	<title>Reload configuration</title>
571 34b5c5a0 Scott Ullrich
	<disableheader>true</disableheader>
572 9a0a9fc1 Chris Buechler
	<description>Click 'Reload' to reload pfSense with new changes.</description>
573 8773b899 Scott Ullrich
	<fields>
574
		<field>
575 2e1c1991 Scott Ullrich
			<name>Reload</name>
576 8773b899 Scott Ullrich
			<type>submit</type>
577
		</field>
578
	</fields>
579 4de543fa Scott Ullrich
</step>
580
<step>
581 cc0ef90e Scott Ullrich
	<id>8</id>
582 0b1138de Scott Ullrich
	<title>Reload in progress</title>
583 51b9e41d Scott Ullrich
	<description>
584
		A reload is now in progress.  Please wait. &lt;p&gt; 
585
		&lt;meta http-equiv="refresh" content="60; url=wizard.php?xml=setup_wizard.xml&amp;stepid=8" &gt;
586
		&lt;p&gt;
587
		The wizard will redirect to the next step once the reload is completed.
588
	</description>
589 34b5c5a0 Scott Ullrich
	<stepafterformdisplay>
590 e121bebd jim-p
		<![CDATA[
591 0bee2010 Erik Fonnesbeck
		$config['system']['hostname'] = $config['wizardtemp']['system']['hostname'];
592
		$config['system']['domain'] = $config['wizardtemp']['system']['domain'];
593 566193a5 jim-p
		if (!empty($config['wizardtemp']['wangateway'])) {
594
			if (!is_array($config['gateways']['gateway_item']))
595
				$config['gateways']['gateway_item'] = array();
596
			$found = false;
597 004c1412 Renato Botelho
			$defaultgw_found = false;
598 566193a5 jim-p
			foreach ($config['gateways']['gateway_item'] as & $gw) {
599 004c1412 Renato Botelho
				if ($gw['interface'] != "wan")
600
					continue;
601
				if (isset($gw['defaultgw']))
602
					$defaultgw_found = true;
603
				if ($gw['name'] == 'WANGW' || (!empty($config['wizardtemp']['wangateway']) && $gw['gateway'] == $config['wizardtemp']['wangateway'])) {
604 566193a5 jim-p
					$found = true;
605
					$gw['gateway'] = $config['wizardtemp']['wangateway'];
606 004c1412 Renato Botelho
					$config['interfaces']['wan']['gateway'] = $gw['name'];
607 566193a5 jim-p
				}
608 e121bebd jim-p
			}
609 566193a5 jim-p
			if (!$found) {
610
				$newgw = array();
611
				$newgw['interface'] = "wan";
612
				$newgw['gateway'] = $config['wizardtemp']['wangateway'];
613
				$newgw['name'] = "WANGW";
614
				$newgw['weight'] = 1;
615
				$newgw['descr'] = "WAN Gateway";
616 004c1412 Renato Botelho
				$newgw['defaultgw'] = !$defaultgw_found;
617 566193a5 jim-p
				$config['gateways']['gateway_item'][] = $newgw;
618 004c1412 Renato Botelho
				$config['interfaces']['wan']['gateway'] = "WANGW";
619 566193a5 jim-p
			}
620 e121bebd jim-p
		}
621 0bee2010 Erik Fonnesbeck
		unset($config['wizardtemp']);
622
		write_config();
623 eb06ca8e Scott Ullrich
		reload_all();
624 e121bebd jim-p
		mwexec_bg("/etc/rc.update_bogons.sh now");
625
		]]>
626 dd627071 Scott Ullrich
	</stepafterformdisplay>
627 8773b899 Scott Ullrich
</step>
628 51b9e41d Scott Ullrich
<step>
629
	<id>9</id>
630
	<title>Wizard completed.</title>
631 b148ab81 Scott Ullrich
	<stepbeforeformdisplay>
632
	<![CDATA[
633
		if($g['product_name'] <> 'pfSense') {
634 769891b5 Warren Baker
			Header("Location: " . fixup_string("\$myurl"));
635 b148ab81 Scott Ullrich
			exit;
636
		}	
637
	]]>
638
	</stepbeforeformdisplay>
639 51b9e41d Scott Ullrich
	<description>
640
	<![CDATA[
641
		Congratulations!  pfSense is now configured.<p/>
642 4cdae0ac Chris Buechler
		Please consider donating to the project to help us with our overhead costs.<p/>
643 c7281770 Chris Buechler
		Click <a target='_new' href='https://www.pfsense.org/j.php?jumpto=donate'>here</a> to donate or purchase services offered by the pfSense team.<p/>
644 51b9e41d Scott Ullrich
		Click <a href='$myurl'>here</a> to continue on to pfSense webConfigurator.
645
	]]>
646
	</description>
647
</step>
648 6bb5c9aa Bill Marquette
</pfsensewizard>