Project

General

Profile

Download (21.8 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	firewall_nat_edit.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6

    
7
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9

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

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

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

    
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31
/*
32
	pfSense_MODULE:	nat
33
*/
34

    
35
##|+PRIV
36
##|*IDENT=page-firewall-nat-portforward-edit
37
##|*NAME=Firewall: NAT: Port Forward: Edit page
38
##|*DESCR=Allow access to the 'Firewall: NAT: Port Forward: Edit' page.
39
##|*MATCH=firewall_nat_edit.php*
40
##|-PRIV
41

    
42
require("guiconfig.inc");
43
require_once("itemid.inc");
44
require("filter.inc");
45
require("shaper.inc");
46

    
47
if (!is_array($config['nat']['rule'])) {
48
	$config['nat']['rule'] = array();
49
}
50
$a_nat = &$config['nat']['rule'];
51

    
52
$id = $_GET['id'];
53
if (isset($_POST['id']))
54
	$id = $_POST['id'];
55

    
56
if (isset($_GET['dup'])) {
57
        $id = $_GET['dup'];
58
        $after = $_GET['dup'];
59
}
60

    
61
if (isset($id) && $a_nat[$id]) {
62
	$pconfig['extaddr'] = $a_nat[$id]['external-address'];
63
	$pconfig['proto'] = $a_nat[$id]['protocol'];
64
	list($pconfig['beginport'],$pconfig['endport']) = explode("-", $a_nat[$id]['external-port']);
65
	if(!$pconfig['endport'])
66
		$pconfig['endport'] = $pconfig['beginport'];
67
	$pconfig['localip'] = $a_nat[$id]['target'];
68
	$pconfig['localbeginport'] = $a_nat[$id]['local-port'];
69
	$pconfig['descr'] = $a_nat[$id]['descr'];
70
	$pconfig['interface'] = $a_nat[$id]['interface'];
71
	$pconfig['associated-filter-rule-id'] = $a_nat[$id]['associated-filter-rule-id'];
72
	$pconfig['nosync'] = isset($a_nat[$id]['nosync']);
73
	if (!$pconfig['interface'])
74
		$pconfig['interface'] = "wan";
75
} else {
76
	$pconfig['interface'] = "wan";
77
}
78

    
79
if (isset($_GET['dup']))
80
	unset($id);
81

    
82
/*  run through $_POST items encoding HTML entties so that the user
83
 *  cannot think he is slick and perform a XSS attack on the unwilling 
84
 */
85
foreach ($_POST as $key => $value) {
86
	$temp = $value;
87
	$newpost = htmlentities($temp);
88
	if($newpost <> $temp) 
89
		$input_errors[] = "Invalid characters detected ($temp).  Please remove invalid characters and save again.";		
90
}
91

    
92
if ($_POST) {
93

    
94
	if ($_POST['beginport_cust'] && !$_POST['beginport'])
95
		$_POST['beginport'] = $_POST['beginport_cust'];
96
	if ($_POST['endport_cust'] && !$_POST['endport'])
97
		$_POST['endport'] = $_POST['endport_cust'];
98
	if ($_POST['localbeginport_cust'] && !$_POST['localbeginport'])
99
		$_POST['localbeginport'] = $_POST['localbeginport_cust'];
100

    
101
	if (!$_POST['endport'])
102
		$_POST['endport'] = $_POST['beginport'];
103
        /* Make beginning port end port if not defined and endport is */
104
        if (!$_POST['beginport'] && $_POST['endport'])
105
                $_POST['beginport'] = $_POST['endport'];
106

    
107
	unset($input_errors);
108
	$pconfig = $_POST;
109

    
110
	/* input validation */
111
	if(strtoupper($_POST['proto']) == "TCP" or strtoupper($_POST['proto']) == "UDP" or strtoupper($_POST['proto']) == "TCP/UDP") {
112
		$reqdfields = explode(" ", "interface proto beginport endport localip localbeginport");
113
		$reqdfieldsn = explode(",", "Interface,Protocol,External port from,External port to,NAT IP,Local port");
114
	} else {
115
		$reqdfields = explode(" ", "interface proto localip");
116
		$reqdfieldsn = explode(",", "Interface,Protocol,NAT IP");
117
	}
118

    
119
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
120

    
121
	if (($_POST['localip'] && !is_ipaddroralias($_POST['localip']))) {
122
		$input_errors[] = "\"{$_POST['localip']}\" is not valid NAT IP address or host alias.";
123
	}
124

    
125
	/* only validate the ports if the protocol is TCP, UDP or TCP/UDP */
126
	if(strtoupper($_POST['proto']) == "TCP" or strtoupper($_POST['proto']) == "UDP" or strtoupper($_POST['proto']) == "TCP/UDP") {
127

    
128
		if (($_POST['beginport'] && !is_ipaddroralias($_POST['beginport']) && !is_port($_POST['beginport']))) {
129
			$input_errors[] = "The start port must be an integer between 1 and 65535.";
130
		}
131

    
132
		if (($_POST['endport'] && !is_ipaddroralias($_POST['endport']) && !is_port($_POST['endport']))) {
133
			$input_errors[] = "The end port must be an integer between 1 and 65535.";
134
		}
135

    
136
		if (($_POST['localbeginport'] && !is_ipaddroralias($_POST['localbeginport']) && !is_port($_POST['localbeginport']))) {
137
			$input_errors[] = "The local port must be an integer between 1 and 65535.";
138
		}
139

    
140
		if ($_POST['beginport'] > $_POST['endport']) {
141
			/* swap */
142
			$tmp = $_POST['endport'];
143
			$_POST['endport'] = $_POST['beginport'];
144
			$_POST['beginport'] = $tmp;
145
		}
146

    
147
		if (!$input_errors) {
148
			if (($_POST['endport'] - $_POST['beginport'] + $_POST['localbeginport']) > 65535)
149
				$input_errors[] = "The target port range must be an integer between 1 and 65535.";
150
		}
151

    
152
	}
153

    
154
	/* check for overlaps */
155
	foreach ($a_nat as $natent) {
156
		if (isset($id) && ($a_nat[$id]) && ($a_nat[$id] === $natent))
157
			continue;
158
		if ($natent['interface'] != $_POST['interface'])
159
			continue;
160
		if ($natent['external-address'] != $_POST['extaddr'])
161
			continue;
162
		if (($natent['proto'] != $_POST['proto']) && ($natent['proto'] != "tcp/udp") && ($_POST['proto'] != "tcp/udp"))
163
			continue;
164

    
165
		list($begp,$endp) = explode("-", $natent['external-port']);
166
		if (!$endp)
167
			$endp = $begp;
168

    
169
		if (!(   (($_POST['beginport'] < $begp) && ($_POST['endport'] < $begp))
170
		      || (($_POST['beginport'] > $endp) && ($_POST['endport'] > $endp)))) {
171

    
172
			$input_errors[] = "The external port range overlaps with an existing entry.";
173
			break;
174
		}
175
	}
176

    
177
	if (!$input_errors) {
178
		$natent = array();
179
		if ($_POST['extaddr'])
180
			$natent['external-address'] = $_POST['extaddr'];
181
		$natent['protocol'] = $_POST['proto'];
182

    
183
		if ($_POST['beginport'] == $_POST['endport'])
184
			$natent['external-port'] = $_POST['beginport'];
185
		else
186
			$natent['external-port'] = $_POST['beginport'] . "-" . $_POST['endport'];
187

    
188
		$natent['target'] = $_POST['localip'];
189
		$natent['local-port'] = $_POST['localbeginport'];
190
		$natent['interface'] = $_POST['interface'];
191
		$natent['descr'] = $_POST['descr'];
192
		$natent['associated-filter-rule-id'] = $_POST['associated-filter-rule-id'];
193
		
194
		if($_POST['filter-rule-association'] == "pass")
195
			$natent['associated-filter-rule-id'] = "pass";
196

    
197
		if($_POST['nosync'] == "yes")
198
			$natent['nosync'] = true;
199
		else
200
			unset($natent['nosync']);
201

    
202
		$need_filter_rule = false;
203
		// Updating a rule with a filter rule associated
204
		if( $natent['associated-filter-rule-id']>0 )
205
			$need_filter_rule = true;
206
		// If creating a new rule, where we want to add the filter rule, associated or not
207
		else if( isset($_POST['filter-rule-association']) && 
208
			($_POST['filter-rule-association']=='add-associated' || 
209
			$_POST['filter-rule-association']=='add-unassociated') )
210
			$need_filter_rule = true;
211

    
212
		if ($need_filter_rule) {
213

    
214
			// If we had a previous rule associated with this NAT rule, delete that
215
			if( $natent['associated-filter-rule-id'] > 0 )
216
				delete_id($natent['associated-filter-rule-id'], $config['filter']['rule']);
217

    
218
			/* auto-generate a matching firewall rule */
219
			$filterent = array();
220
			$filterent['interface'] = $_POST['interface'];
221
			$filterent['protocol'] = $_POST['proto'];
222
			$filterent['source']['any'] = "";
223
			$filterent['destination']['address'] = $_POST['localip'];
224

    
225
			$dstpfrom = $_POST['localbeginport'];
226
			$dstpto = $dstpfrom + $_POST['endport'] - $_POST['beginport'];
227

    
228
			if ($dstpfrom == $dstpto)
229
				$filterent['destination']['port'] = $dstpfrom;
230
			else
231
				$filterent['destination']['port'] = $dstpfrom . "-" . $dstpto;
232

    
233
			$filterent['descr'] = "NAT " . $_POST['descr'];
234
			/*
235
			 * Our firewall filter description may be no longer than
236
			 * 63 characters, so don't let it be.
237
			 */
238
			$filterent['descr'] = substr("NAT " . $_POST['descr'], 0, 59);
239

    
240
			// If we had a previous rule association, update this rule with that ID so we don't lose association
241
			if ($natent['associated-filter-rule-id'] > 0)
242
				$filterent['id'] = $natent['associated-filter-rule-id']; 
243
			// If we wanted this rule to be associated, make sure the NAT entry is updated with the same ID
244
			else if($_POST['filter-rule-association']=='add-associated')
245
				$natent['associated-filter-rule-id'] = $filterent['id'] = get_next_id($config['filter']['rule']);
246

    
247
			$config['filter']['rule'][] = $filterent;
248

    
249
			mark_subsystem_dirty('filter');
250
		}
251

    
252
		// Update NAT entry after creating/updating the firewall rule, so we have it's rule ID if one was created
253
		if (isset($id) && $a_nat[$id])
254
			$a_nat[$id] = $natent;
255
		else {
256
			if (is_numeric($after))
257
				array_splice($a_nat, $after+1, 0, array($natent));
258
			else
259
				$a_nat[] = $natent;
260
		}
261

    
262
		mark_subsystem_dirty('natconf');
263

    
264
		write_config();
265

    
266
		header("Location: firewall_nat.php");
267
		exit;
268
	}
269
}
270

    
271
$pgtitle = array("Firewall","NAT","Port Forward: Edit");
272
include("head.inc");
273

    
274
?>
275

    
276
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
277
<?php
278
include("fbegin.inc"); ?>
279
<?php if ($input_errors) print_input_errors($input_errors); ?>
280
            <form action="firewall_nat_edit.php" method="post" name="iform" id="iform">
281
              <table width="100%" border="0" cellpadding="6" cellspacing="0">
282
				<tr>
283
					<td colspan="2" valign="top" class="listtopic">Edit NAT entry</td>
284
				</tr>	
285
				<tr>
286
                  <td width="22%" valign="top" class="vncellreq">Interface</td>
287
                  <td width="78%" class="vtable">
288
					<select name="interface" class="formselect">
289
						<?php
290
						
291
						$iflist = get_configured_interface_with_descr(false, true);
292
						foreach ($iflist as $if => $ifdesc) 
293
							if(have_ruleint_access($if)) 
294
								$interfaces[$if] = $ifdesc;
295
						
296
						if ($config['pptpd']['mode'] == "server")
297
							if(have_ruleint_access("pptp")) 
298
								$interfaces['pptp'] = "PPTP VPN";
299
						
300
						if ($config['pppoe']['mode'] == "server")
301
							if(have_ruleint_access("pppoe")) 
302
								$interfaces['pppoe'] = "PPPoE VPN";
303
						
304
						/* add ipsec interfaces */
305
						if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable']))
306
							if(have_ruleint_access("enc0")) 
307
								$interfaces["enc0"] = "IPsec";						
308

    
309
						foreach ($interfaces as $iface => $ifacename): ?>
310
						<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>>
311
						<?=htmlspecialchars($ifacename);?>
312
						</option>
313
						<?php endforeach; ?>
314
					</select><br>
315
                     <span class="vexpl">Choose which interface this rule applies to.<br>
316
                     Hint: in most cases, you'll want to use WAN here.</span></td>
317
                </tr>
318
			    <tr>
319
                  <td width="22%" valign="top" class="vncellreq">External address</td>
320
                  <td width="78%" class="vtable">
321
					<select name="extaddr" class="formselect">
322
						<option value="" <?php if (!$pconfig['extaddr']) echo "selected"; ?>>Interface address</option>
323
<?php					if (is_array($config['virtualip']['vip'])):
324
						foreach ($config['virtualip']['vip'] as $sn): ?>
325
						<option value="<?=$sn['subnet'];?>" <?php if ($sn['subnet'] == $pconfig['extaddr']) echo "selected"; ?>><?=htmlspecialchars("{$sn['subnet']} ({$sn['descr']})");?></option>
326
<?php					endforeach;
327
						endif; ?>
328
						<option value="any" <?php if($pconfig['extaddr'] == "any") echo "selected"; ?>>any</option>
329
					</select>
330
					<br />
331
                    <span class="vexpl">
332
					If you want this rule to apply to another IP address than the IP address of the interface chosen above,
333
					select it here (you need to define <a href="firewall_virtual_ip.php">Virtual IP</a> addresses on the first).  Also note that if you are trying to redirect connections on the LAN select the "any" option.</span></td>
334
                </tr>
335
                <tr>
336
                  <td width="22%" valign="top" class="vncellreq">Protocol</td>
337
                  <td width="78%" class="vtable">
338
                    <select name="proto" class="formselect" onChange="proto_change(); check_for_aliases();">
339
                      <?php $protocols = explode(" ", "TCP UDP TCP/UDP GRE ESP"); foreach ($protocols as $proto): ?>
340
                      <option value="<?=strtolower($proto);?>" <?php if (strtolower($proto) == $pconfig['proto']) echo "selected"; ?>><?=htmlspecialchars($proto);?></option>
341
                      <?php endforeach; ?>
342
                    </select> <br> <span class="vexpl">Choose which IP protocol
343
                    this rule should match.<br>
344
                    Hint: in most cases, you should specify <em>TCP</em> &nbsp;here.</span></td>
345
                </tr>
346
                <tr>
347
                  <td width="22%" valign="top" class="vncellreq">External port
348
                    range </td>
349
                  <td width="78%" class="vtable">
350
                    <table border="0" cellspacing="0" cellpadding="0">
351
                      <tr>
352
                        <td>from:&nbsp;&nbsp;</td>
353
                        <td><select name="beginport" class="formselect" onChange="ext_rep_change(); ext_change(); check_for_aliases();">
354
                            <option value="">(other)</option>
355
                            <?php $bfound = 0; foreach ($wkports as $wkport => $wkportdesc): ?>
356
                            <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['beginport']) {
357
								echo "selected";
358
								$bfound = 1;
359
							}?>>
360
							<?=htmlspecialchars($wkportdesc);?>
361
							</option>
362
                            <?php endforeach; ?>
363
                          </select> <input onChange="check_for_aliases();" autocomplete='off' class="formfldalias" name="beginport_cust" id="beginport_cust" type="text" size="5" value="<?php if (!$bfound) echo $pconfig['beginport']; ?>"></td>
364
                      </tr>
365
                      <tr>
366
                        <td>to:</td>
367
                        <td><select name="endport" class="formselect" onChange="ext_change(); check_for_aliases();">
368
                            <option value="">(other)</option>
369
                            <?php $bfound = 0; foreach ($wkports as $wkport => $wkportdesc): ?>
370
                            <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['endport']) {
371
								echo "selected";
372
								$bfound = 1;
373
							}?>>
374
							<?=htmlspecialchars($wkportdesc);?>
375
							</option>
376
							<?php endforeach; ?>
377
                          </select> <input onChange="check_for_aliases();" class="formfldalias" autocomplete='off' name="endport_cust" id="endport_cust" type="text" size="5" value="<?php if (!$bfound) echo $pconfig['endport']; ?>"></td>
378
                      </tr>
379
                    </table>
380
                    <br> <span class="vexpl">Specify the port or port range on
381
                    the firewall's external address for this mapping.<br>
382
                    Hint: you can leave the <em>'to'</em> field empty if you only
383
                    want to map a single port</span></td>
384
                </tr>
385
                <tr>
386
                  <td width="22%" valign="top" class="vncellreq">NAT IP</td>
387
                  <td width="78%" class="vtable">
388
                    <input autocomplete='off' name="localip" type="text" class="formfldalias" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>">
389
                    <br> <span class="vexpl">Enter the internal IP address of
390
                    the server on which you want to map the ports.<br>
391
                    e.g. <em>192.168.1.12</em></span></td>
392
                </tr>
393
                <tr>
394
                  <td width="22%" valign="top" class="vncellreq">Local port</td>
395
                  <td width="78%" class="vtable">
396
                    <select name="localbeginport" class="formselect" onChange="ext_change();check_for_aliases();">
397
                      <option value="">(other)</option>
398
                      <?php $bfound = 0; foreach ($wkports as $wkport => $wkportdesc): ?>
399
                      <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['localbeginport']) {
400
							echo "selected";
401
							$bfound = 1;
402
						}?>>
403
					  <?=htmlspecialchars($wkportdesc);?>
404
					  </option>
405
                      <?php endforeach; ?>
406
                    </select> <input onChange="check_for_aliases();" autocomplete='off' class="formfldalias" name="localbeginport_cust" id="localbeginport_cust" type="text" size="5" value="<?php if (!$bfound) echo $pconfig['localbeginport']; ?>">
407
                    <br>
408
                    <span class="vexpl">Specify the port on the machine with the
409
                    IP address entered above. In case of a port range, specify
410
                    the beginning port of the range (the end port will be calculated
411
                    automatically).<br>
412
                    Hint: this is usually identical to the 'from' port above</span></td>
413
                </tr>
414
                <tr>
415
                  <td width="22%" valign="top" class="vncell">Description</td>
416
                  <td width="78%" class="vtable">
417
                    <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
418
                    <br> <span class="vexpl">You may enter a description here
419
                    for your reference (not parsed).</span></td>
420
                </tr>
421
				<tr>
422
					<td width="22%" valign="top" class="vncell">No XMLRPC Sync</td>
423
					<td width="78%" class="vtable">
424
						<input type="checkbox" value="yes" name="nosync"<?php if($pconfig['nosync']) echo " CHECKED"; ?>><br>
425
						HINT: This prevents the rule from automatically syncing to other CARP members.
426
					</td>
427
				</tr>
428
				<?php if (isset($id) && $a_nat[$id] && !isset($_GET['dup'])): ?>
429
				<tr>
430
					<td width="22%" valign="top" class="vncell">Filter rule association</td>
431
					<td width="78%" class="vtable">
432
						<select name="associated-filter-rule-id">
433
							<option value="">None</option>
434
							<option value="pass" <?php if($pconfig['associated-filter-rule-id'] == "pass") echo " SELECTED"; ?>>Pass</option>
435
							<?php foreach ($config['filter']['rule'] as $filter_rule): ?>
436
								<?php if (isset($filter_rule['id']) && $filter_rule['id']>0): ?>
437
									<option value="<?php echo $filter_rule['id']; ?>"<?php if($filter_rule['id']==$pconfig['associated-filter-rule-id']) echo " SELECTED"; ?>>
438
									<?php echo htmlspecialchars('Rule ' . $filter_rule['id'] . ' - ' . $filter_rule['descr']); ?>
439
									</option>
440
								<?php endif; ?>
441
							<?php endforeach; ?>
442
						</select>
443
					</td>
444
				</tr>
445
				<?php endif; ?>
446
                <?php if ((!(isset($id) && $a_nat[$id])) || (isset($_GET['dup']))): ?>
447
                <tr>
448
                  <td width="22%" valign="top" class="vncell">Filter rule association</td>
449
                  <td width="78%" class="vtable">
450
                    <select name="filter-rule-association" id="filter-rule-association">
451
						<option value="">None</option>
452
						<option value="add-associated" selected="selected">Add associated filter rule</option>
453
						<option value="add-unassociated">Add unassociated filter rule</option>
454
						<option value="pass">Pass</option>
455
					</select>
456
				  </td>
457
                </tr><?php endif; ?>
458
				<tr>
459
                  <td width="22%" valign="top">&nbsp;</td>
460
                  <td width="78%">&nbsp;</td>
461
				</tr>
462
                <tr>
463
                  <td width="22%" valign="top">&nbsp;</td>
464
                  <td width="78%">
465
                    <input name="Submit" type="submit" class="formbtn" value="Save"> <input type="button" class="formbtn" value="Cancel" onclick="history.back()">
466
                    <?php if (isset($id) && $a_nat[$id]): ?>
467
                    <input name="id" type="hidden" value="<?=$id;?>">
468
                    <?php endif; ?>
469
                  </td>
470
                </tr>
471
              </table>
472
</form>
473
<script language="JavaScript">
474
<!--
475
	ext_change();
476
//-->
477
</script>
478
<?php
479
$isfirst = 0;
480
$aliases = "";
481
$addrisfirst = 0;
482
$aliasesaddr = "";
483
if($config['aliases']['alias'] <> "")
484
	foreach($config['aliases']['alias'] as $alias_name) {
485
		switch ($alias_name['type']) {
486
                        case "port":
487
                                if($isfirst == 1) $portaliases .= ",";
488
                                $portaliases .= "'" . $alias_name['name'] . "'";
489
                                $isfirst = 1;
490
                                break;
491
                        case "host":
492
                        case "network":
493
                        case "openvpn":
494
                                if($addrisfirst == 1) $aliasesaddr .= ",";
495
                                $aliasesaddr .= "'" . $alias_name['name'] . "'";
496
                                $addrisfirst = 1;
497
                                break;
498
                        default:
499
                                break;
500
		}
501
	}
502
?>
503
<script language="JavaScript">
504
<!--
505
	var addressarray=new Array(<?php echo $aliasesaddr; ?>);
506
	var customarray=new Array(<?php echo $portaliases; ?>);
507

    
508
	var oTextbox1 = new AutoSuggestControl(document.getElementById("localip"), new StateSuggestions(addressarray));
509
        var oTextbox2 = new AutoSuggestControl(document.getElementById("beginport_cust"), new StateSuggestions(customarray));
510
        var oTextbox3 = new AutoSuggestControl(document.getElementById("endport_cust"), new StateSuggestions(customarray));
511
        var oTextbox4 = new AutoSuggestControl(document.getElementById("localbeginport_cust"), new StateSuggestions(customarray));
512
//-->
513
</script>
514
<?php include("fend.inc"); ?>
515
</body>
516
</html>
(52-52/214)