From 6d9b107442c111b7ef164cce6e7ecabd39622ddb Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 10 Aug 2012 15:30:20 -0400 Subject: Fixup openvpn shortcut bar status/control --- usr/local/www/fbegin.inc | 18 +++++++++++++++--- usr/local/www/shortcuts.inc | 2 +- usr/local/www/vpn_openvpn_client.php | 5 +++++ usr/local/www/vpn_openvpn_server.php | 11 +++++++---- 4 files changed, 28 insertions(+), 8 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc index edd4592..d784d81 100755 --- a/usr/local/www/fbegin.inc +++ b/usr/local/www/fbegin.inc @@ -390,9 +390,21 @@ function add_to_menu($url, $name) { "> diff --git a/usr/local/www/shortcuts.inc b/usr/local/www/shortcuts.inc index 252dab7..b061172 100644 --- a/usr/local/www/shortcuts.inc +++ b/usr/local/www/shortcuts.inc @@ -40,7 +40,7 @@ $shortcuts['ipsec']['service'] = "racoon"; $shortcuts['openvpn'] = array(); $shortcuts['openvpn']['log'] = "diag_logs_openvpn.php"; $shortcuts['openvpn']['status'] = "status_openvpn.php"; -//$shortcuts['openvpn']['service'] = "openvpn"; +$shortcuts['openvpn']['service'] = "openvpn"; $shortcuts['firewall'] = array(); $shortcuts['firewall']['log'] = "diag_logs_filter.php"; diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php index 866ad85..c002f79 100644 --- a/usr/local/www/vpn_openvpn_client.php +++ b/usr/local/www/vpn_openvpn_client.php @@ -68,6 +68,11 @@ $act = $_GET['act']; if (isset($_POST['act'])) $act = $_POST['act']; +if (isset($id) && $a_client[$id]) + $vpnid = $a_client[$id]['vpnid']; +else + $vpnid = 0; + if ($_GET['act'] == "del") { if (!$a_client[$id]) { diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php index de56415..6f20997 100644 --- a/usr/local/www/vpn_openvpn_server.php +++ b/usr/local/www/vpn_openvpn_server.php @@ -37,9 +37,6 @@ require("guiconfig.inc"); require_once("openvpn.inc"); -$pgtitle = array(gettext("OpenVPN"), gettext("Server")); -$shortcut_section = "openvpn"; - if (!is_array($config['openvpn']['openvpn-server'])) $config['openvpn']['openvpn-server'] = array(); @@ -72,6 +69,11 @@ $act = $_GET['act']; if (isset($_POST['act'])) $act = $_POST['act']; +if (isset($id) && $a_server[$id]) + $vpnid = $a_server[$id]['vpnid']; +else + $vpnid = 0; + if ($_GET['act'] == "del") { if (!$a_server[$id]) { @@ -100,7 +102,6 @@ if($_GET['act']=="new"){ if($_GET['act']=="edit"){ if (isset($id) && $a_server[$id]) { - $pconfig['disable'] = isset($a_server[$id]['disable']); $pconfig['mode'] = $a_server[$id]['mode']; $pconfig['protocol'] = $a_server[$id]['protocol']; @@ -416,6 +417,8 @@ if ($_POST) { if (!empty($pconfig['authmode'])) $pconfig['authmode'] = implode(",", $pconfig['authmode']); } +$pgtitle = array(gettext("OpenVPN"), gettext("Server")); +$shortcut_section = "openvpn"; include("head.inc"); -- cgit v1.1