Commit 4635ac7b authored by Franco Fichtner's avatar Franco Fichtner

l2tp: make it shine (as a service)

parent 40516e54
...@@ -44,7 +44,7 @@ function vpn_services() ...@@ -44,7 +44,7 @@ function vpn_services()
$services = array(); $services = array();
if (isset($config['pptpd']['mode']) && $config['pptpd']['mode'] == 'server') { if (isset($config['pptpd']['mode']) && $config['pptpd']['mode'] != 'off') {
$pconfig = array(); $pconfig = array();
$pconfig['name'] = 'pptpd'; $pconfig['name'] = 'pptpd';
$pconfig['description'] = gettext('PPTP Server'); $pconfig['description'] = gettext('PPTP Server');
...@@ -52,6 +52,14 @@ function vpn_services() ...@@ -52,6 +52,14 @@ function vpn_services()
$services[] = $pconfig; $services[] = $pconfig;
} }
if (isset($config['l2tp']['mode']) && $config['l2tp']['mode'] != 'off') {
$pconfig = array();
$pconfig['name'] = 'l2tpd';
$pconfig['description'] = gettext('L2TP Server');
$pconfig['pidfile'] = '/var/run/l2tp-vpn.pid';
$services[] = $pconfig;
}
return $services; return $services;
} }
......
...@@ -19,4 +19,7 @@ $tab_array = array(); ...@@ -19,4 +19,7 @@ $tab_array = array();
$tab_array[] = array(gettext("L2TP Logins"), $mode != "raw", "/diag_logs_l2tp.php"); $tab_array[] = array(gettext("L2TP Logins"), $mode != "raw", "/diag_logs_l2tp.php");
$tab_array[] = array(gettext("L2TP Raw"), $mode == "raw", "/diag_logs_l2tp.php?mode=raw"); $tab_array[] = array(gettext("L2TP Raw"), $mode == "raw", "/diag_logs_l2tp.php?mode=raw");
require_once 'services.inc';
$service_hook = 'l2tpd';
require_once 'diag_logs_vpn.inc'; require_once 'diag_logs_vpn.inc';
...@@ -28,9 +28,10 @@ ...@@ -28,9 +28,10 @@
*/ */
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("plugins.inc.d/vpn.inc");
require_once("pfsense-utils.inc"); require_once("pfsense-utils.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
require_once("services.inc");
require_once("plugins.inc.d/vpn.inc");
if (!isset($config['l2tp']['radius']) || !is_array($config['l2tp']['radius'])) { if (!isset($config['l2tp']['radius']) || !is_array($config['l2tp']['radius'])) {
$config['l2tp']['radius'] = array(); $config['l2tp']['radius'] = array();
...@@ -164,6 +165,8 @@ if ($_POST) { ...@@ -164,6 +165,8 @@ if ($_POST) {
} }
} }
$service_hook = 'l2tpd';
include("head.inc"); include("head.inc");
?> ?>
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
*/ */
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("services.inc");
require_once("plugins.inc.d/vpn.inc"); require_once("plugins.inc.d/vpn.inc");
if (!isset($config['l2tp']['user'])) { if (!isset($config['l2tp']['user'])) {
...@@ -62,6 +63,8 @@ if ($_GET['act'] == "del") { ...@@ -62,6 +63,8 @@ if ($_GET['act'] == "del") {
} }
} }
$service_hook = 'l2tpd';
include("head.inc"); include("head.inc");
......
...@@ -44,6 +44,7 @@ function l2tp_users_sort() ...@@ -44,6 +44,7 @@ function l2tp_users_sort()
} }
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("services.inc");
require_once("plugins.inc.d/vpn.inc"); require_once("plugins.inc.d/vpn.inc");
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/vpn_l2tp_users.php'); $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/vpn_l2tp_users.php');
...@@ -122,18 +123,18 @@ if ($_POST) { ...@@ -122,18 +123,18 @@ if ($_POST) {
} else { } else {
$a_secret[] = $secretent; $a_secret[] = $secretent;
} }
l2tp_users_sort();
l2tp_users_sort();
write_config(); write_config();
vpn_l2tp_configure();
$retval = vpn_l2tp_configure();
header("Location: vpn_l2tp_users.php"); header("Location: vpn_l2tp_users.php");
exit; exit;
} }
} }
$service_hook = 'l2tpd';
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