Revision 1541e25f
Added by N0YB over 11 years ago
usr/local/www/firewall_nat_out_edit.php | ||
---|---|---|
473 | 473 |
$interfaces["openvpn"] = "OpenVPN"; |
474 | 474 |
|
475 | 475 |
foreach ($interfaces as $iface => $ifacename): ?> |
476 |
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>> |
|
476 |
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo " selected=\"selected\""; ?>>
|
|
477 | 477 |
<?=htmlspecialchars($ifacename);?> |
478 | 478 |
</option> |
479 | 479 |
<?php endforeach; ?> |
... | ... | |
487 | 487 |
<select name="protocol" class="formselect" onchange="proto_change();"> |
488 | 488 |
<?php $protocols = explode(" ", "any TCP UDP TCP/UDP ICMP ESP AH GRE IPV6 IGMP carp pfsync"); |
489 | 489 |
foreach ($protocols as $proto): ?> |
490 |
<option value="<?=strtolower($proto);?>" <?php if (strtolower($proto) == $pconfig['protocol']) echo "selected=\"selected\""; ?>><?=htmlspecialchars($proto);?></option> |
|
490 |
<option value="<?=strtolower($proto);?>" <?php if (strtolower($proto) == $pconfig['protocol']) echo " selected=\"selected\""; ?>><?=htmlspecialchars($proto);?></option>
|
|
491 | 491 |
<?php endforeach; ?> |
492 | 492 |
</select> <br/> <span class="vexpl"><?=gettext("Choose which protocol this rule should match.");?><br /> |
493 | 493 |
<?php printf(gettext("Hint: in most cases, you should specify %s any %s here."),"<em>","</em> ");?></span> |
... | ... | |
501 | 501 |
<td><?=gettext("Type:");?> </td> |
502 | 502 |
<td> |
503 | 503 |
<select name="source_type" class="formselect" onchange="sourcesel_change()"> |
504 |
<option value="any" <?php if ($pconfig['source'] == "any") echo "selected=\"selected\""; ?>><?=gettext("any");?></option> |
|
505 |
<option value="network" <?php if ($pconfig['source'] != "any") echo "selected=\"selected\""; ?>><?=gettext("Network");?></option> |
|
504 |
<option value="any" <?php if ($pconfig['source'] == "any") echo " selected=\"selected\""; ?>><?=gettext("any");?></option>
|
|
505 |
<option value="network" <?php if ($pconfig['source'] != "any") echo " selected=\"selected\""; ?>><?=gettext("Network");?></option>
|
|
506 | 506 |
</select> |
507 | 507 |
</td> |
508 | 508 |
</tr> |
509 | 509 |
<tr> |
510 | 510 |
<td><?=gettext("Address:");?> </td> |
511 |
<td><input name="source" type="text" autocomplete="off" class="formfldalias" id="source" size="20" value="<?=htmlspecialchars($pconfig['source']);?>" />/<select name="source_subnet" class="formfld" id="source_subnet">
|
|
511 |
<td><input name="source" type="text" style="autocomplete:off" class="formfldalias" id="source" size="20" value="<?=htmlspecialchars($pconfig['source']);?>" />/<select name="source_subnet" class="formfld" id="source_subnet">
|
|
512 | 512 |
<?php for ($i = 32; $i >= 0; $i--): ?> |
513 | 513 |
<option value="<?=$i;?>"<?php if ($i == $pconfig['source_subnet']) echo " selected=\"selected\""; ?>><?=$i;?></option> |
514 | 514 |
<?php endfor; ?> |
... | ... | |
518 | 518 |
<td> </td> |
519 | 519 |
<td><span class="vexpl"><?=gettext("Enter the source network for the outbound NAT mapping.");?></span></td> |
520 | 520 |
</tr> |
521 |
<tr name="sport_tr" id="sport_tr">
|
|
521 |
<tr id="sport_tr"> |
|
522 | 522 |
<td><?=gettext("Source port:");?> </td> |
523 |
<td><input name="sourceport" type="text" autocomplete="off" class="formfldalias" id="sourceport" size="5" value="<?=htmlspecialchars($pconfig['sourceport']);?>" /> <?=gettext("(leave blank for any)");?></td>
|
|
523 |
<td><input name="sourceport" type="text" style="autocomplete:off" class="formfldalias" id="sourceport" size="5" value="<?=htmlspecialchars($pconfig['sourceport']);?>" /> <?=gettext("(leave blank for any)");?></td>
|
|
524 | 524 |
</tr> |
525 | 525 |
</table></td> |
526 | 526 |
</tr> |
... | ... | |
543 | 543 |
</tr> |
544 | 544 |
<tr> |
545 | 545 |
<td><?=gettext("Address:");?> </td> |
546 |
<td><input name="destination" type="text" autocomplete="off" class="formfldalias" id="destination" size="20" value="<?=htmlspecialchars($pconfig['destination']);?>" />
|
|
546 |
<td><input name="destination" type="text" style="autocomplete:off" class="formfldalias" id="destination" size="20" value="<?=htmlspecialchars($pconfig['destination']);?>" />
|
|
547 | 547 |
/ |
548 | 548 |
<select name="destination_subnet" class="formselect" id="destination_subnet"> |
549 | 549 |
<?php for ($i = 32; $i >= 0; $i--): ?> |
... | ... | |
556 | 556 |
<td><span class="vexpl"><?=gettext("Enter the destination network for ". |
557 | 557 |
"the outbound NAT mapping.");?></span></td> |
558 | 558 |
</tr> |
559 |
<tr name="dport_tr" id="dport_tr">
|
|
559 |
<tr id="dport_tr"> |
|
560 | 560 |
<td><?=gettext("Destination port:");?> </td> |
561 |
<td><input name="dstport" type="text" autocomplete="off" class="formfldalias" id="dstport" size="5" value="<?=htmlspecialchars($pconfig['dstport']);?>" /> <?=gettext("(leave blank for any)");?></td>
|
|
561 |
<td><input name="dstport" type="text" style="autocomplete:off" class="formfldalias" id="dstport" size="5" value="<?=htmlspecialchars($pconfig['dstport']);?>" /> <?=gettext("(leave blank for any)");?></td>
|
|
562 | 562 |
</tr> |
563 | 563 |
</table> |
564 | 564 |
</td> |
565 | 565 |
</tr> |
566 |
<tr name="transtable" id="transtable">
|
|
566 |
<tr id="transtable"> |
|
567 | 567 |
<td width="22%" valign="top" class="vncell"><?=gettext("Translation");?></td> |
568 | 568 |
<td width="78%" class="vtable"> |
569 | 569 |
<table border="0" cellspacing="1" cellpadding="1" summary="translation"> |
... | ... | |
579 | 579 |
$start = ip2long32(gen_subnet($sn['subnet'], $sn['subnet_bits'])); |
580 | 580 |
$end = ip2long32(gen_subnet_max($sn['subnet'], $sn['subnet_bits'])); |
581 | 581 |
$len = $end - $start; ?> |
582 |
<option value="<?=$sn['subnet'].'/'.$sn['subnet_bits'];?>" <?php if ($sn['subnet'].'/'.$sn['subnet_bits'] == $pconfig['target']) echo "selected=\"selected\""; ?>><?=htmlspecialchars("Subnet: {$sn['subnet']}/{$sn['subnet_bits']} ({$sn['descr']})");?></option> |
|
582 |
<option value="<?=$sn['subnet'].'/'.$sn['subnet_bits'];?>" <?php if ($sn['subnet'].'/'.$sn['subnet_bits'] == $pconfig['target']) echo " selected=\"selected\""; ?>><?=htmlspecialchars("Subnet: {$sn['subnet']}/{$sn['subnet_bits']} ({$sn['descr']})");?></option>
|
|
583 | 583 |
<?php for ($i = 0; $i <= $len; $i++): |
584 | 584 |
$snip = long2ip32($start+$i); |
585 | 585 |
?> |
586 | 586 |
<option value="<?=$snip;?>" <?php if ($snip == $pconfig['target']) echo "selected"; ?>><?=htmlspecialchars("{$snip} ({$sn['descr']})");?></option> |
587 | 587 |
<?php endfor; ?> |
588 | 588 |
<?php else: ?> |
589 |
<option value="<?=$sn['subnet'];?>" <?php if ($sn['subnet'] == $pconfig['target']) echo "selected=\"selected\""; ?>><?=htmlspecialchars("{$sn['subnet']} ({$sn['descr']})");?></option> |
|
589 |
<option value="<?=$sn['subnet'];?>" <?php if ($sn['subnet'] == $pconfig['target']) echo " selected=\"selected\""; ?>><?=htmlspecialchars("{$sn['subnet']} ({$sn['descr']})");?></option>
|
|
590 | 590 |
<?php endif; endforeach; |
591 | 591 |
endif; |
592 | 592 |
foreach ($a_aliases as $alias): |
593 | 593 |
if ($alias['type'] != "host") |
594 | 594 |
continue; ?> |
595 |
<option value="<?=$alias['name'];?>" <?php if ($alias['name'] == $pconfig['target']) echo "selected=\"selected\""; ?>><?=htmlspecialchars("Host Alias: {$alias['name']} ({$alias['descr']})");?></option> |
|
595 |
<option value="<?=$alias['name'];?>" <?php if ($alias['name'] == $pconfig['target']) echo " selected=\"selected\""; ?>><?=htmlspecialchars("Host Alias: {$alias['name']} ({$alias['descr']})");?></option>
|
|
596 | 596 |
<?php endforeach; ?> |
597 | 597 |
<option value="other-subnet"<?php if($pconfig['target'] == "other-subnet") echo " selected=\"selected\""; ?>><?=gettext("Other Subnet (Enter Below)");?></option> |
598 | 598 |
</select> |
... | ... | |
620 | 620 |
<td valign="top">Pool Options</td> |
621 | 621 |
<td> |
622 | 622 |
<select name="poolopts" id="poolopts"> |
623 |
<option value="" <?php if ($pconfig['poolopts'] == "" ) echo "selected=\"selected\""; ?>><?=htmlspecialchars("Default" );?></option> |
|
624 |
<option value="round-robin" <?php if ($pconfig['poolopts'] == "round-robin" ) echo "selected=\"selected\""; ?>><?=htmlspecialchars("Round Robin" );?></option> |
|
625 |
<option value="round-robin sticky-address" <?php if ($pconfig['poolopts'] == "round-robin sticky-address") echo "selected=\"selected\""; ?>><?=htmlspecialchars("Round Robin with Sticky Address");?></option> |
|
626 |
<option value="random" <?php if ($pconfig['poolopts'] == "random" ) echo "selected=\"selected\""; ?>><?=htmlspecialchars("Random" );?></option> |
|
627 |
<option value="random sticky-address" <?php if ($pconfig['poolopts'] == "random sticky-address" ) echo "selected=\"selected\""; ?>><?=htmlspecialchars("Random with Sticky Address" );?></option> |
|
628 |
<option value="source-hash" <?php if ($pconfig['poolopts'] == "source-hash" ) echo "selected=\"selected\""; ?>><?=htmlspecialchars("Source Hash" );?></option> |
|
629 |
<option value="bitmask" <?php if ($pconfig['poolopts'] == "bitmask" ) echo "selected=\"selected\""; ?>><?=htmlspecialchars("Bitmask" );?></option> |
|
623 |
<option value="" <?php if ($pconfig['poolopts'] == "" ) echo " selected=\"selected\""; ?>><?=htmlspecialchars("Default" );?></option>
|
|
624 |
<option value="round-robin" <?php if ($pconfig['poolopts'] == "round-robin" ) echo " selected=\"selected\""; ?>><?=htmlspecialchars("Round Robin" );?></option>
|
|
625 |
<option value="round-robin sticky-address" <?php if ($pconfig['poolopts'] == "round-robin sticky-address") echo " selected=\"selected\""; ?>><?=htmlspecialchars("Round Robin with Sticky Address");?></option>
|
|
626 |
<option value="random" <?php if ($pconfig['poolopts'] == "random" ) echo " selected=\"selected\""; ?>><?=htmlspecialchars("Random" );?></option>
|
|
627 |
<option value="random sticky-address" <?php if ($pconfig['poolopts'] == "random sticky-address" ) echo " selected=\"selected\""; ?>><?=htmlspecialchars("Random with Sticky Address" );?></option>
|
|
628 |
<option value="source-hash" <?php if ($pconfig['poolopts'] == "source-hash" ) echo " selected=\"selected\""; ?>><?=htmlspecialchars("Source Hash" );?></option>
|
|
629 |
<option value="bitmask" <?php if ($pconfig['poolopts'] == "bitmask" ) echo " selected=\"selected\""; ?>><?=htmlspecialchars("Bitmask" );?></option>
|
|
630 | 630 |
</select><br/> |
631 | 631 |
<span class="vexpl"> |
632 | 632 |
<?=gettext("Only Round Robin types work with Host Aliases. Any type can be used with a Subnet.");?><br/> |
... | ... | |
638 | 638 |
</span><br/> |
639 | 639 |
</td> |
640 | 640 |
</tr> |
641 |
<tr name="tport_tr" id="tport_tr">
|
|
641 |
<tr id="tport_tr"> |
|
642 | 642 |
<td><?=gettext("Port:");?> </td> |
643 | 643 |
<td><input name="natport" type="text" class="formfld unknown" id="natport" size="5" value="<?=htmlspecialchars($pconfig['natport']);?>" /></td> |
644 | 644 |
</tr> |
645 |
<tr name="tporttext_tr" id="tporttext_tr"><td> </td><td>
|
|
645 |
<tr id="tporttext_tr"><td> </td><td> |
|
646 | 646 |
<span class="vexpl"><?=gettext("Enter the source port for the outbound NAT mapping.");?></span> |
647 | 647 |
</td></tr> |
648 |
<tr name="tportstatic_tr" id="tportstatic_tr">
|
|
648 |
<tr id="tportstatic_tr"> |
|
649 | 649 |
<td><?=gettext("Static-port:");?> </td> |
650 | 650 |
<td><input onchange="staticportchange();" name="staticnatport" type="checkbox" class="formfld" id="staticnatport" size="5"<?php if($pconfig['staticnatport']) echo " checked=\"checked\"";?> /></td> |
651 | 651 |
</tr> |
... | ... | |
711 | 711 |
</table> |
712 | 712 |
</form> |
713 | 713 |
<script type="text/javascript"> |
714 |
//<![CDATA[ |
|
715 |
var autocomplete_off = ['source', 'sourceport', 'destination', 'dstport'']; |
|
716 |
for (var i = 0; i < autocomplete_off.length; i++) { |
|
717 |
var node = document.getElementById(autocomplete_off[i]); |
|
718 |
node.setAttribute("autocomplete",node.style.autocomplete); |
|
719 |
} |
|
720 |
//]]> |
|
721 |
</script> |
|
722 |
<script type="text/javascript"> |
|
714 | 723 |
//<![CDATA[ |
715 | 724 |
sourcesel_change(); |
716 | 725 |
typesel_change(); |
Also available in: Unified diff
XHTML Compliance
Firewall - NAT - Outbound - Edit