Projet

Général

Profil

« Précédent | Suivant » 

Révision 3a50eb39

Ajouté par Colin Fleming il y a presque 10 ans

Tidy up "vpn_ipsec_phase2.php" XHTML

Move script after the FBEGIN.INC include
Add CDATA sections to SCRIPTS
Add SUMMARY to TABLES
Close INPUT tags
Update HTML Boolean operators

Voir les différences:

usr/local/www/vpn_ipsec_phase2.php
324 324
?>
325 325

  
326 326
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
327
<script type="text/javascript" src="/javascript/jquery.ipv4v6ify.js"></script>
328 327
<?php include("fbegin.inc"); ?>
328
<script type="text/javascript" src="/javascript/jquery.ipv4v6ify.js"></script>
329 329
<script type="text/javascript">
330
<!--
330
//<![CDATA[
331 331

  
332 332
function change_mode() {
333 333
	index = document.iform.mode.selectedIndex;
......
477 477
		document.getElementById('opt_enc').style.display = 'none';
478 478
}
479 479

  
480
//-->
480
//]]>
481 481
</script>
482 482

  
483 483
<form action="vpn_ipsec_phase2.php" method="post" name="iform" id="iform">
......
487 487
		print_input_errors($input_errors);
488 488
?>
489 489

  
490
<table width="100%" border="0" cellpadding="0" cellspacing="0">
490
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="vpn ipsec phase-2">
491 491
	<tr class="tabnavtbl">
492 492
		<td id="tabnav">
493 493
			<?php
......
503 503
	<tr>
504 504
		<td id="mainarea">
505 505
			<div class="tabcont">
506
				<table width="100%" border="0" cellpadding="6" cellspacing="0">
506
				<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
507 507
					<tr>
508 508
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td>
509 509
						<td width="78%" class="vtable">
510
							<input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked"; ?>>
510
							<input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked=\"checked\""; ?> />
511 511
							<strong><?=gettext("Disable this phase2 entry"); ?></strong>
512 512
							<br />
513 513
							<span class="vexpl"><?=gettext("Set this option to disable this phase2 entry without " .
......
518 518
					<tr>
519 519
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Mode"); ?></td>
520 520
						<td width="78%" class="vtable">
521
							<select name="mode" class="formselect" onChange="change_mode()">
521
							<select name="mode" class="formselect" onchange="change_mode()">
522 522
								<?php
523 523
									foreach($p2_modes as $name => $value):
524 524
										$selected = "";
525 525
										if ($name == $pconfig['mode'])
526
											$selected = "selected";
526
											$selected = "selected=\"selected\"";
527 527
								?>
528 528
								<option value="<?=$name;?>" <?=$selected;?>><?=$value;?></option>
529 529
								<?php endforeach; ?>
......
533 533
					<tr id="opt_localid">
534 534
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Local Network"); ?></td>
535 535
						<td width="78%" class="vtable">
536
							<table border="0" cellspacing="0" cellpadding="0">
536
							<table border="0" cellspacing="0" cellpadding="0" summary="local network">
537 537
								<tr>
538 538
									<td><?=gettext("Type"); ?>:&nbsp;&nbsp;</td>
539 539
									<td></td>
540 540
									<td>
541
										<select name="localid_type" class="formselect" onChange="typesel_change_local()">
542
											<option value="address" <?php if ($pconfig['localid_type'] == "address") echo "selected";?>><?=gettext("Address"); ?></option>
543
											<option value="network" <?php if ($pconfig['localid_type'] == "network") echo "selected";?>><?=gettext("Network"); ?></option>
541
										<select name="localid_type" class="formselect" onchange="typesel_change_local()">
542
											<option value="address" <?php if ($pconfig['localid_type'] == "address") echo "selected=\"selected\"";?>><?=gettext("Address"); ?></option>
543
											<option value="network" <?php if ($pconfig['localid_type'] == "network") echo "selected=\"selected\"";?>><?=gettext("Network"); ?></option>
544 544
											<?php
545 545
												$iflist = get_configured_interface_with_descr();
546 546
												foreach ($iflist as $ifname => $ifdescr):
547 547
											?>
548
											<option value="<?=$ifname; ?>" <?php if ($pconfig['localid_type'] == $ifname ) echo "selected";?>><?=sprintf(gettext("%s subnet"), $ifdescr); ?></option>
548
											<option value="<?=$ifname; ?>" <?php if ($pconfig['localid_type'] == $ifname ) echo "selected=\"selected\"";?>><?=sprintf(gettext("%s subnet"), $ifdescr); ?></option>
549 549
											<?php endforeach; ?>
550 550
										</select>
551 551
									</td>
......
554 554
									<td><?=gettext("Address:");?>&nbsp;&nbsp;</td>
555 555
									<td><?=$mandfldhtmlspc;?></td>
556 556
									<td>
557
										<input name="localid_address" type="text" class="formfld unknown ipv4v6" id="localid_address" size="28" value="<?=htmlspecialchars($pconfig['localid_address']);?>">
557
										<input name="localid_address" type="text" class="formfld unknown ipv4v6" id="localid_address" size="28" value="<?=htmlspecialchars($pconfig['localid_address']);?>" />
558 558
										/
559 559
										<select name="localid_netbits" class="formselect ipv4v6" id="localid_netbits">
560 560
										<?php for ($i = 128; $i >= 0; $i--): ?>
561
											<option value="<?=$i;?>" <?php if (isset($pconfig['localid_netbits']) && $i == $pconfig['localid_netbits']) echo "selected"; ?>>
561
											<option value="<?=$i;?>" <?php if (isset($pconfig['localid_netbits']) && $i == $pconfig['localid_netbits']) echo "selected=\"selected\""; ?>>
562 562
												<?=$i;?>
563 563
											</option>
564 564
										<?php endfor; ?>
......
573 573
									<td><?=gettext("Type"); ?>:&nbsp;&nbsp;</td>
574 574
									<td></td>
575 575
									<td>
576
										<select name="natlocalid_type" class="formselect" onChange="typesel_change_natlocal()">
577
											<option value="address" <?php if ($pconfig['natlocalid_type'] == "address") echo "selected";?>><?=gettext("Address"); ?></option>
578
											<option value="network" <?php if ($pconfig['natlocalid_type'] == "network") echo "selected";?>><?=gettext("Network"); ?></option>
576
										<select name="natlocalid_type" class="formselect" onchange="typesel_change_natlocal()">
577
											<option value="address" <?php if ($pconfig['natlocalid_type'] == "address") echo "selected=\"selected\"";?>><?=gettext("Address"); ?></option>
578
											<option value="network" <?php if ($pconfig['natlocalid_type'] == "network") echo "selected=\"selected\"";?>><?=gettext("Network"); ?></option>
579 579
											<?php
580 580
												$iflist = get_configured_interface_with_descr();
581 581
												foreach ($iflist as $ifname => $ifdescr):
582 582
											?>
583
											<option value="<?=$ifname; ?>" <?php if ($pconfig['natlocalid_type'] == $ifname ) echo "selected";?>><?=sprintf(gettext("%s subnet"), $ifdescr); ?></option>
583
											<option value="<?=$ifname; ?>" <?php if ($pconfig['natlocalid_type'] == $ifname ) echo "selected=\"selected\"";?>><?=sprintf(gettext("%s subnet"), $ifdescr); ?></option>
584 584
											<?php endforeach; ?>
585
											<option value="none" <?php if (empty($pconfig['natlocalid_type']) || $pconfig['natlocalid_type'] == "none" ) echo "selected";?>><?=gettext("None"); ?></option>
585
											<option value="none" <?php if (empty($pconfig['natlocalid_type']) || $pconfig['natlocalid_type'] == "none" ) echo "selected=\"selected\"";?>><?=gettext("None"); ?></option>
586 586
										</select>
587 587
									</td>
588 588
								</tr>
......
590 590
									<td><?=gettext("Address:");?>&nbsp;&nbsp;</td>
591 591
									<td><?=$mandfldhtmlspc;?></td>
592 592
									<td>
593
										<input name="natlocalid_address" type="text" class="formfld unknown ipv4v6" id="natlocalid_address" size="28" value="<?=htmlspecialchars($pconfig['natlocalid_address']);?>">
593
										<input name="natlocalid_address" type="text" class="formfld unknown ipv4v6" id="natlocalid_address" size="28" value="<?=htmlspecialchars($pconfig['natlocalid_address']);?>" />
594 594
										/
595 595
										<select name="natlocalid_netbits" class="formselect ipv4v6" id="natlocalid_netbits">
596 596
										<?php for ($i = 128; $i >= 0; $i--): ?>
597
											<option value="<?=$i;?>" <?php if (isset($pconfig['natlocalid_netbits']) && $i == $pconfig['natlocalid_netbits']) echo "selected"; ?>>
597
											<option value="<?=$i;?>" <?php if (isset($pconfig['natlocalid_netbits']) && $i == $pconfig['natlocalid_netbits']) echo "selected=\"selected\""; ?>>
598 598
												<?=$i;?>
599 599
											</option>
600 600
										<?php endfor; ?>
......
610 610
					<tr id="opt_remoteid">
611 611
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Remote Network"); ?></td>
612 612
						<td width="78%" class="vtable">
613
							<table border="0" cellspacing="0" cellpadding="0">
613
							<table border="0" cellspacing="0" cellpadding="0" summary="remote network">
614 614
								<tr>
615 615
									<td><?=gettext("Type"); ?>:&nbsp;&nbsp;</td>
616 616
									<td></td>
617 617
									<td>
618
										<select name="remoteid_type" class="formselect" onChange="typesel_change_remote()">
619
											<option value="address" <?php if ($pconfig['remoteid_type'] == "address") echo "selected"; ?>><?=gettext("Address"); ?></option>
620
											<option value="network" <?php if ($pconfig['remoteid_type'] == "network") echo "selected"; ?>><?=gettext("Network"); ?></option>
618
										<select name="remoteid_type" class="formselect" onchange="typesel_change_remote()">
619
											<option value="address" <?php if ($pconfig['remoteid_type'] == "address") echo "selected=\"selected\""; ?>><?=gettext("Address"); ?></option>
620
											<option value="network" <?php if ($pconfig['remoteid_type'] == "network") echo "selected=\"selected\""; ?>><?=gettext("Network"); ?></option>
621 621
										</select>
622 622
									</td>
623 623
								</tr>
......
625 625
									<td><?=gettext("Address"); ?>:&nbsp;&nbsp;</td>
626 626
									<td><?=$mandfldhtmlspc;?></td>
627 627
									<td>
628
										<input name="remoteid_address" type="text" class="formfld unknown ipv4v6" id="remoteid_address" size="28" value="<?=htmlspecialchars($pconfig['remoteid_address']);?>">
628
										<input name="remoteid_address" type="text" class="formfld unknown ipv4v6" id="remoteid_address" size="28" value="<?=htmlspecialchars($pconfig['remoteid_address']);?>" />
629 629
										/
630 630
										<select name="remoteid_netbits" class="formselect ipv4v6" id="remoteid_netbits">
631 631
										<?php for ($i = 128; $i >= 0; $i--) { 
632 632
											
633 633
											echo "<option value=\"{$i}\"";
634
											if (isset($pconfig['remoteid_netbits']) && $i == $pconfig['remoteid_netbits']) echo " selected";
634
											if (isset($pconfig['remoteid_netbits']) && $i == $pconfig['remoteid_netbits']) echo " selected=\"selected\"";
635 635
											echo ">{$i}</option>\n";
636 636
											} ?>
637 637
										</select>
......
646 646
					<tr>
647 647
						<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
648 648
						<td width="78%" class="vtable">
649
							<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
649
							<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
650 650
							<br />
651 651
							<span class="vexpl">
652 652
								<?=gettext("You may enter a description here " .
......
665 665
					<tr>
666 666
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Protocol"); ?></td>
667 667
						<td width="78%" class="vtable">
668
							<select name="proto" class="formselect" onChange="change_protocol()">
668
							<select name="proto" class="formselect" onchange="change_protocol()">
669 669
							<?php foreach ($p2_protos as $proto => $protoname): ?>
670
								<option value="<?=$proto;?>" <?php if ($proto == $pconfig['proto']) echo "selected"; ?>>
670
								<option value="<?=$proto;?>" <?php if ($proto == $pconfig['proto']) echo "selected=\"selected\""; ?>>
671 671
									<?=htmlspecialchars($protoname);?>
672 672
								</option>
673 673
							<?php endforeach; ?>
......
681 681
					<tr id="opt_enc">
682 682
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Encryption algorithms"); ?></td>
683 683
						<td width="78%" class="vtable">
684
							<table border="0" cellspacing="0" cellpadding="0">
684
							<table border="0" cellspacing="0" cellpadding="0" summary="encryption">
685 685
							<?php
686 686
								foreach ($p2_ealgos as $algo => $algodata):
687 687
									$checked = '';
688 688
									if (is_array($pconfig['ealgos']) && in_array($algo,$pconfig['ealgos']))
689
										$checked = " checked";
689
										$checked = " checked=\"checked\"";
690 690
								?>
691 691
								<tr>
692 692
									<td>
693
										<input type="checkbox" name="ealgos[]" value="<?=$algo;?>"<?=$checked?>>
693
										<input type="checkbox" name="ealgos[]" value="<?=$algo;?>"<?=$checked?> />
694 694
									</td>
695 695
									<td>
696 696
										<?=htmlspecialchars($algodata['name']);?>
......
705 705
												$key_lo = $algodata['keysel']['lo'];
706 706
												$key_step = $algodata['keysel']['step'];
707 707
												for ($keylen = $key_hi; $keylen >= $key_lo; $keylen -= $key_step):
708
													$selected = '';
708
													$selected = "";
709 709
				//									if ($checked && in_array("keylen_".$algo,$pconfig))
710 710
													if ($keylen == $pconfig["keylen_".$algo])
711
														$selected = " selected";
711
														$selected = " selected=\"selected\"";
712 712
											?>
713 713
											<option value="<?=$keylen;?>"<?=$selected;?>><?=$keylen;?> <?=gettext("bits"); ?></option>
714 714
											<?php endfor; ?>
......
730 730
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Hash algorithms"); ?></td>
731 731
						<td width="78%" class="vtable">
732 732
						<?php foreach ($p2_halgos as $algo => $algoname): ?>
733
							<input type="checkbox" name="halgos[]" value="<?=$algo;?>" <?php if (in_array($algo, $pconfig['halgos'])) echo "checked"; ?>>
733
							<input type="checkbox" name="halgos[]" value="<?=$algo;?>" <?php if (in_array($algo, $pconfig['halgos'])) echo "checked=\"checked\""; ?> />
734 734
							<?=htmlspecialchars($algoname);?>
735 735
							<br />
736 736
						<?php endforeach; ?>
......
742 742
						<?php if (!isset($pconfig['mobile']) || !isset($a_client['pfs_group'])): ?>
743 743
							<select name="pfsgroup" class="formselect">
744 744
							<?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname): ?>
745
								<option value="<?=$keygroup;?>" <?php if ($keygroup == $pconfig['pfsgroup']) echo "selected"; ?>>
745
								<option value="<?=$keygroup;?>" <?php if ($keygroup == $pconfig['pfsgroup']) echo "selected=\"selected\""; ?>>
746 746
									<?=htmlspecialchars($keygroupname);?>
747 747
								</option>
748 748
							<?php endforeach; ?>
......
750 750
							<br />
751 751
							<?php else: ?>
752 752

  
753
							<select class="formselect" disabled>
754
								<option selected><?=$p2_pfskeygroups[$a_client['pfs_group']];?></option>
753
							<select class="formselect" disabled="disabled">
754
								<option selected="selected"><?=$p2_pfskeygroups[$a_client['pfs_group']];?></option>
755 755
							</select>
756
							<input name="pfsgroup" type="hidden" value="<?=htmlspecialchars($pconfig['pfsgroup']);?>">
756
							<input name="pfsgroup" type="hidden" value="<?=htmlspecialchars($pconfig['pfsgroup']);?>" />
757 757
							<br />
758 758
							<span class="vexpl"><em><?=gettext("Set globally in mobile client options"); ?></em></span>
759 759
						<?php endif; ?>
......
762 762
					<tr>
763 763
						<td width="22%" valign="top" class="vncell"><?=gettext("Lifetime"); ?></td>
764 764
						<td width="78%" class="vtable">
765
							<input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="20" value="<?=htmlspecialchars($pconfig['lifetime']);?>">
765
							<input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="20" value="<?=htmlspecialchars($pconfig['lifetime']);?>" />
766 766
							<?=gettext("seconds"); ?>
767 767
						</td>
768 768
					</tr>
......
775 775
					<tr>
776 776
						<td width="22%" valign="top" class="vncell"><?=gettext("Automatically ping host"); ?></td>
777 777
						<td width="78%" class="vtable">
778
							<input name="pinghost" type="text" class="formfld unknown" id="pinghost" size="28" value="<?=htmlspecialchars($pconfig['pinghost']);?>">
778
							<input name="pinghost" type="text" class="formfld unknown" id="pinghost" size="28" value="<?=htmlspecialchars($pconfig['pinghost']);?>" />
779 779
							<?=gettext("IP address"); ?>
780 780
						</td>
781 781
					</tr>
......
783 783
						<td width="22%" valign="top">&nbsp;</td>
784 784
						<td width="78%">
785 785
						<?php if (isset($p2index) && $a_phase2[$p2index]): ?>
786
							<input name="p2index" type="hidden" value="<?=htmlspecialchars($p2index);?>">
786
							<input name="p2index" type="hidden" value="<?=htmlspecialchars($p2index);?>" />
787 787
						<?php endif; ?>
788 788
						<?php if ($pconfig['mobile']): ?>
789
							<input name="mobile" type="hidden" value="true">
790
							<input name="remoteid_type" type="hidden" value="mobile">
789
							<input name="mobile" type="hidden" value="true" />
790
							<input name="remoteid_type" type="hidden" value="mobile" />
791 791
						<?php endif; ?>
792
							<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>">
793
							<input name="ikeid" type="hidden" value="<?=htmlspecialchars($pconfig['ikeid']);?>">
792
							<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
793
							<input name="ikeid" type="hidden" value="<?=htmlspecialchars($pconfig['ikeid']);?>" />
794 794
						</td>
795 795
					</tr>
796 796
				</table>
......
799 799
	</tr>
800 800
</table>
801 801
</form>
802
<script lannguage="JavaScript">
803
<!--
802
<script type="text/javascript">
803
//<![CDATA[
804 804
change_mode('<?=htmlspecialchars($pconfig['mode'])?>');
805 805
change_protocol('<?=htmlspecialchars($pconfig['proto'])?>');
806 806
typesel_change_local(<?=htmlspecialchars($pconfig['localid_netbits'])?>);
......
808 808
<?php if (!isset($pconfig['mobile'])): ?>
809 809
typesel_change_remote(<?=htmlspecialchars($pconfig['remoteid_netbits'])?>);
810 810
<?php endif; ?>
811
//-->
811
//]]>
812 812
</script>
813 813
<?php include("fend.inc"); ?>
814 814
</body>
......
887 887
}
888 888

  
889 889
?>
890

  

Formats disponibles : Unified diff