$user) {
if (!empty($user['ipsecpsk'])) {
$userkeys[] = array('ident' => $user['name'], 'type' => 'PSK', 'pre-shared-key' => $user['ipsecpsk'], 'id' => $id);;
}
}
if (isset($_POST['apply'])) {
$retval = vpn_ipsec_configure();
/* reload the filter in the background */
filter_configure();
$savemsg = get_std_save_message($retval);
if (is_subsystem_dirty('ipsec')) {
clear_subsystem_dirty('ipsec');
}
}
if ($_GET['act'] == "del") {
if ($a_secret[$_GET['id']]) {
unset($a_secret[$_GET['id']]);
write_config(gettext("Deleted IPsec Pre-Shared Key"));
mark_subsystem_dirty('ipsec');
header("Location: vpn_ipsec_keys.php");
exit;
}
}
$pgtitle = array(gettext("VPN"), gettext("IPsec"), gettext("Pre-Shared Keys"));
$shortcut_section = "ipsec";
include("head.inc");
if ($savemsg) {
print_info_box($savemsg);
}
if (is_subsystem_dirty('ipsec')) {
print_apply_box(gettext("The IPsec tunnel configuration has been changed.") . "
" . gettext("You must apply the changes in order for them to take effect."));
}
$tab_array = array();
$tab_array[0] = array(gettext("Tunnels"), false, "vpn_ipsec.php");
$tab_array[1] = array(gettext("Mobile Clients"), false, "vpn_ipsec_mobile.php");
$tab_array[2] = array(gettext("Pre-Shared Keys"), true, "vpn_ipsec_keys.php");
$tab_array[3] = array(gettext("Advanced Settings"), false, "vpn_ipsec_settings.php");
display_top_tabs($tab_array);
?>