From 7a3fd1bdb109aa85121ffd5ba3fa67defcd7867d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 21 Mar 2016 19:18:16 +0100 Subject: [PATCH] vpn: don't need subnet, some GUI problems weeded out --- src/www/vpn_l2tp.php | 39 ++++++++------------------------------- 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/src/www/vpn_l2tp.php b/src/www/vpn_l2tp.php index b09a54b17..08ffb4121 100644 --- a/src/www/vpn_l2tp.php +++ b/src/www/vpn_l2tp.php @@ -43,7 +43,6 @@ $l2tpcfg = &$config['l2tp']; if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig['remoteip'] = $l2tpcfg['remoteip']; $pconfig['localip'] = $l2tpcfg['localip']; - $pconfig['l2tp_subnet'] = $l2tpcfg['l2tp_subnet']; $pconfig['mode'] = $l2tpcfg['mode']; $pconfig['interface'] = $l2tpcfg['interface']; $pconfig['l2tp_dns1'] = $l2tpcfg['dns1']; @@ -53,7 +52,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig['radacct_enable'] = isset($l2tpcfg['radius']['accounting']); $pconfig['radiusserver'] = $l2tpcfg['radius']['server']; $pconfig['radiussecret'] = $l2tpcfg['radius']['secret']; - $pconfig['radiusissueips'] = $l2tpcfg['radius']['radiusissueips']; + $pconfig['radiusissueips'] = isset($l2tpcfg['radius']['radiusissueips']); $pconfig['n_l2tp_units'] = $l2tpcfg['n_l2tp_units']; $pconfig['paporchap'] = $l2tpcfg['paporchap']; $pconfig['secret'] = $l2tpcfg['secret']; @@ -76,21 +75,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); - if (($_POST['localip'] && !is_ipaddr($_POST['localip']))) { + if ($_POST['localip'] && !is_ipaddr($_POST['localip'])) { $input_errors[] = gettext("A valid server address must be specified."); } if (is_ipaddr_configured($_POST['localip'])) { $input_errors[] = gettext("'Server address' parameter should NOT be set to any IP address currently in use on this firewall."); } - if (($_POST['l2tp_subnet'] && !is_ipaddr($_POST['remoteip']))) { + if ($_POST['localip'] && !is_ipaddr($_POST['remoteip'])) { $input_errors[] = gettext("A valid remote start address must be specified."); } - if (($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver']))) { + if ($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver'])) { $input_errors[] = gettext("A valid RADIUS server address must be specified."); } if (!$input_errors) { - $_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $_POST['l2tp_subnet']); $subnet_start = ip2ulong($_POST['remoteip']); $subnet_end = ip2ulong($_POST['remoteip']) + $_POST['n_l2tp_units'] - 1; @@ -107,7 +105,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (!$input_errors) { $l2tpcfg['remoteip'] = $_POST['remoteip']; $l2tpcfg['localip'] = $_POST['localip']; - $l2tpcfg['l2tp_subnet'] = $_POST['l2tp_subnet']; $l2tpcfg['mode'] = $_POST['mode']; $l2tpcfg['interface'] = $_POST['interface']; $l2tpcfg['n_l2tp_units'] = $_POST['n_l2tp_units']; @@ -238,27 +235,7 @@ include("head.inc"); - - - - - - - @@ -358,10 +335,10 @@ include("head.inc"); - + - > -