Revision a44981a3
Added by Colin Fleming over 12 years ago
usr/local/www/firewall_nat_1to1_edit.php | ||
---|---|---|
224 | 224 |
?> |
225 | 225 |
|
226 | 226 |
<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> |
227 |
<script type="text/javascript" src="/javascript/suggestions.js"> |
|
228 |
</script> |
|
229 |
<script type="text/javascript" src="/javascript/autosuggest.js"> |
|
230 |
</script> |
|
227 |
<script type="text/javascript" src="/javascript/suggestions.js"></script> |
|
228 |
<script type="text/javascript" src="/javascript/autosuggest.js"></script> |
|
231 | 229 |
<script type="text/javascript"> |
230 |
//<![CDATA[ |
|
232 | 231 |
function typesel_change() { |
233 | 232 |
switch (document.iform.srctype.selectedIndex) { |
234 | 233 |
case 1: /* single */ |
... | ... | |
265 | 264 |
break; |
266 | 265 |
} |
267 | 266 |
} |
267 |
//]]> |
|
268 | 268 |
</script> |
269 | 269 |
|
270 | 270 |
<?php include("fbegin.inc"); ?> |
271 | 271 |
<?php if ($input_errors) print_input_errors($input_errors); ?> |
272 | 272 |
<form action="firewall_nat_1to1_edit.php" method="post" name="iform" id="iform"> |
273 |
<table width="100%" border="0" cellpadding="6" cellspacing="0"> |
|
273 |
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="firewall nat 1to1 edit">
|
|
274 | 274 |
<tr> |
275 | 275 |
<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit NAT 1:1 entry"); ?></td> |
276 | 276 |
</tr> |
277 | 277 |
<tr> |
278 | 278 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td> |
279 | 279 |
<td width="78%" class="vtable"> |
280 |
<input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked"; ?>>
|
|
280 |
<input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked=\"checked\""; ?> />
|
|
281 | 281 |
<strong><?=gettext("Disable this rule"); ?></strong><br /> |
282 | 282 |
<span class="vexpl"><?=gettext("Set this option to disable this rule without removing it from the list."); ?></span> |
283 |
</td> |
|
283 |
</td> |
|
284 |
</tr> |
|
284 | 285 |
<tr> |
285 | 286 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Interface"); ?></td> |
286 | 287 |
<td width="78%" class="vtable"> |
... | ... | |
312 | 313 |
|
313 | 314 |
foreach ($interfaces as $iface => $ifacename): |
314 | 315 |
?> |
315 |
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>> |
|
316 |
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>>
|
|
316 | 317 |
<?=htmlspecialchars($ifacename);?> |
317 | 318 |
</option> |
318 | 319 |
<?php endforeach; ?> |
319 |
</select><br> |
|
320 |
<span class="vexpl"><?=gettext("Choose which interface this rule applies to"); ?>.<br> |
|
320 |
</select><br/>
|
|
321 |
<span class="vexpl"><?=gettext("Choose which interface this rule applies to"); ?>.<br/>
|
|
321 | 322 |
<?=gettext("Hint: in most cases, you'll want to use WAN here"); ?>.</span></td> |
322 | 323 |
</tr> |
323 | 324 |
<tr> |
324 | 325 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("External subnet IP"); ?></td> |
325 | 326 |
<td width="78%" class="vtable"> |
326 |
<input name="external" type="text" class="formfld" id="external" size="20" value="<?=htmlspecialchars($pconfig['external']);?>"> |
|
327 |
<input name="external" type="text" class="formfld" id="external" size="20" value="<?=htmlspecialchars($pconfig['external']);?>" />
|
|
327 | 328 |
<br/> |
328 |
<span class="vexpl"><?=gettext("Enter the external (usually on a WAN) subnet's starting address for the 1:1 mapping. The subnet mask from the internal address below will be applied to this IP address."); ?><br> |
|
329 |
<span class="vexpl"><?=gettext("Enter the external (usually on a WAN) subnet's starting address for the 1:1 mapping. The subnet mask from the internal address below will be applied to this IP address."); ?><br/>
|
|
329 | 330 |
<?=gettext("Hint: this is generally an address owned by the router itself on the selected interface."); ?></span> |
330 | 331 |
</td> |
331 | 332 |
</tr> |
332 | 333 |
<tr> |
333 | 334 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Internal IP"); ?></td> |
334 | 335 |
<td width="78%" class="vtable"> |
335 |
<input name="srcnot" type="checkbox" id="srcnot" value="yes" <?php if ($pconfig['srcnot']) echo "checked"; ?>>
|
|
336 |
<input name="srcnot" type="checkbox" id="srcnot" value="yes" <?php if ($pconfig['srcnot']) echo "checked=\"checked\""; ?> />
|
|
336 | 337 |
<strong><?=gettext("not"); ?></strong> |
337 | 338 |
<br /> |
338 | 339 |
<?=gettext("Use this option to invert the sense of the match."); ?> |
339 | 340 |
<br /> |
340 | 341 |
<br /> |
341 |
<table border="0" cellspacing="0" cellpadding="0"> |
|
342 |
<table border="0" cellspacing="0" cellpadding="0" summary="source">
|
|
342 | 343 |
<tr> |
343 | 344 |
<td><?=gettext("Type:"); ?> </td> |
344 | 345 |
<td> |
345 |
<select name="srctype" class="formselect" onChange="typesel_change()">
|
|
346 |
<select name="srctype" class="formselect" onchange="typesel_change()">
|
|
346 | 347 |
<?php |
347 | 348 |
$sel = is_specialnet($pconfig['src']); ?> |
348 |
<option value="any" <?php if ($pconfig['src'] == "any") { echo "selected"; } ?>><?=gettext("any"); ?></option> |
|
349 |
<option value="single" <?php if ((($pconfig['srcmask'] == 32) || !isset($pconfig['srcmask'])) && !$sel) { echo "selected"; $sel = 1; } ?>><?=gettext("Single host"); ?></option> |
|
350 |
<option value="network" <?php if (!$sel) echo "selected"; ?>><?=gettext("Network"); ?></option> |
|
349 |
<option value="any" <?php if ($pconfig['src'] == "any") { echo "selected=\"selected\""; } ?>><?=gettext("any"); ?></option>
|
|
350 |
<option value="single" <?php if ((($pconfig['srcmask'] == 32) || !isset($pconfig['srcmask'])) && !$sel) { echo "selected=\"selected\""; $sel = 1; } ?>><?=gettext("Single host"); ?></option>
|
|
351 |
<option value="network" <?php if (!$sel) echo "selected=\"selected\""; ?>><?=gettext("Network"); ?></option>
|
|
351 | 352 |
<?php if(have_ruleint_access("pptp")): ?> |
352 |
<option value="pptp" <?php if ($pconfig['src'] == "pptp") { echo "selected"; } ?>><?=gettext("PPTP clients"); ?></option> |
|
353 |
<option value="pptp" <?php if ($pconfig['src'] == "pptp") { echo "selected=\"selected\""; } ?>><?=gettext("PPTP clients"); ?></option>
|
|
353 | 354 |
<?php endif; ?> |
354 | 355 |
<?php if(have_ruleint_access("pppoe")): ?> |
355 |
<option value="pppoe" <?php if ($pconfig['src'] == "pppoe") { echo "selected"; } ?>><?=gettext("PPPoE clients"); ?></option> |
|
356 |
<option value="pppoe" <?php if ($pconfig['src'] == "pppoe") { echo "selected=\"selected\""; } ?>><?=gettext("PPPoE clients"); ?></option>
|
|
356 | 357 |
<?php endif; ?> |
357 | 358 |
<?php if(have_ruleint_access("l2tp")): ?> |
358 |
<option value="l2tp" <?php if ($pconfig['src'] == "l2tp") { echo "selected"; } ?>><?=gettext("L2TP clients"); ?></option> |
|
359 |
<option value="l2tp" <?php if ($pconfig['src'] == "l2tp") { echo "selected=\"selected\""; } ?>><?=gettext("L2TP clients"); ?></option>
|
|
359 | 360 |
<?php endif; ?> |
360 | 361 |
<?php |
361 | 362 |
foreach ($ifdisp as $ifent => $ifdesc): ?> |
362 | 363 |
<?php if(have_ruleint_access($ifent)): ?> |
363 |
<option value="<?=$ifent;?>" <?php if ($pconfig['src'] == $ifent) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("subnet"); ?></option> |
|
364 |
<option value="<?=$ifent;?>ip"<?php if ($pconfig['src'] == $ifent . "ip") { echo "selected"; } ?>> |
|
364 |
<option value="<?=$ifent;?>" <?php if ($pconfig['src'] == $ifent) { echo "selected=\"selected\""; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("subnet"); ?></option>
|
|
365 |
<option value="<?=$ifent;?>ip"<?php if ($pconfig['src'] == $ifent . "ip") { echo "selected=\"selected\""; } ?>>
|
|
365 | 366 |
<?=$ifdesc?> <?=gettext("address");?> |
366 | 367 |
</option> |
367 | 368 |
<?php endif; endforeach; ?> |
... | ... | |
371 | 372 |
<tr> |
372 | 373 |
<td><?=gettext("Address:"); ?> </td> |
373 | 374 |
<td> |
374 |
<input name="src" type="text" class="formfld" id="src" size="20" value="<?php if (!is_specialnet($pconfig['src'])) echo htmlspecialchars($pconfig['src']);?>"> / |
|
375 |
<input name="src" type="text" class="formfld" id="src" size="20" value="<?php if (!is_specialnet($pconfig['src'])) echo htmlspecialchars($pconfig['src']);?>" /> /
|
|
375 | 376 |
<select name="srcmask" class="formselect" id="srcmask"> |
376 | 377 |
<?php for ($i = 31; $i > 0; $i--): ?> |
377 |
<option value="<?=$i;?>" <?php if ($i == $pconfig['srcmask']) echo "selected"; ?>><?=$i;?></option> |
|
378 |
<option value="<?=$i;?>" <?php if ($i == $pconfig['srcmask']) echo "selected=\"selected\""; ?>><?=$i;?></option>
|
|
378 | 379 |
<?php endfor; ?> |
379 | 380 |
</select> |
380 | 381 |
</td> |
... | ... | |
387 | 388 |
<tr> |
388 | 389 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Destination"); ?></td> |
389 | 390 |
<td width="78%" class="vtable"> |
390 |
<input name="dstnot" type="checkbox" id="dstnot" value="yes" <?php if ($pconfig['dstnot']) echo "checked"; ?>>
|
|
391 |
<input name="dstnot" type="checkbox" id="dstnot" value="yes" <?php if ($pconfig['dstnot']) echo "checked=\"checked\""; ?> />
|
|
391 | 392 |
<strong><?=gettext("not"); ?></strong> |
392 | 393 |
<br /> |
393 | 394 |
<?=gettext("Use this option to invert the sense of the match."); ?> |
394 | 395 |
<br /> |
395 | 396 |
<br /> |
396 |
<table border="0" cellspacing="0" cellpadding="0"> |
|
397 |
<table border="0" cellspacing="0" cellpadding="0" summary="destination">
|
|
397 | 398 |
<tr> |
398 | 399 |
<td><?=gettext("Type:"); ?> </td> |
399 | 400 |
<td> |
400 |
<select name="dsttype" class="formselect" onChange="typesel_change()">
|
|
401 |
<select name="dsttype" class="formselect" onchange="typesel_change()">
|
|
401 | 402 |
<?php |
402 | 403 |
$sel = is_specialnet($pconfig['dst']); ?> |
403 |
<option value="any" <?php if (empty($pconfig['dst']) || $pconfig['dst'] == "any") { echo "selected"; } ?>><?=gettext("any"); ?></option> |
|
404 |
<option value="single" <?php if (($pconfig['dstmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>><?=gettext("Single host or alias"); ?></option> |
|
405 |
<option value="network" <?php if (!$sel && !empty($pconfig['dst'])) echo "selected"; ?>><?=gettext("Network"); ?></option> |
|
404 |
<option value="any" <?php if (empty($pconfig['dst']) || $pconfig['dst'] == "any") { echo "selected=\"selected\""; } ?>><?=gettext("any"); ?></option>
|
|
405 |
<option value="single" <?php if (($pconfig['dstmask'] == 32) && !$sel) { echo "selected=\"selected\""; $sel = 1; } ?>><?=gettext("Single host or alias"); ?></option>
|
|
406 |
<option value="network" <?php if (!$sel && !empty($pconfig['dst'])) echo "selected=\"selected\""; ?>><?=gettext("Network"); ?></option>
|
|
406 | 407 |
<?php if(have_ruleint_access("pptp")): ?> |
407 |
<option value="pptp" <?php if ($pconfig['dst'] == "pptp") { echo "selected"; } ?>><?=gettext("PPTP clients"); ?></option> |
|
408 |
<option value="pptp" <?php if ($pconfig['dst'] == "pptp") { echo "selected=\"selected\""; } ?>><?=gettext("PPTP clients"); ?></option>
|
|
408 | 409 |
<?php endif; ?> |
409 | 410 |
<?php if(have_ruleint_access("pppoe")): ?> |
410 |
<option value="pppoe" <?php if ($pconfig['dst'] == "pppoe") { echo "selected"; } ?>><?=gettext("PPPoE clients"); ?></option> |
|
411 |
<option value="pppoe" <?php if ($pconfig['dst'] == "pppoe") { echo "selected=\"selected\""; } ?>><?=gettext("PPPoE clients"); ?></option>
|
|
411 | 412 |
<?php endif; ?> |
412 | 413 |
<?php if(have_ruleint_access("l2tp")): ?> |
413 |
<option value="l2tp" <?php if ($pconfig['dst'] == "l2tp") { echo "selected"; } ?>><?=gettext("L2TP clients"); ?></option> |
|
414 |
<option value="l2tp" <?php if ($pconfig['dst'] == "l2tp") { echo "selected=\"selected\""; } ?>><?=gettext("L2TP clients"); ?></option>
|
|
414 | 415 |
<?php endif; ?> |
415 | 416 |
|
416 | 417 |
<?php foreach ($ifdisp as $if => $ifdesc): ?> |
417 | 418 |
<?php if(have_ruleint_access($if)): ?> |
418 |
<option value="<?=$if;?>" <?php if ($pconfig['dst'] == $if) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("subnet"); ?></option> |
|
419 |
<option value="<?=$if;?>ip"<?php if ($pconfig['dst'] == $if . "ip") { echo "selected"; } ?>> |
|
419 |
<option value="<?=$if;?>" <?php if ($pconfig['dst'] == $if) { echo "selected=\"selected\""; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("subnet"); ?></option>
|
|
420 |
<option value="<?=$if;?>ip"<?php if ($pconfig['dst'] == $if . "ip") { echo "selected=\"selected\""; } ?>>
|
|
420 | 421 |
<?=$ifdesc;?> <?=gettext("address");?> |
421 | 422 |
</option> |
422 | 423 |
<?php endif; endforeach; ?> |
... | ... | |
426 | 427 |
<tr> |
427 | 428 |
<td><?=gettext("Address:"); ?> </td> |
428 | 429 |
<td> |
429 |
<input name="dst" type="text" autocomplete="off" class="formfldalias" id="dst" size="20" value="<?php if (!is_specialnet($pconfig['dst'])) echo htmlspecialchars($pconfig['dst']);?>"> |
|
430 |
<input name="dst" type="text" autocomplete="off" class="formfldalias" id="dst" size="20" value="<?php if (!is_specialnet($pconfig['dst'])) echo htmlspecialchars($pconfig['dst']);?>" />
|
|
430 | 431 |
/ |
431 | 432 |
<select name="dstmask" class="formselect" id="dstmask"> |
432 | 433 |
<?php |
433 | 434 |
for ($i = 31; $i > 0; $i--): ?> |
434 |
<option value="<?=$i;?>" <?php if ($i == $pconfig['dstmask']) echo "selected"; ?>><?=$i;?></option> |
|
435 |
<option value="<?=$i;?>" <?php if ($i == $pconfig['dstmask']) echo "selected=\"selected\""; ?>><?=$i;?></option>
|
|
435 | 436 |
<?php endfor; ?> |
436 | 437 |
</select> |
437 | 438 |
</td> |
438 | 439 |
</tr> |
439 | 440 |
</table> |
440 | 441 |
<br/> |
441 |
<span class="vexpl"><?=gettext("The 1:1 mapping will only be used for connections to or from the specified destination."); ?><br> |
|
442 |
<span class="vexpl"><?=gettext("The 1:1 mapping will only be used for connections to or from the specified destination."); ?><br/>
|
|
442 | 443 |
<?=gettext("Hint: this is usually 'any'."); ?></span> |
444 |
</td> |
|
443 | 445 |
</tr> |
444 | 446 |
<tr> |
445 | 447 |
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> |
446 | 448 |
<td width="78%" class="vtable"> |
447 |
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>"> |
|
449 |
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
|
|
448 | 450 |
<br/> <span class="vexpl"><?=gettext("You may enter a description here " . |
449 | 451 |
"for your reference (not parsed)."); ?></span></td> |
450 | 452 |
</tr> |
... | ... | |
452 | 454 |
<td width="22%" valign="top" class="vncell"><?=gettext("NAT reflection"); ?></td> |
453 | 455 |
<td width="78%" class="vtable"> |
454 | 456 |
<select name="natreflection" class="formselect"> |
455 |
<option value="default" <?php if ($pconfig['natreflection'] != "enable" && $pconfig['natreflection'] != "disable") echo "selected"; ?>><?=gettext("use system default"); ?></option> |
|
456 |
<option value="enable" <?php if ($pconfig['natreflection'] == "enable") echo "selected"; ?>><?=gettext("enable"); ?></option> |
|
457 |
<option value="disable" <?php if ($pconfig['natreflection'] == "disable") echo "selected"; ?>><?=gettext("disable"); ?></option> |
|
457 |
<option value="default" <?php if ($pconfig['natreflection'] != "enable" && $pconfig['natreflection'] != "disable") echo "selected=\"selected\""; ?>><?=gettext("use system default"); ?></option>
|
|
458 |
<option value="enable" <?php if ($pconfig['natreflection'] == "enable") echo "selected=\"selected\""; ?>><?=gettext("enable"); ?></option>
|
|
459 |
<option value="disable" <?php if ($pconfig['natreflection'] == "disable") echo "selected=\"selected\""; ?>><?=gettext("disable"); ?></option>
|
|
458 | 460 |
</select> |
459 | 461 |
</td> |
460 | 462 |
</tr> |
461 | 463 |
<tr> |
462 | 464 |
<td width="22%" valign="top"> </td> |
463 | 465 |
<td width="78%"> |
464 |
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()">
|
|
466 |
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" /> <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()" />
|
|
465 | 467 |
<?php if (isset($id) && $a_1to1[$id]): ?> |
466 |
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>">
|
|
468 |
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
|
|
467 | 469 |
<?php endif; ?> |
468 | 470 |
</td> |
469 | 471 |
</tr> |
470 | 472 |
</table> |
471 | 473 |
</form> |
472 |
<script language="JavaScript"> |
|
474 |
<script type="text/javascript"> |
|
475 |
//<![CDATA[ |
|
473 | 476 |
typesel_change(); |
477 |
//]]> |
|
474 | 478 |
</script> |
475 |
<script language="JavaScript">
|
|
479 |
<script type="text/javascript">
|
|
476 | 480 |
//<![CDATA[ |
477 | 481 |
var addressarray = <?= json_encode(get_alias_list(array("host", "network", "openvpn", "urltable"))) ?>; |
478 | 482 |
var oTextbox1 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray)); |
Also available in: Unified diff
Tidy up "firewall_nat_1to1_edit" XHTML
Add CDATA section to SCRIPT tag
Close BR and INPUT tags
Update HTML Boolean operators
Add missing closing TD tag