diff options
-rw-r--r-- | etc/inc/service-utils.inc | 3 | ||||
-rw-r--r-- | etc/inc/vpn.inc | 20 | ||||
-rw-r--r-- | usr/local/www/status_upnp.php | 11 | ||||
-rw-r--r-- | usr/local/www/vpn_ipsec.php | 10 | ||||
-rw-r--r-- | usr/local/www/vpn_ipsec_keys.php | 22 | ||||
-rw-r--r-- | usr/local/www/vpn_ipsec_keys_edit.php | 12 | ||||
-rw-r--r-- | usr/local/www/vpn_ipsec_mobile.php | 100 | ||||
-rw-r--r-- | usr/local/www/vpn_ipsec_phase1.php | 63 | ||||
-rw-r--r-- | usr/local/www/vpn_ipsec_phase2.php | 103 | ||||
-rw-r--r-- | usr/local/www/vpn_ipsec_settings.php | 2 | ||||
-rw-r--r-- | usr/local/www/wizard.php | 4 |
11 files changed, 176 insertions, 174 deletions
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc index 490724b..7c05176 100644 --- a/etc/inc/service-utils.inc +++ b/etc/inc/service-utils.inc @@ -430,6 +430,9 @@ function get_service_status($service) { case "dhcrelay6": $running = is_pid_running("{$g['varrun_path']}/dhcrelay6.pid"); break; + case 'ipsec': + $running = is_pid_running("{$g['varrun_path']}/charon.pid"); + break; default: $running = is_service_running($service['name']); } diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index 51adf1f..e84aefa 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -50,7 +50,7 @@ function vpn_ipsec_configure_loglevels() if (empty($config['ipsec']["ipsec_{$lkey}"])) mwexec("/usr/local/sbin/ipsec stroke loglevel {$lkey} -1", false); else if (is_numeric($config['ipsec']["ipsec_{$lkey}"]) && - intval($config['ipsec']["ipsec_{$lkey}"]) >= 1 && intval($config['ipsec']["ipsec_{$lkey}"]) <= 4) + intval($config['ipsec']["ipsec_{$lkey}"]) >= 1 && intval($config['ipsec']["ipsec_{$lkey}"]) <= 5) mwexec("/usr/local/sbin/ipsec stroke loglevel {$lkey} " . (intval($config['ipsec']["ipsec_{$lkey}"]) - 1) , false); } } @@ -533,9 +533,10 @@ EOD; continue; if (!isset($ph1ent['mobile'])) { - $rgip = $rgmap[$ph1ent['remote-gateway']]; - if (!$rgip) - continue; + $rgip = $ph1ent['remote-gateway']; + //$rgip = $rgmap[$ph1ent['remote-gateway']]; + //if (!$rgip) + // continue; } $myid_type = $ph1ent['myid_type']; @@ -561,7 +562,7 @@ EOD; case "asn1dn"; $myid_data = $ph1ent['myid_data']; if( $myid_data ) - $myid_data = "\"{$myid_data}\""; + $myid_data = "{$myid_data}"; break; } @@ -583,14 +584,10 @@ EOD; case "asn1dn"; $peerid_data = $ph1ent['peerid_data']; if( $peerid_data ) - $peerid_data = "\"{$peerid_data}\""; + $peerid_data = "{$peerid_data}"; break; } - $genp = "no"; - if (!empty($ph1ent['generate_policy']) && $ph1ent['generate_policy'] != "off") - $genp = "yes"; - $passive = "start"; if (isset($ph1ent['mobile'])) { $rgip = "%any"; @@ -698,7 +695,8 @@ EOD; } else { $tunneltype = "type = transport"; - $rgip = $rgmap[$ph1ent['remote-gateway']]; + //$rgip = $rgmap[$ph1ent['remote-gateway']]; + $rgip = $ph1ent['remote-gateway']; if ((($ph1ent['authentication_method'] == "xauth_psk_server") || ($ph1ent['authentication_method'] == "pre_shared_key")) diff --git a/usr/local/www/status_upnp.php b/usr/local/www/status_upnp.php index 0a7a997..72c9398 100644 --- a/usr/local/www/status_upnp.php +++ b/usr/local/www/status_upnp.php @@ -86,14 +86,16 @@ if(!$config['installedpackages'] || !$config['installedpackages']['miniupnpd'][' <td width="10%" class="listhdrr"><?=gettext("Port");?></td> <td width="10%" class="listhdrr"><?=gettext("Protocol");?></td> <td width="20%" class="listhdrr"><?=gettext("Internal IP");?></td> - <td width="60%" class="listhdr"><?=gettext("Description");?></td> + <td width="10%" class="listhdrr"><?=gettext("Int. Port");?></td> + <td width="50%" class="listhdr"><?=gettext("Description");?></td> </tr> <?php $i = 0; foreach ($rdr_entries as $rdr_entry) { - if (preg_match("/on (.*) inet proto (.*) from any to any port = (.*) label \"(.*)\" rtable [0-9] -> (.*) port (.*)/", $rdr_entry, $matches)) + if (preg_match("/on (.*) inet proto (.*) from any to any port = (.*) keep state label \"(.*)\" rtable [0-9] -> (.*) port (.*)/", $rdr_entry, $matches)) $rdr_proto = $matches[2]; $rdr_port = $matches[3]; - $rdr_ip = $matches[5]; $rdr_label =$matches[4]; + $rdr_ip = $matches[5]; + $rdr_iport = $matches[6]; ?> <tr> <td class="listlr"> @@ -106,6 +108,9 @@ if(!$config['installedpackages'] || !$config['installedpackages']['miniupnpd'][' <?php print $rdr_ip;?> </td> <td class="listlr"> + <?php print $rdr_iport;?> + </td> + <td class="listlr"> <?php print $rdr_label;?> </td> </tr> diff --git a/usr/local/www/vpn_ipsec.php b/usr/local/www/vpn_ipsec.php index 63926fa..726b9e7 100644 --- a/usr/local/www/vpn_ipsec.php +++ b/usr/local/www/vpn_ipsec.php @@ -184,6 +184,15 @@ include("head.inc"); <tr valign="top" ondblclick="document.location='vpn_ipsec_phase1.php?p1index=<?=$i;?>'"> <td class="listlr"> <?=$spans;?> + <?php if (empty($ph1ent['iketype']) || $ph1ent['iketype'] == "IKEv1") + echo "V1"; + else + echo "V2"; + ?> + <?=$spane;?> + </td> + <td class="listr"> + <?=$spans;?> <?php if ($ph1ent['interface']) { $iflabels = get_configured_interface_with_descr(); @@ -464,6 +473,7 @@ function show_ipsec_header($ph1ent) { $mobile = "&mobile=true"; ?> <tr> + <td class="listhdrr"><?=gettext("IKE"); ?></td> <td class="listhdrr"><?=gettext("Remote Gateway"); ?></td> <td class="listhdrr"><?=gettext("Mode"); ?></td> <td class="listhdrr"><?=gettext("P1 Protocol"); ?></td> diff --git a/usr/local/www/vpn_ipsec_keys.php b/usr/local/www/vpn_ipsec_keys.php index 986a2a4..51105b0 100644 --- a/usr/local/www/vpn_ipsec_keys.php +++ b/usr/local/www/vpn_ipsec_keys.php @@ -85,7 +85,7 @@ if (is_subsystem_dirty('ipsec')) print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect.")); ?> -<table width="100%" border="0" cellpadding="0" cellspacing="0"> +<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="vpn ipsec keys"> <tr><td class="tabnavtbl"> <?php $tab_array = array(); @@ -99,15 +99,15 @@ if (is_subsystem_dirty('ipsec')) <tr> <td> <div id="mainarea"> - <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> + <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area"> <tr> <td class="listhdrr"><?=gettext("Identifier"); ?></td> <td class="listhdr"><?=gettext("Pre-Shared Key"); ?></td> <td class="list"> - <table border="0" cellspacing="0" cellpadding="1"> + <table border="0" cellspacing="0" cellpadding="1" summary="add key"> <tr> - <td width="20" heigth="17"></td> - <td><a href="vpn_ipsec_keys_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add key"); ?>" width="17" height="17" border="0"></a></td> + <td width="20" height="17"></td> + <td><a href="vpn_ipsec_keys_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add key"); ?>" width="17" height="17" border="0" alt="add" /></a></td> </tr> </table> </td> @@ -120,7 +120,7 @@ if (is_subsystem_dirty('ipsec')) <td class="listr gray"> <?=htmlspecialchars($secretent['pre-shared-key']);?> </td> - <td class="list" nowrap><a href="system_usermanager.php?act=edit&id=<?=$secretent['id'];?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit key"); ?>" width="17" height="17" border="0"></a> + <td class="list nowrap"><a href="system_usermanager.php?act=edit&id=<?=$secretent['id'];?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit key"); ?>" width="17" height="17" border="0" alt="edit" /></a> </td> </tr> <?php $i++; endforeach; ?> @@ -133,17 +133,17 @@ if (is_subsystem_dirty('ipsec')) <td class="listr"> <?=htmlspecialchars($secretent['pre-shared-key']);?> </td> - <td class="list" nowrap> <a href="vpn_ipsec_keys_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit key"); ?>" width="17" height="17" border="0"></a> - <a href="vpn_ipsec_keys.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this Pre-Shared Key?"); ?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete key"); ?>" width="17" height="17" border="0"></a></td> + <td class="list nowrap"><a href="vpn_ipsec_keys_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit key"); ?>" width="17" height="17" border="0" alt="edit" /></a> + <a href="vpn_ipsec_keys.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this Pre-Shared Key?"); ?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete key"); ?>" width="17" height="17" border="0" alt="delete" /></a></td> </tr> <?php $i++; endforeach; ?> <tr> <td class="list" colspan="2"></td> <td class="list"> - <table border="0" cellspacing="0" cellpadding="1"> + <table border="0" cellspacing="0" cellpadding="1" summary="add key"> <tr> - <td width="20" heigth="17"></td> - <td><a href="vpn_ipsec_keys_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add key"); ?>" width="17" height="17" border="0"></a></td> + <td width="20" height="17"></td> + <td><a href="vpn_ipsec_keys_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add key"); ?>" width="17" height="17" border="0" alt="add" /></a></td> </tr> </table> </td> diff --git a/usr/local/www/vpn_ipsec_keys_edit.php b/usr/local/www/vpn_ipsec_keys_edit.php index 3339f7f..397e791 100644 --- a/usr/local/www/vpn_ipsec_keys_edit.php +++ b/usr/local/www/vpn_ipsec_keys_edit.php @@ -123,11 +123,11 @@ include("head.inc"); <?php include("fbegin.inc"); ?> <?php if ($input_errors) print_input_errors($input_errors); ?> <form action="vpn_ipsec_keys_edit.php" method="post" name="iform" id="iform"> - <table width="100%" border="0" cellpadding="6" cellspacing="0"> + <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="vpn ipsec keys edit"> <tr> <td valign="top" class="vncellreq"><?=gettext("Identifier"); ?></td> <td class="vtable"> - <?=$mandfldhtml;?><input name="ident" type="text" class="formfld unknown" id="ident" size="30" value="<?=htmlspecialchars($pconfig['ident']);?>"> + <?=$mandfldhtml;?><input name="ident" type="text" class="formfld unknown" id="ident" size="30" value="<?=htmlspecialchars($pconfig['ident']);?>" /> <br /> <?=gettext("This can be either an IP address, fully qualified domain name or an e-mail address"); ?>. </td> @@ -135,18 +135,20 @@ include("head.inc"); <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Pre-Shared Key"); ?></td> <td width="78%" class="vtable"> - <?=$mandfldhtml;?><input name="psk" type="text" class="formfld unknown" id="psk" size="40" value="<?=htmlspecialchars($pconfig['psk']);?>"> + <?=$mandfldhtml;?><input name="psk" type="text" class="formfld unknown" id="psk" size="40" value="<?=htmlspecialchars($pconfig['psk']);?>" /> </td> </tr> <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> + <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" /> <?php if (isset($id) && $a_secret[$id]): ?> - <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>"> + <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" /> <?php endif; ?> </td> </tr> </table> </form> <?php include("fend.inc"); ?> +</body> +</html> diff --git a/usr/local/www/vpn_ipsec_mobile.php b/usr/local/www/vpn_ipsec_mobile.php index af281d9..1fbb9e4 100644 --- a/usr/local/www/vpn_ipsec_mobile.php +++ b/usr/local/www/vpn_ipsec_mobile.php @@ -247,7 +247,7 @@ include("head.inc"); <?php include("fbegin.inc"); ?> <script type="text/javascript"> -<!-- +//<![CDATA[ function pool_change() { @@ -318,7 +318,7 @@ function login_banner_change() { document.iform.login_banner.disabled = 1; } -//--> +//]]> </script> <form action="vpn_ipsec_mobile.php" method="post" name="iform" id="iform"> @@ -337,7 +337,7 @@ function login_banner_change() { print_input_errors($input_errors); ?> -<table width="100%" border="0" cellpadding="0" cellspacing="0"> +<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="vpn ipsec mobile"> <tr> <td class="tabnavtbl"> <?php @@ -353,15 +353,15 @@ function login_banner_change() { <tr> <td id="mainarea"> <div class="tabcont"> - <table width="100%" border="0" cellpadding="6" cellspacing="0"> + <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area"> <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("IKE Extensions"); ?></td> <td width="78%" class="vtable"> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="ike extensions"> <tr> <td> <?php set_checked($pconfig['enable'],$chk); ?> - <input name="enable" type="checkbox" id="enable" value="yes" <?=$chk;?>> + <input name="enable" type="checkbox" id="enable" value="yes" <?=$chk;?> /> </td> <td> <strong><?=gettext("Enable IPsec Mobile Client Support"); ?></strong> @@ -382,14 +382,14 @@ function login_banner_change() { <td width="22%" valign="top" class="vncellreq"><?=gettext("User Authentication"); ?></td> <td width="78%" class="vtable"> <?=gettext("Source"); ?>: - <select name="user_source[]" class="formselect" id="user_source" multiple="true" size="3"> + <select name="user_source[]" class="formselect" id="user_source" multiple="multiple" size="3"> <?php $authmodes = explode(",", $pconfig['user_source']); $auth_servers = auth_get_authserver_list(); foreach ($auth_servers as $auth_server) { $selected = ""; if (in_array($auth_server['name'], $authmodes)) - $selected = "selected"; + $selected = "selected=\"selected\""; echo "<option value='{$auth_server['name']}' {$selected}>{$auth_server['name']}</option>\n"; } ?> @@ -402,7 +402,7 @@ function login_banner_change() { <?=gettext("Source"); ?>: <select name="group_source" class="formselect" id="group_source"> <option value="none"><?=gettext("none"); ?></option> - <option value="system" <?php if ($pconfig['group_source'] == "system") echo "selected"; ?> ><?=gettext("system"); ?></option> + <option value="system" <?php if ($pconfig['group_source'] == "system") echo "selected=\"selected\""; ?> ><?=gettext("system"); ?></option> </select> </td> </tr> @@ -417,26 +417,26 @@ function login_banner_change() { <tr> <td width="22%" valign="top" class="vncell"><?=gettext("Virtual Address Pool"); ?></td> <td width="78%" class="vtable"> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="enable pool"> <tr> <td> <?php set_checked($pconfig['pool_enable'],$chk); ?> - <input name="pool_enable" type="checkbox" id="pool_enable" value="yes" <?=$chk;?> onClick="pool_change()"> + <input name="pool_enable" type="checkbox" id="pool_enable" value="yes" <?=$chk;?> onclick="pool_change()" /> </td> <td> <?=gettext("Provide a virtual IP address to clients"); ?><br /> </td> </tr> </table> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="virtual address pool"> <tr> <td> <?=gettext("Network"); ?>: - <input name="pool_address" type="text" class="formfld unknown" id="pool_address" size="20" value="<?=htmlspecialchars($pconfig['pool_address']);?>"> + <input name="pool_address" type="text" class="formfld unknown" id="pool_address" size="20" value="<?=htmlspecialchars($pconfig['pool_address']);?>" /> / <select name="pool_netbits" class="formselect" id="pool_netbits"> <?php for ($i = 32; $i >= 0; $i--): ?> - <option value="<?=$i;?>" <?php if ($i == $pconfig['pool_netbits']) echo "selected"; ?>> + <option value="<?=$i;?>" <?php if ($i == $pconfig['pool_netbits']) echo "selected=\"selected\""; ?>> <?=$i;?> </option> <?php endfor; ?> @@ -449,11 +449,11 @@ function login_banner_change() { <tr> <td width="22%" valign="top" class="vncell"><?=gettext("Network List"); ?></td> <td width="78%" class="vtable"> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="network list"> <tr> <td> <?php set_checked($pconfig['net_list_enable'],$chk); ?> - <input name="net_list_enable" type="checkbox" id="net_list_enable" value="yes" <?=$chk;?>> + <input name="net_list_enable" type="checkbox" id="net_list_enable" value="yes" <?=$chk;?> /> </td> <td> <?=gettext("Provide a list of accessible networks to clients"); ?><br /> @@ -465,11 +465,11 @@ function login_banner_change() { <tr> <td width="22%" valign="top" class="vncell"><?=gettext("Save Xauth Password"); ?></td> <td width="78%" class="vtable"> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="password"> <tr> <td> <?php set_checked($pconfig['save_passwd_enable'],$chk); ?> - <input name="save_passwd_enable" type="checkbox" id="save_passwd_enable" value="yes" <?=$chk;?>> + <input name="save_passwd_enable" type="checkbox" id="save_passwd_enable" value="yes" <?=$chk;?> /> </td> <td> <?=gettext("Allow clients to save Xauth passwords (Cisco VPN client only)."); ?><br /> @@ -482,21 +482,21 @@ function login_banner_change() { <tr> <td width="22%" valign="top" class="vncell"><?=gettext("DNS Default Domain"); ?></td> <td width="78%" class="vtable"> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="enable dns default domain"> <tr> <td> <?php set_checked($pconfig['dns_domain_enable'],$chk); ?> - <input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?=$chk;?> onClick="dns_domain_change()"> + <input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?=$chk;?> onclick="dns_domain_change()" /> </td> <td> <?=gettext("Provide a default domain name to clients"); ?><br /> </td> </tr> </table> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="dns default domain"> <tr> <td> - <input name="dns_domain" type="text" class="formfld unknown" id="dns_domain" size="30" value="<?=htmlspecialchars($pconfig['dns_domain']);?>"> + <input name="dns_domain" type="text" class="formfld unknown" id="dns_domain" size="30" value="<?=htmlspecialchars($pconfig['dns_domain']);?>" /> </td> </tr> </table> @@ -505,11 +505,11 @@ function login_banner_change() { <tr> <td width="22%" valign="top" class="vncell"><?=gettext("Split DNS"); ?></td> <td width="78%" class="vtable"> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="enable split dns"> <tr> <td> <?php set_checked($pconfig['dns_split_enable'],$chk); ?> - <input name="dns_split_enable" type="checkbox" id="dns_split_enable" value="yes" <?=$chk;?> onClick="dns_split_change()"> + <input name="dns_split_enable" type="checkbox" id="dns_split_enable" value="yes" <?=$chk;?> onclick="dns_split_change()" /> </td> <td> <?=gettext("Provide a list of split DNS domain names to clients. Enter a comma separated list."); ?><br /> @@ -517,10 +517,10 @@ function login_banner_change() { </td> </tr> </table> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="split dns"> <tr> <td> - <input name="dns_split" type="text" class="formfld unknown" id="dns_split" size="30" value="<?=htmlspecialchars($pconfig['dns_split']);?>"> + <input name="dns_split" type="text" class="formfld unknown" id="dns_split" size="30" value="<?=htmlspecialchars($pconfig['dns_split']);?>" /> </td> </tr> </table> @@ -529,40 +529,40 @@ function login_banner_change() { <tr> <td width="22%" valign="top" class="vncell"><?=gettext("DNS Servers"); ?></td> <td width="78%" class="vtable"> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="enable dns servers"> <tr> <td> <?php set_checked($pconfig['dns_server_enable'],$chk); ?> - <input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=$chk;?> onClick="dns_server_change()"> + <input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=$chk;?> onclick="dns_server_change()" /> </td> <td> <?=gettext("Provide a DNS server list to clients"); ?><br /> </td> </tr> </table> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="dns servers"> <tr> <td> <?=gettext("Server"); ?> #1: - <input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=htmlspecialchars($pconfig['dns_server1']);?>"> + <input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=htmlspecialchars($pconfig['dns_server1']);?>" /> </td> </tr> <tr> <td> <?=gettext("Server"); ?> #2: - <input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=htmlspecialchars($pconfig['dns_server2']);?>"> + <input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=htmlspecialchars($pconfig['dns_server2']);?>" /> </td> </tr> <tr> <td> <?=gettext("Server"); ?> #3: - <input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=htmlspecialchars($pconfig['dns_server3']);?>"> + <input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=htmlspecialchars($pconfig['dns_server3']);?>" /> </td> </tr> <tr> <td> <?=gettext("Server"); ?> #4: - <input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=htmlspecialchars($pconfig['dns_server4']);?>"> + <input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=htmlspecialchars($pconfig['dns_server4']);?>" /> </td> </tr> </table> @@ -571,28 +571,28 @@ function login_banner_change() { <tr> <td width="22%" valign="top" class="vncell"><?=gettext("WINS Servers"); ?></td> <td width="78%" class="vtable"> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="enable wins servers"> <tr> <td> <?php set_checked($pconfig['wins_server_enable'],$chk); ?> - <input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=$chk;?> onClick="wins_server_change()"> + <input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=$chk;?> onclick="wins_server_change()" /> </td> <td> <?=gettext("Provide a WINS server list to clients"); ?><br /> </td> </tr> </table> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="wins servers"> <tr> <td> <?=gettext("Server"); ?> #1: - <input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=htmlspecialchars($pconfig['wins_server1']);?>"> + <input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=htmlspecialchars($pconfig['wins_server1']);?>" /> </td> </tr> <tr> <td> <?=gettext("Server"); ?> #2: - <input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=htmlspecialchars($pconfig['wins_server2']);?>"> + <input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=htmlspecialchars($pconfig['wins_server2']);?>" /> </td> </tr> </table> @@ -601,24 +601,24 @@ function login_banner_change() { <tr> <td width="22%" valign="top" class="vncell"><?=gettext("Phase2 PFS Group"); ?></td> <td width="78%" class="vtable"> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="enable pfs group"> <tr> <td> <?php set_checked($pconfig['pfs_group_enable'],$chk); ?> - <input name="pfs_group_enable" type="checkbox" id="pfs_group_enable" value="yes" <?=$chk;?> onClick="pfs_group_change()"> + <input name="pfs_group_enable" type="checkbox" id="pfs_group_enable" value="yes" <?=$chk;?> onclick="pfs_group_change()" /> </td> <td> <?=gettext("Provide the Phase2 PFS group to clients ( overrides all mobile phase2 settings )"); ?><br /> </td> </tr> </table> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="phase-2 pfs group"> <tr> <td> <?=gettext("Group"); ?>: <select name="pfs_group" class="formselect" id="pfs_group"> <?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname): ?> - <option value="<?=$keygroup;?>" <?php if ($pconfig['pfs_group'] == $keygroup) echo "selected"; ?>> + <option value="<?=$keygroup;?>" <?php if ($pconfig['pfs_group'] == $keygroup) echo "selected=\"selected\""; ?>> <?=htmlspecialchars($keygroupname);?> </option> <?php endforeach; ?> @@ -631,18 +631,18 @@ function login_banner_change() { <tr> <td width="22%" valign="top" class="vncell"><?=gettext("Login Banner"); ?></td> <td width="78%" class="vtable"> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="enable login banner"> <tr> <td> <?php set_checked($pconfig['login_banner_enable'],$chk); ?> - <input name="login_banner_enable" type="checkbox" id="login_banner_enable" value="yes" <?=$chk;?> onClick="login_banner_change()"> + <input name="login_banner_enable" type="checkbox" id="login_banner_enable" value="yes" <?=$chk;?> onclick="login_banner_change()" /> </td> <td> <?=gettext("Provide a login banner to clients"); ?><br /> </td> </tr> </table> - <table border="0" cellspacing="2" cellpadding="0"> + <table border="0" cellspacing="2" cellpadding="0" summary="banner"> <tr> <td> <?php $banner = htmlspecialchars($pconfig['login_banner']); ?> @@ -655,7 +655,7 @@ function login_banner_change() { <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> + <input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" /> </td> </tr> </table> @@ -665,6 +665,7 @@ function login_banner_change() { </table> </form> <script type="text/javascript"> +//<![CDATA[ pool_change(); dns_domain_change(); dns_split_change(); @@ -672,7 +673,7 @@ dns_server_change(); wins_server_change(); pfs_group_change(); login_banner_change(); -//--> +//]]> </script> <?php include("fend.inc"); ?> </body> @@ -684,10 +685,9 @@ login_banner_change(); function set_checked($var,& $chk) { if($var) - $chk = 'checked'; + $chk = "checked=\"checked\""; else - $chk = ''; + $chk = ""; } ?> - diff --git a/usr/local/www/vpn_ipsec_phase1.php b/usr/local/www/vpn_ipsec_phase1.php index 343d1a1..d7906d4 100644 --- a/usr/local/www/vpn_ipsec_phase1.php +++ b/usr/local/www/vpn_ipsec_phase1.php @@ -79,6 +79,7 @@ if (isset($p1index) && $a_phase1[$p1index]) { else $pconfig['remotegw'] = $a_phase1[$p1index]['remote-gateway']; + $pconfig['iketype'] = $a_phase1[$p1index]['iketype']; $pconfig['mode'] = $a_phase1[$p1index]['mode']; $pconfig['protocol'] = $a_phase1[$p1index]['protocol']; $pconfig['myid_type'] = $a_phase1[$p1index]['myid_type']; @@ -90,8 +91,6 @@ if (isset($p1index) && $a_phase1[$p1index]) { $pconfig['dhgroup'] = $a_phase1[$p1index]['dhgroup']; $pconfig['lifetime'] = $a_phase1[$p1index]['lifetime']; $pconfig['authentication_method'] = $a_phase1[$p1index]['authentication_method']; - $pconfig['generate_policy'] = $a_phase1[$p1index]['generate_policy']; - $pconfig['proposal_check'] = $a_phase1[$p1index]['proposal_check']; if (($pconfig['authentication_method'] == "pre_shared_key") || ($pconfig['authentication_method'] == "xauth_psk_server")) { @@ -125,6 +124,7 @@ if (isset($p1index) && $a_phase1[$p1index]) { $pconfig['lifetime'] = "28800"; $pconfig['nat_traversal'] = "on"; $pconfig['dpd_enable'] = true; + $pconfig['iketype'] = "ikev1"; /* mobile client */ if($_GET['mobile']) @@ -297,6 +297,9 @@ if ($_POST) { $input_errors[] = gettext("A numeric value must be specified for DPD retries."); } + if (!empty($pconfig['iketype']) && $pconfig['iketype'] != "ikev1" && $pconfig['iketype'] != "ikev2") + $input_errors[] = gettext("Valid arguments for IKE type is v1 or v2"); + /* build our encryption algorithms array */ $pconfig['ealgo'] = array(); $pconfig['ealgo']['name'] = $_POST['ealgo']; @@ -305,6 +308,7 @@ if ($_POST) { if (!$input_errors) { $ph1ent['ikeid'] = $pconfig['ikeid']; + $ph1ent['iketype'] = $pconfig['iketype']; $ph1ent['disabled'] = $pconfig['disabled'] ? true : false; $ph1ent['interface'] = $pconfig['interface']; /* if the remote gateway changed and the interface is not WAN then remove route */ @@ -337,8 +341,6 @@ if ($_POST) { $ph1ent['certref'] = $pconfig['certref']; $ph1ent['caref'] = $pconfig['caref']; $ph1ent['authentication_method'] = $pconfig['authentication_method']; - $ph1ent['generate_policy'] = $pconfig['generate_policy']; - $ph1ent['proposal_check'] = $pconfig['proposal_check']; $ph1ent['descr'] = $pconfig['descr']; $ph1ent['nat_traversal'] = $pconfig['nat_traversal']; @@ -530,6 +532,21 @@ function dpdchkbox_change() { </td> </tr> <tr> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Key Exchange version"); ?></td> + <td width="78%" class="vtable"> + <select name="iketype" class="formselect"> + <?php + $keyexchange = array("ikev1" => "V1", "ikev2" => "V2"); + foreach ($keyexchange as $kidx => $name): + ?> + <option value="<?=$kidx;?>" <?php if ($kidx == $pconfig['iketype']) echo "selected"; ?>> + <?=htmlspecialchars($name);?> + </option> + <?php endforeach; ?> + </select> <br /> <span class="vexpl"><?=gettext("Select the KeyExchange Protocol version to be used. Usually known as IKEv1 or IKEv2."); ?>.</span> + </td> + </tr> + <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Internet Protocol"); ?></td> <td width="78%" class="vtable"> <select name="protocol" class="formselect"> @@ -638,11 +655,11 @@ function dpdchkbox_change() { <td width="78%" class="vtable"> <select name="mode" class="formselect"> <?php - $modes = array("main","aggressive","base"); - foreach ($modes as $mode): + $modes = array("main" => "Main", "aggressive" => "Aggressive"); + foreach ($modes as $mode => $mdescr): ?> <option value="<?=$mode;?>" <?php if ($mode == $pconfig['mode']) echo "selected"; ?>> - <?=htmlspecialchars($mode);?> + <?=htmlspecialchars($mdescr);?> </option> <?php endforeach; ?> </select> <br /> <span class="vexpl"><?=gettext("Aggressive is more flexible, but less secure"); ?>.</span> @@ -692,38 +709,6 @@ function dpdchkbox_change() { </span> </td> </tr> - <tr id="generate_policy"> - <td width="22%" valign="top" class="vncellreq"><?=gettext("Policy Generation"); ?></td> - <td width="78%" class="vtable"> - <select name="generate_policy" class="formselect"> - <option value="" <?php if (empty($pconfig['generate_policy'])) echo "selected"; ?>>Default</option> - <option value="on" <?php if ($pconfig['generate_policy'] == "on") echo "selected"; ?>>On</option> - <option value="off" <?php if ($pconfig['generate_policy'] == "off") echo "selected"; ?>>Off</option> - <option value="require" <?php if ($pconfig['generate_policy'] == "require") echo "selected"; ?>>Require</option> - <option value="unique" <?php if ($pconfig['generate_policy'] == "unique") echo "selected"; ?>>Unique</option> - </select> - <br /> - <span class="vexpl"> - <?=gettext("When working as a responder (as with mobile clients), this controls how policies are generated based on SA proposals."); ?> - </span> - </td> - </tr> - <tr id="proposal_check"> - <td width="22%" valign="top" class="vncellreq"><?=gettext("Proposal Checking"); ?></td> - <td width="78%" class="vtable"> - <select name="proposal_check" class="formselect"> - <option value="" <?php if (empty($pconfig['proposal_check'])) echo "selected"; ?>>Default</option> - <option value="obey" <?php if ($pconfig['proposal_check'] == "obey") echo "selected"; ?>>Obey</option> - <option value="strict" <?php if ($pconfig['proposal_check'] == "strict") echo "selected"; ?>>Strict</option> - <option value="claim" <?php if ($pconfig['proposal_check'] == "claim") echo "selected"; ?>>Claim</option> - <option value="exact" <?php if ($pconfig['proposal_check'] == "exact") echo "selected"; ?>>Exact</option> - </select> - <br /> - <span class="vexpl"> - <?=gettext("Specifies the action of lifetime length, key length, and PFS of the phase 2 selection on the responder side, and the action of lifetime check in phase 1."); ?> - </span> - </td> - </tr> <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Encryption algorithm"); ?></td> <td width="78%" class="vtable"> diff --git a/usr/local/www/vpn_ipsec_phase2.php b/usr/local/www/vpn_ipsec_phase2.php index 3958707..382030b 100644 --- a/usr/local/www/vpn_ipsec_phase2.php +++ b/usr/local/www/vpn_ipsec_phase2.php @@ -324,10 +324,10 @@ include("head.inc"); ?> <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> -<script type="text/javascript" src="/javascript/jquery.ipv4v6ify.js"></script> <?php include("fbegin.inc"); ?> +<script type="text/javascript" src="/javascript/jquery.ipv4v6ify.js"></script> <script type="text/javascript"> -<!-- +//<![CDATA[ function change_mode() { index = document.iform.mode.selectedIndex; @@ -477,7 +477,7 @@ function change_protocol() { document.getElementById('opt_enc').style.display = 'none'; } -//--> +//]]> </script> <form action="vpn_ipsec_phase2.php" method="post" name="iform" id="iform"> @@ -487,7 +487,7 @@ function change_protocol() { print_input_errors($input_errors); ?> -<table width="100%" border="0" cellpadding="0" cellspacing="0"> +<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="vpn ipsec phase-2"> <tr class="tabnavtbl"> <td id="tabnav"> <?php @@ -503,11 +503,11 @@ function change_protocol() { <tr> <td id="mainarea"> <div class="tabcont"> - <table width="100%" border="0" cellpadding="6" cellspacing="0"> + <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area"> <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td> <td width="78%" class="vtable"> - <input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked"; ?>> + <input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked=\"checked\""; ?> /> <strong><?=gettext("Disable this phase2 entry"); ?></strong> <br /> <span class="vexpl"><?=gettext("Set this option to disable this phase2 entry without " . @@ -518,12 +518,12 @@ function change_protocol() { <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Mode"); ?></td> <td width="78%" class="vtable"> - <select name="mode" class="formselect" onChange="change_mode()"> + <select name="mode" class="formselect" onchange="change_mode()"> <?php foreach($p2_modes as $name => $value): $selected = ""; if ($name == $pconfig['mode']) - $selected = "selected"; + $selected = "selected=\"selected\""; ?> <option value="<?=$name;?>" <?=$selected;?>><?=$value;?></option> <?php endforeach; ?> @@ -533,19 +533,19 @@ function change_protocol() { <tr id="opt_localid"> <td width="22%" valign="top" class="vncellreq"><?=gettext("Local Network"); ?></td> <td width="78%" class="vtable"> - <table border="0" cellspacing="0" cellpadding="0"> + <table border="0" cellspacing="0" cellpadding="0" summary="local network"> <tr> <td><?=gettext("Type"); ?>: </td> <td></td> <td> - <select name="localid_type" class="formselect" onChange="typesel_change_local()"> - <option value="address" <?php if ($pconfig['localid_type'] == "address") echo "selected";?>><?=gettext("Address"); ?></option> - <option value="network" <?php if ($pconfig['localid_type'] == "network") echo "selected";?>><?=gettext("Network"); ?></option> + <select name="localid_type" class="formselect" onchange="typesel_change_local()"> + <option value="address" <?php if ($pconfig['localid_type'] == "address") echo "selected=\"selected\"";?>><?=gettext("Address"); ?></option> + <option value="network" <?php if ($pconfig['localid_type'] == "network") echo "selected=\"selected\"";?>><?=gettext("Network"); ?></option> <?php $iflist = get_configured_interface_with_descr(); foreach ($iflist as $ifname => $ifdescr): ?> - <option value="<?=$ifname; ?>" <?php if ($pconfig['localid_type'] == $ifname ) echo "selected";?>><?=sprintf(gettext("%s subnet"), $ifdescr); ?></option> + <option value="<?=$ifname; ?>" <?php if ($pconfig['localid_type'] == $ifname ) echo "selected=\"selected\"";?>><?=sprintf(gettext("%s subnet"), $ifdescr); ?></option> <?php endforeach; ?> </select> </td> @@ -554,11 +554,11 @@ function change_protocol() { <td><?=gettext("Address:");?> </td> <td><?=$mandfldhtmlspc;?></td> <td> - <input name="localid_address" type="text" class="formfld unknown ipv4v6" id="localid_address" size="28" value="<?=htmlspecialchars($pconfig['localid_address']);?>"> + <input name="localid_address" type="text" class="formfld unknown ipv4v6" id="localid_address" size="28" value="<?=htmlspecialchars($pconfig['localid_address']);?>" /> / <select name="localid_netbits" class="formselect ipv4v6" id="localid_netbits"> <?php for ($i = 128; $i >= 0; $i--): ?> - <option value="<?=$i;?>" <?php if (isset($pconfig['localid_netbits']) && $i == $pconfig['localid_netbits']) echo "selected"; ?>> + <option value="<?=$i;?>" <?php if (isset($pconfig['localid_netbits']) && $i == $pconfig['localid_netbits']) echo "selected=\"selected\""; ?>> <?=$i;?> </option> <?php endfor; ?> @@ -573,16 +573,16 @@ function change_protocol() { <td><?=gettext("Type"); ?>: </td> <td></td> <td> - <select name="natlocalid_type" class="formselect" onChange="typesel_change_natlocal()"> - <option value="address" <?php if ($pconfig['natlocalid_type'] == "address") echo "selected";?>><?=gettext("Address"); ?></option> - <option value="network" <?php if ($pconfig['natlocalid_type'] == "network") echo "selected";?>><?=gettext("Network"); ?></option> + <select name="natlocalid_type" class="formselect" onchange="typesel_change_natlocal()"> + <option value="address" <?php if ($pconfig['natlocalid_type'] == "address") echo "selected=\"selected\"";?>><?=gettext("Address"); ?></option> + <option value="network" <?php if ($pconfig['natlocalid_type'] == "network") echo "selected=\"selected\"";?>><?=gettext("Network"); ?></option> <?php $iflist = get_configured_interface_with_descr(); foreach ($iflist as $ifname => $ifdescr): ?> - <option value="<?=$ifname; ?>" <?php if ($pconfig['natlocalid_type'] == $ifname ) echo "selected";?>><?=sprintf(gettext("%s subnet"), $ifdescr); ?></option> + <option value="<?=$ifname; ?>" <?php if ($pconfig['natlocalid_type'] == $ifname ) echo "selected=\"selected\"";?>><?=sprintf(gettext("%s subnet"), $ifdescr); ?></option> <?php endforeach; ?> - <option value="none" <?php if (empty($pconfig['natlocalid_type']) || $pconfig['natlocalid_type'] == "none" ) echo "selected";?>><?=gettext("None"); ?></option> + <option value="none" <?php if (empty($pconfig['natlocalid_type']) || $pconfig['natlocalid_type'] == "none" ) echo "selected=\"selected\"";?>><?=gettext("None"); ?></option> </select> </td> </tr> @@ -590,11 +590,11 @@ function change_protocol() { <td><?=gettext("Address:");?> </td> <td><?=$mandfldhtmlspc;?></td> <td> - <input name="natlocalid_address" type="text" class="formfld unknown ipv4v6" id="natlocalid_address" size="28" value="<?=htmlspecialchars($pconfig['natlocalid_address']);?>"> + <input name="natlocalid_address" type="text" class="formfld unknown ipv4v6" id="natlocalid_address" size="28" value="<?=htmlspecialchars($pconfig['natlocalid_address']);?>" /> / <select name="natlocalid_netbits" class="formselect ipv4v6" id="natlocalid_netbits"> <?php for ($i = 128; $i >= 0; $i--): ?> - <option value="<?=$i;?>" <?php if (isset($pconfig['natlocalid_netbits']) && $i == $pconfig['natlocalid_netbits']) echo "selected"; ?>> + <option value="<?=$i;?>" <?php if (isset($pconfig['natlocalid_netbits']) && $i == $pconfig['natlocalid_netbits']) echo "selected=\"selected\""; ?>> <?=$i;?> </option> <?php endfor; ?> @@ -610,14 +610,14 @@ function change_protocol() { <tr id="opt_remoteid"> <td width="22%" valign="top" class="vncellreq"><?=gettext("Remote Network"); ?></td> <td width="78%" class="vtable"> - <table border="0" cellspacing="0" cellpadding="0"> + <table border="0" cellspacing="0" cellpadding="0" summary="remote network"> <tr> <td><?=gettext("Type"); ?>: </td> <td></td> <td> - <select name="remoteid_type" class="formselect" onChange="typesel_change_remote()"> - <option value="address" <?php if ($pconfig['remoteid_type'] == "address") echo "selected"; ?>><?=gettext("Address"); ?></option> - <option value="network" <?php if ($pconfig['remoteid_type'] == "network") echo "selected"; ?>><?=gettext("Network"); ?></option> + <select name="remoteid_type" class="formselect" onchange="typesel_change_remote()"> + <option value="address" <?php if ($pconfig['remoteid_type'] == "address") echo "selected=\"selected\""; ?>><?=gettext("Address"); ?></option> + <option value="network" <?php if ($pconfig['remoteid_type'] == "network") echo "selected=\"selected\""; ?>><?=gettext("Network"); ?></option> </select> </td> </tr> @@ -625,13 +625,13 @@ function change_protocol() { <td><?=gettext("Address"); ?>: </td> <td><?=$mandfldhtmlspc;?></td> <td> - <input name="remoteid_address" type="text" class="formfld unknown ipv4v6" id="remoteid_address" size="28" value="<?=htmlspecialchars($pconfig['remoteid_address']);?>"> + <input name="remoteid_address" type="text" class="formfld unknown ipv4v6" id="remoteid_address" size="28" value="<?=htmlspecialchars($pconfig['remoteid_address']);?>" /> / <select name="remoteid_netbits" class="formselect ipv4v6" id="remoteid_netbits"> <?php for ($i = 128; $i >= 0; $i--) { echo "<option value=\"{$i}\""; - if (isset($pconfig['remoteid_netbits']) && $i == $pconfig['remoteid_netbits']) echo " selected"; + if (isset($pconfig['remoteid_netbits']) && $i == $pconfig['remoteid_netbits']) echo " selected=\"selected\""; echo ">{$i}</option>\n"; } ?> </select> @@ -646,7 +646,7 @@ function change_protocol() { <tr> <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> <td width="78%" class="vtable"> - <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>"> + <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" /> <br /> <span class="vexpl"> <?=gettext("You may enter a description here " . @@ -665,9 +665,9 @@ function change_protocol() { <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Protocol"); ?></td> <td width="78%" class="vtable"> - <select name="proto" class="formselect" onChange="change_protocol()"> + <select name="proto" class="formselect" onchange="change_protocol()"> <?php foreach ($p2_protos as $proto => $protoname): ?> - <option value="<?=$proto;?>" <?php if ($proto == $pconfig['proto']) echo "selected"; ?>> + <option value="<?=$proto;?>" <?php if ($proto == $pconfig['proto']) echo "selected=\"selected\""; ?>> <?=htmlspecialchars($protoname);?> </option> <?php endforeach; ?> @@ -681,16 +681,16 @@ function change_protocol() { <tr id="opt_enc"> <td width="22%" valign="top" class="vncellreq"><?=gettext("Encryption algorithms"); ?></td> <td width="78%" class="vtable"> - <table border="0" cellspacing="0" cellpadding="0"> + <table border="0" cellspacing="0" cellpadding="0" summary="encryption"> <?php foreach ($p2_ealgos as $algo => $algodata): $checked = ''; if (is_array($pconfig['ealgos']) && in_array($algo,$pconfig['ealgos'])) - $checked = " checked"; + $checked = " checked=\"checked\""; ?> <tr> <td> - <input type="checkbox" name="ealgos[]" value="<?=$algo;?>"<?=$checked?>> + <input type="checkbox" name="ealgos[]" value="<?=$algo;?>"<?=$checked?> /> </td> <td> <?=htmlspecialchars($algodata['name']);?> @@ -705,10 +705,10 @@ function change_protocol() { $key_lo = $algodata['keysel']['lo']; $key_step = $algodata['keysel']['step']; for ($keylen = $key_hi; $keylen >= $key_lo; $keylen -= $key_step): - $selected = ''; + $selected = ""; // if ($checked && in_array("keylen_".$algo,$pconfig)) if ($keylen == $pconfig["keylen_".$algo]) - $selected = " selected"; + $selected = " selected=\"selected\""; ?> <option value="<?=$keylen;?>"<?=$selected;?>><?=$keylen;?> <?=gettext("bits"); ?></option> <?php endfor; ?> @@ -730,7 +730,7 @@ function change_protocol() { <td width="22%" valign="top" class="vncellreq"><?=gettext("Hash algorithms"); ?></td> <td width="78%" class="vtable"> <?php foreach ($p2_halgos as $algo => $algoname): ?> - <input type="checkbox" name="halgos[]" value="<?=$algo;?>" <?php if (in_array($algo, $pconfig['halgos'])) echo "checked"; ?>> + <input type="checkbox" name="halgos[]" value="<?=$algo;?>" <?php if (in_array($algo, $pconfig['halgos'])) echo "checked=\"checked\""; ?> /> <?=htmlspecialchars($algoname);?> <br /> <?php endforeach; ?> @@ -742,7 +742,7 @@ function change_protocol() { <?php if (!isset($pconfig['mobile']) || !isset($a_client['pfs_group'])): ?> <select name="pfsgroup" class="formselect"> <?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname): ?> - <option value="<?=$keygroup;?>" <?php if ($keygroup == $pconfig['pfsgroup']) echo "selected"; ?>> + <option value="<?=$keygroup;?>" <?php if ($keygroup == $pconfig['pfsgroup']) echo "selected=\"selected\""; ?>> <?=htmlspecialchars($keygroupname);?> </option> <?php endforeach; ?> @@ -750,10 +750,10 @@ function change_protocol() { <br /> <?php else: ?> - <select class="formselect" disabled> - <option selected><?=$p2_pfskeygroups[$a_client['pfs_group']];?></option> + <select class="formselect" disabled="disabled"> + <option selected="selected"><?=$p2_pfskeygroups[$a_client['pfs_group']];?></option> </select> - <input name="pfsgroup" type="hidden" value="<?=htmlspecialchars($pconfig['pfsgroup']);?>"> + <input name="pfsgroup" type="hidden" value="<?=htmlspecialchars($pconfig['pfsgroup']);?>" /> <br /> <span class="vexpl"><em><?=gettext("Set globally in mobile client options"); ?></em></span> <?php endif; ?> @@ -762,7 +762,7 @@ function change_protocol() { <tr> <td width="22%" valign="top" class="vncell"><?=gettext("Lifetime"); ?></td> <td width="78%" class="vtable"> - <input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="20" value="<?=htmlspecialchars($pconfig['lifetime']);?>"> + <input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="20" value="<?=htmlspecialchars($pconfig['lifetime']);?>" /> <?=gettext("seconds"); ?> </td> </tr> @@ -775,7 +775,7 @@ function change_protocol() { <tr> <td width="22%" valign="top" class="vncell"><?=gettext("Automatically ping host"); ?></td> <td width="78%" class="vtable"> - <input name="pinghost" type="text" class="formfld unknown" id="pinghost" size="28" value="<?=htmlspecialchars($pconfig['pinghost']);?>"> + <input name="pinghost" type="text" class="formfld unknown" id="pinghost" size="28" value="<?=htmlspecialchars($pconfig['pinghost']);?>" /> <?=gettext("IP address"); ?> </td> </tr> @@ -783,14 +783,14 @@ function change_protocol() { <td width="22%" valign="top"> </td> <td width="78%"> <?php if (isset($p2index) && $a_phase2[$p2index]): ?> - <input name="p2index" type="hidden" value="<?=htmlspecialchars($p2index);?>"> + <input name="p2index" type="hidden" value="<?=htmlspecialchars($p2index);?>" /> <?php endif; ?> <?php if ($pconfig['mobile']): ?> - <input name="mobile" type="hidden" value="true"> - <input name="remoteid_type" type="hidden" value="mobile"> + <input name="mobile" type="hidden" value="true" /> + <input name="remoteid_type" type="hidden" value="mobile" /> <?php endif; ?> - <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> - <input name="ikeid" type="hidden" value="<?=htmlspecialchars($pconfig['ikeid']);?>"> + <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" /> + <input name="ikeid" type="hidden" value="<?=htmlspecialchars($pconfig['ikeid']);?>" /> </td> </tr> </table> @@ -799,8 +799,8 @@ function change_protocol() { </tr> </table> </form> -<script lannguage="JavaScript"> -<!-- +<script type="text/javascript"> +//<![CDATA[ change_mode('<?=htmlspecialchars($pconfig['mode'])?>'); change_protocol('<?=htmlspecialchars($pconfig['proto'])?>'); typesel_change_local(<?=htmlspecialchars($pconfig['localid_netbits'])?>); @@ -808,7 +808,7 @@ typesel_change_natlocal(<?=htmlspecialchars($pconfig['natlocalid_netbits'])?>); <?php if (!isset($pconfig['mobile'])): ?> typesel_change_remote(<?=htmlspecialchars($pconfig['remoteid_netbits'])?>); <?php endif; ?> -//--> +//]]> </script> <?php include("fend.inc"); ?> </body> @@ -887,4 +887,3 @@ function idinfo_to_pconfig($prefix,& $idinfo,& $pconfig) { } ?> - diff --git a/usr/local/www/vpn_ipsec_settings.php b/usr/local/www/vpn_ipsec_settings.php index 0cb9c17..aacce92 100644 --- a/usr/local/www/vpn_ipsec_settings.php +++ b/usr/local/www/vpn_ipsec_settings.php @@ -51,7 +51,7 @@ $pconfig['failoverforcereload'] = isset($config['ipsec']['failoverforcereload']) $pconfig['maxmss_enable'] = isset($config['system']['maxmss_enable']); $pconfig['maxmss'] = $config['system']['maxmss']; -if ($_POST['submit']) { +if ($_POST) { unset($input_errors); $pconfig = $_POST; diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index 017d03f..a773e12 100644 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -592,7 +592,7 @@ function showchange() { echo ":</td>\n"; } if($field['size']) $size = " size='" . $field['size'] . "' "; - if($field['multiple'] == "yes") $multiple = "MULTIPLE "; + if($field['multiple'] == "yes") $multiple = "multiple=\"multiple\" "; if(!$field['dontcombinecells']) echo "<td class=\"vtable\">\n"; $onchange = ""; @@ -658,7 +658,7 @@ function showchange() { break; case "listtopic": echo "<td> </td></tr>"; - echo "<tr><td colspan=\"2\" class=\"listtopic\">" . $field['name'] . "<br /></td>\n"; + echo "<tr><td colspan=\"2\" class=\"listtopic\">" . $field['name'] . "<br />\n"; break; case "subnet_select": |