Projet

Général

Profil

Télécharger (19,6 ko) Statistiques
| Branche: | Tag: | Révision:

univnautes / usr / local / www / firewall_nat_1to1_edit.php @ fab1cd2f

1
<?php
2
/* $Id$ */
3
/*
4
	firewall_nat_1to1_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-1-1-edit
37
##|*NAME=Firewall: NAT: 1:1: Edit page
38
##|*DESCR=Allow access to the 'Firewall: NAT: 1:1: Edit' page.
39
##|*MATCH=firewall_nat_1to1_edit.php*
40
##|-PRIV
41

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

    
47
$specialsrcdst = explode(" ", "any pptp pppoe l2tp openvpn");
48
$ifdisp = get_configured_interface_with_descr();
49
foreach ($ifdisp as $kif => $kdescr) {
50
	$specialsrcdst[] = "{$kif}";
51
	$specialsrcdst[] = "{$kif}ip";
52
}
53

    
54
if (!is_array($config['nat']['onetoone']))
55
	$config['nat']['onetoone'] = array();
56

    
57
$a_1to1 = &$config['nat']['onetoone'];
58

    
59
if (is_numericint($_GET['id']))
60
	$id = $_GET['id'];
61
if (isset($_POST['id']) && is_numericint($_POST['id']))
62
	$id = $_POST['id'];
63

    
64
$after = $_GET['after'];
65
if (isset($_POST['after']))
66
	$after = $_POST['after'];
67

    
68
if (isset($_GET['dup']))  {
69
	$id = $_GET['dup'];
70
	$after = $_GET['dup'];
71
}
72

    
73
if (isset($id) && $a_1to1[$id]) {
74
	$pconfig['disabled'] = isset($a_1to1[$id]['disabled']);
75

    
76
	address_to_pconfig($a_1to1[$id]['source'], $pconfig['src'],
77
		$pconfig['srcmask'], $pconfig['srcnot'],
78
		$pconfig['srcbeginport'], $pconfig['srcendport']);
79

    
80
	address_to_pconfig($a_1to1[$id]['destination'], $pconfig['dst'],
81
		$pconfig['dstmask'], $pconfig['dstnot'],
82
		$pconfig['dstbeginport'], $pconfig['dstendport']);
83

    
84
	$pconfig['interface'] = $a_1to1[$id]['interface'];
85
	if (!$pconfig['interface'])
86
		$pconfig['interface'] = "wan";
87

    
88
	$pconfig['external'] = $a_1to1[$id]['external'];
89
	$pconfig['descr'] = $a_1to1[$id]['descr'];
90
	$pconfig['natreflection'] = $a_1to1[$id]['natreflection'];
91
} else
92
	$pconfig['interface'] = "wan";
93

    
94
if (isset($_GET['dup']))
95
	unset($id);
96

    
97
if ($_POST) {
98

    
99
	unset($input_errors);
100
	$pconfig = $_POST;
101
	/*  run through $_POST items encoding HTML entties so that the user
102
	 *  cannot think he is slick and perform a XSS attack on the unwilling
103
	 */
104
	foreach ($_POST as $key => $value) {
105
		$temp = str_replace(">", "", $value);
106
		$newpost = htmlentities($temp);
107
		if($newpost <> $temp)
108
			$input_errors[] = sprintf(gettext("Invalid characters detected (%s).  Please remove invalid characters and save again."),$temp);
109
	}
110

    
111
	/* input validation */
112
	$reqdfields = explode(" ", "interface external");
113
	$reqdfieldsn = array(gettext("Interface"), gettext("External subnet"));
114
	if ($_POST['srctype'] == "single" || $_POST['srctype'] == "network") {
115
		$reqdfields[] = "src";
116
		$reqdfieldsn[] = gettext("Source address");
117
	}
118
	if ($_POST['dsttype'] == "single" || $_POST['dsttype'] == "network") {
119
		$reqdfields[] = "dst";
120
		$reqdfieldsn[] = gettext("Destination address");
121
	}
122

    
123
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
124

    
125
	if ($_POST['external'])
126
		$_POST['external'] = trim($_POST['external']);
127
	if ($_POST['src'])
128
		$_POST['src'] = trim($_POST['src']);
129
	if ($_POST['dst'])
130
		$_POST['dst'] = trim($_POST['dst']);
131

    
132
	if (is_specialnet($_POST['srctype'])) {
133
		$_POST['src'] = $_POST['srctype'];
134
		$_POST['srcmask'] = 0;
135
	} else if ($_POST['srctype'] == "single") {
136
		$_POST['srcmask'] = 32;
137
	}
138
	if (is_specialnet($_POST['dsttype'])) {
139
		$_POST['dst'] = $_POST['dsttype'];
140
		$_POST['dstmask'] = 0;
141
	} else if ($_POST['dsttype'] == "single") {
142
		$_POST['dstmask'] = 32;
143
	} else if (is_ipaddr($_POST['dsttype'])) {
144
		$_POST['dst'] = $_POST['dsttype'];
145
		$_POST['dstmask'] = 32;
146
		$_POST['dsttype'] = "single";
147
	}
148

    
149
	/* For external, user can enter only ip's */
150
	if (($_POST['external'] && !is_ipaddr($_POST['external'])))
151
		$input_errors[] = gettext("A valid external subnet must be specified.");
152

    
153
	/* For dst, if user enters an alias and selects "network" then disallow. */
154
	if ($_POST['dsttype'] == "network" && is_alias($_POST['dst']) )
155
		$input_errors[] = gettext("You must specify single host or alias for alias entries.");
156

    
157
	/* For src, user can enter only ip's or networks */
158
	if (!is_specialnet($_POST['srctype'])) {
159
		if (($_POST['src'] && !is_ipaddr($_POST['src']))) {
160
			$input_errors[] = sprintf(gettext("%s is not a valid internal IP address."), $_POST['src']);
161
		}
162
		if (($_POST['srcmask'] && !is_numericint($_POST['srcmask']))) {
163
			$input_errors[] = gettext("A valid internal bit count must be specified.");
164
		}
165
	}
166

    
167
	/* For dst, user can enter ip's, networks or aliases */
168
	if (!is_specialnet($_POST['dsttype'])) {
169
		if (($_POST['dst'] && !is_ipaddroralias($_POST['dst']))) {
170
			$input_errors[] = sprintf(gettext("%s is not a valid destination IP address or alias."), $_POST['dst']);
171
		}
172
		if (($_POST['dstmask'] && !is_numericint($_POST['dstmask']))) {
173
			$input_errors[] = gettext("A valid destination bit count must be specified.");
174
		}
175
	}
176

    
177
	/* check for overlaps with other 1:1 */
178
	foreach ($a_1to1 as $natent) {
179
		if (isset($id) && ($a_1to1[$id]) && ($a_1to1[$id] === $natent))
180
			continue;
181

    
182
		if (check_subnets_overlap($_POST['internal'], $_POST['subnet'], $natent['internal'], $natent['subnet'])) {
183
			//$input_errors[] = "Another 1:1 rule overlaps with the specified internal subnet.";
184
			//break;
185
		}
186
	}
187

    
188
	if (!$input_errors) {
189
		$natent = array();
190

    
191
		$natent['disabled'] = isset($_POST['disabled']) ? true:false;
192
		$natent['external'] = $_POST['external'];
193
		$natent['descr'] = $_POST['descr'];
194
		$natent['interface'] = $_POST['interface'];
195

    
196
		pconfig_to_address($natent['source'], $_POST['src'],
197
			$_POST['srcmask'], $_POST['srcnot']);
198

    
199
		pconfig_to_address($natent['destination'], $_POST['dst'],
200
			$_POST['dstmask'], $_POST['dstnot']);
201

    
202
		if ($_POST['natreflection'] == "enable" || $_POST['natreflection'] == "disable")
203
			$natent['natreflection'] = $_POST['natreflection'];
204
		else
205
			unset($natent['natreflection']);
206

    
207
		if (isset($id) && $a_1to1[$id])
208
			$a_1to1[$id] = $natent;
209
		else {
210
			if (is_numeric($after))
211
				array_splice($a_1to1, $after+1, 0, array($natent));
212
			else
213
				$a_1to1[] = $natent;
214
		}
215

    
216
		if (write_config())
217
			mark_subsystem_dirty('natconf');
218
		header("Location: firewall_nat_1to1.php");
219
		exit;
220
	}
221
}
222

    
223
$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("1:1"),gettext("Edit"));
224
include("head.inc");
225

    
226
?>
227

    
228
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
229
<script type="text/javascript" src="/javascript/suggestions.js"></script>
230
<script type="text/javascript" src="/javascript/autosuggest.js"></script>
231
<script type="text/javascript">
232
//<![CDATA[
233
function typesel_change() {
234
	switch (document.iform.srctype.selectedIndex) {
235
		case 1: /* single */
236
			document.iform.src.disabled = 0;
237
			document.iform.srcmask.value = "";
238
			document.iform.srcmask.disabled = 1;
239
			break;
240
		case 2: /* network */
241
			document.iform.src.disabled = 0;
242
			document.iform.srcmask.disabled = 0;
243
			break;
244
		default:
245
			document.iform.src.value = "";
246
			document.iform.src.disabled = 1;
247
			document.iform.srcmask.value = "";
248
			document.iform.srcmask.disabled = 1;
249
			break;
250
	}
251
	switch (document.iform.dsttype.selectedIndex) {
252
		case 1: /* single */
253
			document.iform.dst.disabled = 0;
254
			document.iform.dstmask.value = "";
255
			document.iform.dstmask.disabled = 1;
256
			break;
257
		case 2: /* network */
258
			document.iform.dst.disabled = 0;
259
			document.iform.dstmask.disabled = 0;
260
			break;
261
		default:
262
			document.iform.dst.value = "";
263
			document.iform.dst.disabled = 1;
264
			document.iform.dstmask.value = "";
265
			document.iform.dstmask.disabled = 1;
266
			break;
267
	}
268
}
269
//]]>
270
</script>
271

    
272
<?php
273
include("fbegin.inc");
274
if ($input_errors)
275
	print_input_errors($input_errors);
276
?>
277
<form action="firewall_nat_1to1_edit.php" method="post" name="iform" id="iform">
278
	<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="firewall nat 1to1 edit">
279
		<tr>
280
			<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit NAT 1:1 entry"); ?></td>
281
		</tr>
282
		<tr>
283
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td>
284
			<td width="78%" class="vtable">
285
				<input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked=\"checked\""; ?> />
286
				<strong><?=gettext("Disable this rule"); ?></strong><br />
287
				<span class="vexpl"><?=gettext("Set this option to disable this rule without removing it from the list."); ?></span>
288
			</td>
289
		</tr>
290
		<tr>
291
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Interface"); ?></td>
292
			<td width="78%" class="vtable">
293
				<select name="interface" class="formselect">
294
<?php
295
					foreach ($ifdisp as $if => $ifdesc)
296
						if(have_ruleint_access($if))
297
							$interfaces[$if] = $ifdesc;
298

    
299
					if ($config['l2tp']['mode'] == "server")
300
						if(have_ruleint_access("l2tp"))
301
							$interfaces['l2tp'] = "L2TP VPN";
302

    
303
					if ($config['pptpd']['mode'] == "server")
304
						if(have_ruleint_access("pptp"))
305
							$interfaces['pptp'] = "PPTP VPN";
306

    
307
					if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
308
						$interfaces['pppoe'] = "PPPoE VPN";
309

    
310
					/* add ipsec interfaces */
311
					if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable']))
312
						if(have_ruleint_access("enc0"))
313
							$interfaces["enc0"] = "IPsec";
314

    
315
					/* add openvpn/tun interfaces */
316
					if  ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"])
317
						$interfaces["openvpn"] = "OpenVPN";
318

    
319
					foreach ($interfaces as $iface => $ifacename):
320
?>
321
						<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>>
322
							<?=htmlspecialchars($ifacename);?>
323
						</option>
324
<?php
325
					endforeach;
326
?>
327
				</select><br />
328
			  <span class="vexpl"><?=gettext("Choose which interface this rule applies to"); ?>.<br />
329
			  <?=gettext("Hint: in most cases, you'll want to use WAN here"); ?>.</span></td>
330
		</tr>
331
		<tr>
332
			<td width="22%" valign="top" class="vncellreq"><?=gettext("External subnet IP"); ?></td>
333
			<td width="78%" class="vtable">
334
				<input name="external" type="text" class="formfld" id="external" size="20" value="<?=htmlspecialchars($pconfig['external']);?>" />
335
				<br />
336
				<span class="vexpl">
337
					<?=gettext("Enter the external (usually on a WAN) subnet's starting address for the 1:1 mapping.  " .
338
						"The subnet mask from the internal address below will be applied to this IP address."); ?><br />
339
					<?=gettext("Hint: this is generally an address owned by the router itself on the selected interface."); ?>
340
				</span>
341
			</td>
342
		</tr>
343
		<tr>
344
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Internal IP"); ?></td>
345
			<td width="78%" class="vtable">
346
				<input name="srcnot" type="checkbox" id="srcnot" value="yes" <?php if ($pconfig['srcnot']) echo "checked=\"checked\""; ?> />
347
				<strong><?=gettext("not"); ?></strong>
348
				<br />
349
				<?=gettext("Use this option to invert the sense of the match."); ?>
350
				<br />
351
				<br />
352
				<table border="0" cellspacing="0" cellpadding="0" summary="source">
353
					<tr>
354
						<td><?=gettext("Type:"); ?>&nbsp;&nbsp;</td>
355
						<td>
356
							<select name="srctype" class="formselect" onchange="typesel_change()">
357
<?php
358
							$sel = is_specialnet($pconfig['src']);
359
?>
360
								<option value="any"     <?php if ($pconfig['src'] == "any") { echo "selected=\"selected\""; } ?>><?=gettext("any"); ?></option>
361
								<option value="single"  <?php if ((($pconfig['srcmask'] == 32) || !isset($pconfig['srcmask'])) && !$sel) { echo "selected=\"selected\""; $sel = 1; } ?>>
362
									<?=gettext("Single host"); ?>
363
								</option>
364
								<option value="network" <?php if (!$sel) echo "selected=\"selected\""; ?>><?=gettext("Network"); ?></option>
365
<?php
366
							if(have_ruleint_access("pptp")):
367
?>
368
								<option value="pptp"    <?php if ($pconfig['src'] == "pptp") { echo "selected=\"selected\""; } ?>><?=gettext("PPTP clients"); ?></option>
369
<?php
370
							endif;
371
							if(have_ruleint_access("pppoe")):
372
?>
373
								<option value="pppoe"   <?php if ($pconfig['src'] == "pppoe") { echo "selected=\"selected\""; } ?>><?=gettext("PPPoE clients"); ?></option>
374
<?php
375
							endif;
376
							if(have_ruleint_access("l2tp")):
377
?>
378
								<option value="l2tp"   <?php if ($pconfig['src'] == "l2tp") { echo "selected=\"selected\""; } ?>><?=gettext("L2TP clients"); ?></option>
379
<?php
380
							endif;
381
							foreach ($ifdisp as $ifent => $ifdesc):
382
								if(have_ruleint_access($ifent)):
383
?>
384
									<option value="<?=$ifent;?>" <?php if ($pconfig['src'] == $ifent) { echo "selected=\"selected\""; } ?>>
385
										<?=htmlspecialchars($ifdesc);?> <?=gettext("net"); ?>
386
									</option>
387
									<option value="<?=$ifent;?>ip"<?php if ($pconfig['src'] ==  $ifent . "ip") { echo "selected=\"selected\""; } ?>>
388
										<?=$ifdesc?> <?=gettext("address");?>
389
									</option>
390
<?php
391
								endif;
392
							endforeach;
393
?>
394
							</select>
395
						</td>
396
					</tr>
397
					<tr>
398
						<td><?=gettext("Address:"); ?>&nbsp;&nbsp;</td>
399
						<td>
400
							<input name="src" type="text" class="formfld" id="src" size="20" value="<?php if (!is_specialnet($pconfig['src'])) echo htmlspecialchars($pconfig['src']);?>" /> /
401
							<select name="srcmask" class="formselect" id="srcmask">
402
<?php
403
							for ($i = 31; $i > 0; $i--):
404
?>
405
                                                	        <option value="<?=$i;?>" <?php if ($i == $pconfig['srcmask']) echo "selected=\"selected\""; ?>><?=$i;?></option>
406
<?php
407
							endfor;
408
?>
409
							</select>
410
						</td>
411
					</tr>
412
				</table>
413
				<br />
414
				<span class="vexpl"><?=gettext("Enter the internal (LAN) subnet for the 1:1 mapping. The subnet size specified for the internal subnet will be applied to the external subnet."); ?></span>
415
			</td>
416
		</tr>
417
		<tr>
418
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Destination"); ?></td>
419
			<td width="78%" class="vtable">
420
				<input name="dstnot" type="checkbox" id="dstnot" value="yes" <?php if ($pconfig['dstnot']) echo "checked=\"checked\""; ?> />
421
				<strong><?=gettext("not"); ?></strong>
422
				<br />
423
				<?=gettext("Use this option to invert the sense of the match."); ?>
424
				<br />
425
				<br />
426
				<table border="0" cellspacing="0" cellpadding="0" summary="destination">
427
					<tr>
428
						<td><?=gettext("Type:"); ?>&nbsp;&nbsp;</td>
429
						<td>
430
							<select name="dsttype" class="formselect" onchange="typesel_change()">
431
<?php
432
							$sel = is_specialnet($pconfig['dst']); ?>
433
								<option value="any" <?php if (empty($pconfig['dst']) || $pconfig['dst'] == "any") { echo "selected=\"selected\""; } ?>><?=gettext("any"); ?></option>
434
								<option value="single" <?php if (($pconfig['dstmask'] == 32) && !$sel) { echo "selected=\"selected\""; $sel = 1; } ?>>
435
									<?=gettext("Single host or alias"); ?>
436
								</option>
437
								<option value="network" <?php if (!$sel && !empty($pconfig['dst'])) echo "selected=\"selected\""; ?>>
438
									<?=gettext("Network"); ?>
439
								</option>
440
<?php
441
							if(have_ruleint_access("pptp")):
442
?>
443
								<option value="pptp" <?php if ($pconfig['dst'] == "pptp") { echo "selected=\"selected\""; } ?>>
444
									<?=gettext("PPTP clients"); ?>
445
								</option>
446
<?php
447
							endif;
448
							if(have_ruleint_access("pppoe")):
449
?>
450
								<option value="pppoe" <?php if ($pconfig['dst'] == "pppoe") { echo "selected=\"selected\""; } ?>>
451
									<?=gettext("PPPoE clients"); ?>
452
								</option>
453
<?php
454
							endif;
455
							if(have_ruleint_access("l2tp")):
456
?>
457
								<option value="l2tp" <?php if ($pconfig['dst'] == "l2tp") { echo "selected=\"selected\""; } ?>>
458
									<?=gettext("L2TP clients"); ?>
459
								</option>
460
<?php
461
							endif;
462

    
463
							foreach ($ifdisp as $if => $ifdesc):
464
								if(have_ruleint_access($if)):
465
?>
466
									<option value="<?=$if;?>" <?php if ($pconfig['dst'] == $if) { echo "selected=\"selected\""; } ?>><?=htmlspecialchars($ifdesc);?>
467
										<?=gettext("net"); ?>
468
									</option>
469
									<option value="<?=$if;?>ip"<?php if ($pconfig['dst'] == $if . "ip") { echo "selected=\"selected\""; } ?>>
470
										<?=$ifdesc;?> <?=gettext("address");?>
471
									</option>
472
<?php
473
								endif;
474
							endforeach;
475
?>
476
							</select>
477
						</td>
478
					</tr>
479
					<tr>
480
						<td><?=gettext("Address:"); ?>&nbsp;&nbsp;</td>
481
						<td>
482
							<input name="dst" type="text" autocomplete="off" class="formfldalias" id="dst" size="20" value="<?php if (!is_specialnet($pconfig['dst'])) echo htmlspecialchars($pconfig['dst']);?>" />
483
							/
484
							<select name="dstmask" class="formselect" id="dstmask">
485
<?php
486
							for ($i = 31; $i > 0; $i--):
487
?>
488
								<option value="<?=$i;?>" <?php if ($i == $pconfig['dstmask']) echo "selected=\"selected\""; ?>><?=$i;?></option>
489
<?php
490
							endfor;
491
?>
492
							</select>
493
						</td>
494
					</tr>
495
				</table>
496
				<br />
497
				<span class="vexpl">
498
					<?=gettext("The 1:1 mapping will only be used for connections to or from the specified destination."); ?><br />
499
					<?=gettext("Hint: this is usually 'any'."); ?>
500
				</span>
501
			</td>
502
		</tr>
503
		<tr>
504
			<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
505
			<td width="78%" class="vtable">
506
				<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
507
				<br />
508
				<span class="vexpl">
509
					<?=gettext("You may enter a description here for your reference (not parsed)."); ?>
510
				</span>
511
			</td>
512
		</tr>
513
		<tr>
514
			<td width="22%" valign="top" class="vncell"><?=gettext("NAT reflection"); ?></td>
515
			<td width="78%" class="vtable">
516
				<select name="natreflection" class="formselect">
517
					<option value="default" <?php if ($pconfig['natreflection'] != "enable" && $pconfig['natreflection'] != "disable") echo "selected=\"selected\""; ?>>
518
						<?=gettext("use system default"); ?>
519
					</option>
520
					<option value="enable" <?php if ($pconfig['natreflection'] == "enable") echo "selected=\"selected\""; ?>>
521
						<?=gettext("enable"); ?>
522
					</option>
523
					<option value="disable" <?php if ($pconfig['natreflection'] == "disable") echo "selected=\"selected\""; ?>>
524
						<?=gettext("disable"); ?>
525
					</option>
526
				</select>
527
			</td>
528
		</tr>
529
		<tr>
530
			<td width="22%" valign="top">&nbsp;</td>
531
			<td width="78%">
532
				<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" /> <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()" />
533
				<?php if (isset($id) && $a_1to1[$id]): ?>
534
				<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
535
				<?php endif; ?>
536
			</td>
537
		</tr>
538
	</table>
539
</form>
540
<script type="text/javascript">
541
//<![CDATA[
542
	typesel_change();
543
//]]>
544
</script>
545
<script type="text/javascript">
546
//<![CDATA[
547
	var addressarray = <?= json_encode(get_alias_list(array("host", "network", "openvpn", "urltable"))) ?>;
548
	var oTextbox1 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray));
549
//]]>
550
</script>
551
<?php include("fend.inc"); ?>
552
</body>
553
</html>
(64-64/255)