Commit 25987211 authored by Franco Fichtner's avatar Franco Fichtner

vpn/openvpn: push back service shortcut to close #432

parent 39c34cbd
...@@ -70,6 +70,12 @@ function get_shortcut_main_link($shortcut_section, $addspace = true, $service = ...@@ -70,6 +70,12 @@ function get_shortcut_main_link($shortcut_section, $addspace = true, $service =
return ""; return "";
$space = ($addspace) ? " " : "" ; $space = ($addspace) ? " " : "" ;
switch ($shortcut_section) { switch ($shortcut_section) {
case "openvpn":
if (!empty($service['mode']) && is_numeric($service['id']))
$link = "vpn_openvpn_{$service['mode']}.php?act=edit&id={$service['id']}";
else
$link = $shortcuts[$shortcut_section]['main'];
break;
case "captiveportal": case "captiveportal":
if (!empty($service['zone'])) if (!empty($service['zone']))
$link = "services_captiveportal.php?zone={$service['zone']}"; $link = "services_captiveportal.php?zone={$service['zone']}";
...@@ -174,6 +180,9 @@ $shortcuts['dhcp6']['status'] = "status_dhcpv6_leases.php"; ...@@ -174,6 +180,9 @@ $shortcuts['dhcp6']['status'] = "status_dhcpv6_leases.php";
$shortcuts['ipsec'] = array(); $shortcuts['ipsec'] = array();
$shortcuts['ipsec']['service'] = "ipsec"; $shortcuts['ipsec']['service'] = "ipsec";
$shortcuts['openvpn'] = array();
$shortcuts['openvpn']['service'] = "openvpn";
$shortcuts['firewall'] = array(); $shortcuts['firewall'] = array();
$shortcuts['firewall']['main'] = "firewall_rules.php"; $shortcuts['firewall']['main'] = "firewall_rules.php";
$shortcuts['firewall']['log'] = "diag_logs_filter.php"; $shortcuts['firewall']['log'] = "diag_logs_filter.php";
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("openvpn.inc"); require_once("openvpn.inc");
require_once("services.inc"); require_once("services.inc");
...@@ -67,6 +68,7 @@ function kill_client($port, $remipp) { ...@@ -67,6 +68,7 @@ function kill_client($port, $remipp) {
} }
$pgtitle = array(gettext('VPN'), gettext('OpenVPN'), gettext('Connection Status')); $pgtitle = array(gettext('VPN'), gettext('OpenVPN'), gettext('Connection Status'));
$shortcut_section = 'openvpn';
if ($_SERVER['REQUEST_METHOD'] === 'GET') { if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$vpnid = 0; $vpnid = 0;
......
...@@ -33,6 +33,7 @@ require_once("services.inc"); ...@@ -33,6 +33,7 @@ require_once("services.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
$pgtitle = array(gettext('VPN'), gettext('OpenVPN'), gettext('Client')); $pgtitle = array(gettext('VPN'), gettext('OpenVPN'), gettext('Client'));
$shortcut_section = 'openvpn';
if (!isset($config['openvpn']['openvpn-client'])) { if (!isset($config['openvpn']['openvpn-client'])) {
$config['openvpn']['openvpn-client'] = array(); $config['openvpn']['openvpn-client'] = array();
......
...@@ -26,12 +26,14 @@ ...@@ -26,12 +26,14 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("openvpn.inc"); require_once("openvpn.inc");
require_once("services.inc"); require_once("services.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
$pgtitle = array(gettext('VPN'), gettext('OpenVPN'), gettext('Client Specific Overrides')); $pgtitle = array(gettext('VPN'), gettext('OpenVPN'), gettext('Client Specific Overrides'));
$shortcut_section = 'openvpn';
// define all fields used in this form // define all fields used in this form
$all_form_fields = "custom_options,disable,common_name,block,description $all_form_fields = "custom_options,disable,common_name,block,description
......
...@@ -37,6 +37,7 @@ require_once("openvpn-client-export.inc"); ...@@ -37,6 +37,7 @@ require_once("openvpn-client-export.inc");
global $current_openvpn_version, $current_openvpn_version_rev; global $current_openvpn_version, $current_openvpn_version_rev;
$pgtitle = array(gettext('VPN'), gettext('OpenVPN'), gettext('Client Export')); $pgtitle = array(gettext('VPN'), gettext('OpenVPN'), gettext('Client Export'));
$shortcut_section = 'openvpn';
$ras_server = array(); $ras_server = array();
if (isset($config['openvpn']['openvpn-server'])) { if (isset($config['openvpn']['openvpn-server'])) {
......
...@@ -35,6 +35,7 @@ require_once("interfaces.inc"); ...@@ -35,6 +35,7 @@ require_once("interfaces.inc");
require_once("openvpn-client-export.inc"); require_once("openvpn-client-export.inc");
$pgtitle = array(gettext('VPN'), gettext('OpenVPN'), gettext('Shared Key Export')); $pgtitle = array(gettext('VPN'), gettext('OpenVPN'), gettext('Shared Key Export'));
$shortcut_section = 'openvpn';
$ras_server = array(); $ras_server = array();
if (isset($config['openvpn']['openvpn-server'])) { if (isset($config['openvpn']['openvpn-server'])) {
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("openvpn.inc"); require_once("openvpn.inc");
require_once("services.inc"); require_once("services.inc");
...@@ -395,7 +396,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -395,7 +396,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
} }
} }
$pgtitle = array(gettext('VPN'), gettext('OpenVPN'), gettext('Server')); $pgtitle = array(gettext('VPN'), gettext('OpenVPN'), gettext('Server'));
$shortcut_section = 'openvpn';
include("head.inc"); include("head.inc");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment