Révision a0fca224
Ajouté par Colin Fleming il y a presque 10 ans
usr/local/www/vpn_ipsec_phase1.php | ||
---|---|---|
380 | 380 |
<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> |
381 | 381 |
<?php include("fbegin.inc"); ?> |
382 | 382 |
<script type="text/javascript"> |
383 |
<!--
|
|
383 |
//<![CDATA[
|
|
384 | 384 |
|
385 | 385 |
function myidsel_change() { |
386 | 386 |
index = document.iform.myid_type.selectedIndex; |
... | ... | |
490 | 490 |
document.iform.dpd_maxfail.value = "5"; |
491 | 491 |
} |
492 | 492 |
|
493 |
//-->
|
|
493 |
//]]>
|
|
494 | 494 |
</script> |
495 | 495 |
|
496 | 496 |
<form action="vpn_ipsec_phase1.php" method="post" name="iform" id="iform"> |
... | ... | |
500 | 500 |
print_input_errors($input_errors); |
501 | 501 |
?> |
502 | 502 |
|
503 |
<table width="100%" border="0" cellpadding="0" cellspacing="0"> |
|
503 |
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="vpn ipsec phase-1">
|
|
504 | 504 |
<tr class="tabnavtbl"> |
505 | 505 |
<td id="tabnav"> |
506 | 506 |
<?php |
... | ... | |
516 | 516 |
<tr> |
517 | 517 |
<td id="mainarea"> |
518 | 518 |
<div class="tabcont"> |
519 |
<table width="100%" border="0" cellpadding="6" cellspacing="0"> |
|
519 |
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
|
|
520 | 520 |
<tr> |
521 | 521 |
<td colspan="2" valign="top" class="listtopic"><?=gettext("General information"); ?></td> |
522 | 522 |
</tr> |
523 | 523 |
<tr> |
524 | 524 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td> |
525 | 525 |
<td width="78%" class="vtable"> |
526 |
<input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked"; ?>>
|
|
526 |
<input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked=\"checked\""; ?> />
|
|
527 | 527 |
<strong><?=gettext("Disable this phase1 entry"); ?></strong><br /> |
528 | 528 |
<span class="vexpl"> |
529 | 529 |
<?=gettext("Set this option to disable this phase1 without " . |
... | ... | |
539 | 539 |
$keyexchange = array("ikev1" => "V1", "ikev2" => "V2"); |
540 | 540 |
foreach ($keyexchange as $kidx => $name): |
541 | 541 |
?> |
542 |
<option value="<?=$kidx;?>" <?php if ($kidx == $pconfig['iketype']) echo "selected"; ?>> |
|
542 |
<option value="<?=$kidx;?>" <?php if ($kidx == $pconfig['iketype']) echo "selected=\"selected\""; ?>>
|
|
543 | 543 |
<?=htmlspecialchars($name);?> |
544 | 544 |
</option> |
545 | 545 |
<?php endforeach; ?> |
... | ... | |
554 | 554 |
$protocols = array("inet" => "IPv4", "inet6" => "IPv6"); |
555 | 555 |
foreach ($protocols as $protocol => $name): |
556 | 556 |
?> |
557 |
<option value="<?=$protocol;?>" <?php if ($protocol == $pconfig['protocol']) echo "selected"; ?>> |
|
557 |
<option value="<?=$protocol;?>" <?php if ($protocol == $pconfig['protocol']) echo "selected=\"selected\""; ?>>
|
|
558 | 558 |
<?=htmlspecialchars($name);?> |
559 | 559 |
</option> |
560 | 560 |
<?php endforeach; ?> |
... | ... | |
588 | 588 |
|
589 | 589 |
foreach ($interfaces as $iface => $ifacename): |
590 | 590 |
?> |
591 |
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>> |
|
591 |
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>>
|
|
592 | 592 |
<?=htmlspecialchars($ifacename);?> |
593 | 593 |
</option> |
594 | 594 |
<?php endforeach; ?> |
... | ... | |
603 | 603 |
<tr> |
604 | 604 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Remote gateway"); ?></td> |
605 | 605 |
<td width="78%" class="vtable"> |
606 |
<?=$mandfldhtml;?><input name="remotegw" type="text" class="formfld unknown" id="remotegw" size="28" value="<?=htmlspecialchars($pconfig['remotegw']);?>"> |
|
606 |
<?=$mandfldhtml;?><input name="remotegw" type="text" class="formfld unknown" id="remotegw" size="28" value="<?=htmlspecialchars($pconfig['remotegw']);?>" />
|
|
607 | 607 |
<br /> |
608 | 608 |
<?=gettext("Enter the public IP address or host name of the remote gateway"); ?> |
609 | 609 |
</td> |
... | ... | |
614 | 614 |
<tr> |
615 | 615 |
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> |
616 | 616 |
<td width="78%" class="vtable"> |
617 |
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>"> |
|
617 |
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
|
|
618 | 618 |
<br /> |
619 | 619 |
<span class="vexpl"> |
620 | 620 |
<?=gettext("You may enter a description here " . |
... | ... | |
633 | 633 |
<tr> |
634 | 634 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Authentication method"); ?></td> |
635 | 635 |
<td width="78%" class="vtable"> |
636 |
<select name="authentication_method" class="formselect" onChange="methodsel_change()">
|
|
636 |
<select name="authentication_method" class="formselect" onchange="methodsel_change()">
|
|
637 | 637 |
<?php |
638 | 638 |
foreach ($p1_authentication_methods as $method_type => $method_params): |
639 | 639 |
if (!$pconfig['mobile'] && $method_params['mobile']) |
640 | 640 |
continue; |
641 | 641 |
?> |
642 |
<option value="<?=$method_type;?>" <?php if ($method_type == $pconfig['authentication_method']) echo "selected"; ?>> |
|
642 |
<option value="<?=$method_type;?>" <?php if ($method_type == $pconfig['authentication_method']) echo "selected=\"selected\""; ?>>
|
|
643 | 643 |
<?=htmlspecialchars($method_params['name']);?> |
644 | 644 |
</option> |
645 | 645 |
<?php endforeach; ?> |
... | ... | |
658 | 658 |
$modes = array("main" => "Main", "aggressive" => "Aggressive"); |
659 | 659 |
foreach ($modes as $mode => $mdescr): |
660 | 660 |
?> |
661 |
<option value="<?=$mode;?>" <?php if ($mode == $pconfig['mode']) echo "selected"; ?>> |
|
661 |
<option value="<?=$mode;?>" <?php if ($mode == $pconfig['mode']) echo "selected=\"selected\""; ?>>
|
|
662 | 662 |
<?=htmlspecialchars($mdescr);?> |
663 | 663 |
</option> |
664 | 664 |
<?php endforeach; ?> |
... | ... | |
668 | 668 |
<tr> |
669 | 669 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("My identifier"); ?></td> |
670 | 670 |
<td width="78%" class="vtable"> |
671 |
<select name="myid_type" class="formselect" onChange="myidsel_change()">
|
|
671 |
<select name="myid_type" class="formselect" onchange="myidsel_change()">
|
|
672 | 672 |
<?php foreach ($my_identifier_list as $id_type => $id_params): ?> |
673 |
<option value="<?=$id_type;?>" <?php if ($id_type == $pconfig['myid_type']) echo "selected"; ?>> |
|
673 |
<option value="<?=$id_type;?>" <?php if ($id_type == $pconfig['myid_type']) echo "selected=\"selected\""; ?>>
|
|
674 | 674 |
<?=htmlspecialchars($id_params['desc']);?> |
675 | 675 |
</option> |
676 | 676 |
<?php endforeach; ?> |
677 | 677 |
</select> |
678 |
<input name="myid_data" type="text" class="formfld unknown" id="myid_data" size="30" value="<?=htmlspecialchars($pconfig['myid_data']);?>"> |
|
678 |
<input name="myid_data" type="text" class="formfld unknown" id="myid_data" size="30" value="<?=htmlspecialchars($pconfig['myid_data']);?>" />
|
|
679 | 679 |
</td> |
680 | 680 |
</tr> |
681 | 681 |
<tr id="opt_peerid"> |
682 | 682 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Peer identifier"); ?></td> |
683 | 683 |
<td width="78%" class="vtable"> |
684 |
<select name="peerid_type" class="formselect" onChange="peeridsel_change()">
|
|
684 |
<select name="peerid_type" class="formselect" onchange="peeridsel_change()">
|
|
685 | 685 |
<?php |
686 | 686 |
foreach ($peer_identifier_list as $id_type => $id_params): |
687 | 687 |
if ($pconfig['mobile'] && !$id_params['mobile']) |
688 | 688 |
continue; |
689 | 689 |
?> |
690 |
<option value="<?=$id_type;?>" <?php if ($id_type == $pconfig['peerid_type']) echo "selected"; ?>> |
|
690 |
<option value="<?=$id_type;?>" <?php if ($id_type == $pconfig['peerid_type']) echo "selected=\"selected\""; ?>>
|
|
691 | 691 |
<?=htmlspecialchars($id_params['desc']);?> |
692 | 692 |
</option> |
693 | 693 |
<?php endforeach; ?> |
694 | 694 |
</select> |
695 |
<input name="peerid_data" type="text" class="formfld unknown" id="peerid_data" size="30" value="<?=htmlspecialchars($pconfig['peerid_data']);?>"> |
|
695 |
<input name="peerid_data" type="text" class="formfld unknown" id="peerid_data" size="30" value="<?=htmlspecialchars($pconfig['peerid_data']);?>" />
|
|
696 | 696 |
<?php if ($pconfig['mobile']) { ?> |
697 | 697 |
<br /><br /><?=gettext("NOTE: This is known as the \"group\" setting on some VPN client implementations"); ?>. |
698 | 698 |
<?php } ?> |
... | ... | |
702 | 702 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Pre-Shared Key"); ?></td> |
703 | 703 |
<td width="78%" class="vtable"> |
704 | 704 |
<?=$mandfldhtml;?> |
705 |
<input name="pskey" type="text" class="formfld unknown" id="pskey" size="40" value="<?=htmlspecialchars($pconfig['pskey']);?>"> |
|
705 |
<input name="pskey" type="text" class="formfld unknown" id="pskey" size="40" value="<?=htmlspecialchars($pconfig['pskey']);?>" />
|
|
706 | 706 |
<span class="vexpl"> |
707 | 707 |
<br /> |
708 | 708 |
<?=gettext("Input your Pre-Shared Key string"); ?>. |
... | ... | |
712 | 712 |
<tr> |
713 | 713 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Encryption algorithm"); ?></td> |
714 | 714 |
<td width="78%" class="vtable"> |
715 |
<select name="ealgo" class="formselect" onChange="ealgosel_change()">
|
|
715 |
<select name="ealgo" class="formselect" onchange="ealgosel_change()">
|
|
716 | 716 |
<?php |
717 | 717 |
foreach ($p1_ealgos as $algo => $algodata): |
718 |
$selected = '';
|
|
718 |
$selected = "";
|
|
719 | 719 |
if ($algo == $pconfig['ealgo']['name']) |
720 |
$selected = ' selected';
|
|
720 |
$selected = " selected=\"selected\"";
|
|
721 | 721 |
?> |
722 | 722 |
<option value="<?=$algo;?>"<?=$selected?>> |
723 | 723 |
<?=htmlspecialchars($algodata['name']);?> |
... | ... | |
733 | 733 |
<td width="78%" class="vtable"> |
734 | 734 |
<select name="halgo" class="formselect"> |
735 | 735 |
<?php foreach ($p1_halgos as $algo => $algoname): ?> |
736 |
<option value="<?=$algo;?>" <?php if ($algo == $pconfig['halgo']) echo "selected"; ?>> |
|
736 |
<option value="<?=$algo;?>" <?php if ($algo == $pconfig['halgo']) echo "selected=\"selected\""; ?>>
|
|
737 | 737 |
<?=htmlspecialchars($algoname);?> |
738 | 738 |
</option> |
739 | 739 |
<?php endforeach; ?> |
... | ... | |
749 | 749 |
<td width="78%" class="vtable"> |
750 | 750 |
<select name="dhgroup" class="formselect"> |
751 | 751 |
<?php foreach ($p1_dhgroups as $keygroup => $keygroupname): ?> |
752 |
<option value="<?=$keygroup;?>" <?php if ($keygroup == $pconfig['dhgroup']) echo "selected"; ?>> |
|
752 |
<option value="<?=$keygroup;?>" <?php if ($keygroup == $pconfig['dhgroup']) echo "selected=\"selected\""; ?>>
|
|
753 | 753 |
<?=htmlspecialchars($keygroupname);?> |
754 | 754 |
</option> |
755 | 755 |
<?php endforeach; ?> |
... | ... | |
763 | 763 |
<tr> |
764 | 764 |
<td width="22%" valign="top" class="vncell"><?=gettext("Lifetime"); ?></td> |
765 | 765 |
<td width="78%" class="vtable"> |
766 |
<input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="20" value="<?=htmlspecialchars($pconfig['lifetime']);?>"> |
|
766 |
<input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="20" value="<?=htmlspecialchars($pconfig['lifetime']);?>" />
|
|
767 | 767 |
<?=gettext("seconds"); ?> |
768 | 768 |
</td> |
769 | 769 |
</tr> |
770 | 770 |
<tr id="opt_cert"> |
771 | 771 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("My Certificate"); ?></td> |
772 | 772 |
<td width="78%" class="vtable"> |
773 |
<select name='certref' class="formselect">
|
|
773 |
<select name="certref" class="formselect">
|
|
774 | 774 |
<?php |
775 | 775 |
foreach ($config['cert'] as $cert): |
776 | 776 |
$selected = ""; |
777 | 777 |
if ($pconfig['certref'] == $cert['refid']) |
778 |
$selected = "selected"; |
|
778 |
$selected = "selected=\"selected\"";
|
|
779 | 779 |
?> |
780 | 780 |
<option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['descr'];?></option> |
781 | 781 |
<?php endforeach; ?> |
... | ... | |
789 | 789 |
<tr id="opt_ca"> |
790 | 790 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("My Certificate Authority"); ?></td> |
791 | 791 |
<td width="78%" class="vtable"> |
792 |
<select name='caref' class="formselect">
|
|
792 |
<select name="caref" class="formselect">
|
|
793 | 793 |
<?php |
794 | 794 |
foreach ($config['ca'] as $ca): |
795 | 795 |
$selected = ""; |
796 | 796 |
if ($pconfig['caref'] == $ca['refid']) |
797 |
$selected = "selected"; |
|
797 |
$selected = "selected=\"selected\"";
|
|
798 | 798 |
?> |
799 | 799 |
<option value="<?=$ca['refid'];?>" <?=$selected;?>><?=$ca['descr'];?></option> |
800 | 800 |
<?php endforeach; ?> |
... | ... | |
815 | 815 |
<td width="22%" valign="top" class="vncell"><?=gettext("NAT Traversal"); ?></td> |
816 | 816 |
<td width="78%" class="vtable"> |
817 | 817 |
<select name="nat_traversal" class="formselect"> |
818 |
<option value="off" <?php if ($pconfig['nat_traversal'] == "off") echo "selected"; ?>><?=gettext("Disable"); ?></option> |
|
819 |
<option value="on" <?php if ($pconfig['nat_traversal'] == "on") echo "selected"; ?>><?=gettext("Enable"); ?></option> |
|
820 |
<option value="force" <?php if ($pconfig['nat_traversal'] == "force") echo "selected"; ?>><?=gettext("Force"); ?></option> |
|
818 |
<option value="off" <?php if ($pconfig['nat_traversal'] == "off") echo "selected=\"selected\""; ?>><?=gettext("Disable"); ?></option>
|
|
819 |
<option value="on" <?php if ($pconfig['nat_traversal'] == "on") echo "selected=\"selected\""; ?>><?=gettext("Enable"); ?></option>
|
|
820 |
<option value="force" <?php if ($pconfig['nat_traversal'] == "force") echo "selected=\"selected\""; ?>><?=gettext("Force"); ?></option>
|
|
821 | 821 |
</select> |
822 | 822 |
<br /> |
823 | 823 |
<span class="vexpl"> |
... | ... | |
829 | 829 |
<tr> |
830 | 830 |
<td width="22%" valign="top" class="vncell"><?=gettext("Dead Peer Detection"); ?></td> |
831 | 831 |
<td width="78%" class="vtable"> |
832 |
<input name="dpd_enable" type="checkbox" id="dpd_enable" value="yes" <?php if (isset($pconfig['dpd_enable'])) echo "checked"; ?> onClick="dpdchkbox_change()">
|
|
832 |
<input name="dpd_enable" type="checkbox" id="dpd_enable" value="yes" <?php if (isset($pconfig['dpd_enable'])) echo "checked=\"checked\""; ?> onclick="dpdchkbox_change()" />
|
|
833 | 833 |
<?=gettext("Enable DPD"); ?><br /> |
834 | 834 |
<div id="opt_dpd"> |
835 | 835 |
<br /> |
836 |
<input name="dpd_delay" type="text" class="formfld unknown" id="dpd_delay" size="5" value="<?=htmlspecialchars($pconfig['dpd_delay']);?>"> |
|
836 |
<input name="dpd_delay" type="text" class="formfld unknown" id="dpd_delay" size="5" value="<?=htmlspecialchars($pconfig['dpd_delay']);?>" />
|
|
837 | 837 |
<?=gettext("seconds"); ?><br /> |
838 | 838 |
<span class="vexpl"> |
839 | 839 |
<?=gettext("Delay between requesting peer acknowledgement"); ?>. |
840 | 840 |
</span><br /> |
841 | 841 |
<br /> |
842 |
<input name="dpd_maxfail" type="text" class="formfld unknown" id="dpd_maxfail" size="5" value="<?=htmlspecialchars($pconfig['dpd_maxfail']);?>"> |
|
842 |
<input name="dpd_maxfail" type="text" class="formfld unknown" id="dpd_maxfail" size="5" value="<?=htmlspecialchars($pconfig['dpd_maxfail']);?>" />
|
|
843 | 843 |
<?=gettext("retries"); ?><br /> |
844 | 844 |
<span class="vexpl"> |
845 | 845 |
<?=gettext("Number of consecutive failures allowed before disconnect"); ?>. |
... | ... | |
852 | 852 |
<td width="22%" valign="top"> </td> |
853 | 853 |
<td width="78%"> |
854 | 854 |
<?php if (isset($p1index) && $a_phase1[$p1index]): ?> |
855 |
<input name="p1index" type="hidden" value="<?=htmlspecialchars($p1index);?>"> |
|
855 |
<input name="p1index" type="hidden" value="<?=htmlspecialchars($p1index);?>" />
|
|
856 | 856 |
<?php endif; ?> |
857 | 857 |
<?php if ($pconfig['mobile']): ?> |
858 |
<input name="mobile" type="hidden" value="true"> |
|
858 |
<input name="mobile" type="hidden" value="true" />
|
|
859 | 859 |
<?php endif; ?> |
860 |
<input name="ikeid" type="hidden" value="<?=htmlspecialchars($pconfig['ikeid']);?>"> |
|
861 |
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> |
|
860 |
<input name="ikeid" type="hidden" value="<?=htmlspecialchars($pconfig['ikeid']);?>" />
|
|
861 |
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
|
|
862 | 862 |
</td> |
863 | 863 |
</tr> |
864 | 864 |
</table> |
... | ... | |
868 | 868 |
</table> |
869 | 869 |
</form> |
870 | 870 |
|
871 |
<script lannguage="JavaScript">
|
|
872 |
<!--
|
|
871 |
<script type="text/javascript">
|
|
872 |
//<![CDATA[
|
|
873 | 873 |
<?php |
874 | 874 |
/* determine if we should init the key length */ |
875 | 875 |
$keyset = ''; |
... | ... | |
882 | 882 |
methodsel_change(); |
883 | 883 |
ealgosel_change(<?=$keyset;?>); |
884 | 884 |
dpdchkbox_change(); |
885 |
//-->
|
|
885 |
//]]>
|
|
886 | 886 |
</script> |
887 | 887 |
<?php include("fend.inc"); ?> |
888 | 888 |
</body> |
Formats disponibles : Unified diff
Tidy up "vpn_ipsec_phase1.php" XHTML
Add CDATA sections to SCRIPTS
Add SUMMARY to TABLES
Update HTML Boolean operators
Close INPUT tags