From 4f8e387ddd4cb91d86fdf6f32558d66527338f2a Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 30 Jan 2006 02:25:00 +0000 Subject: OpenVPN cleanups by mposch@gmail.com --- usr/local/www/vpn_openvpn.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'usr/local/www/vpn_openvpn.php') diff --git a/usr/local/www/vpn_openvpn.php b/usr/local/www/vpn_openvpn.php index 95d3dc9..d6d3684 100755 --- a/usr/local/www/vpn_openvpn.php +++ b/usr/local/www/vpn_openvpn.php @@ -50,7 +50,7 @@ if ($_POST) { unset($input_errors); /* input validation */ - if ($_POST['enable']) { + if (isset($_POST['enable'])) { $reqdfields = explode(" ", "tun_iface bind_iface ipblock"); $reqdfieldsn = explode(",", "Tunnel type,Interface binding,IP address block start"); @@ -59,7 +59,7 @@ if ($_POST) { } /* need a test here to make sure prefix and max_clients are coherent */ - + /* Sort out the cert+key files */ if (is_null($_POST['ca_cert'])) $input_errors[] = "You must provide a CA certificate file"; @@ -84,7 +84,6 @@ if ($_POST) { if (!$input_errors) { $server =& $config['ovpn']['server']; $server['enable'] = $_POST['enable'] ? true : false; - /* Make sure that the tunnel interface type has not changed */ if ($server['tun_iface'] != $_POST['tun_iface']){ $server['tun_iface'] = $_POST['tun_iface']; @@ -133,7 +132,7 @@ if ($_POST) { } else{ ovpn_lock(); - $retval = ovpn_config_server(); + $retval = ovpn_config_server($server['enable']); ovpn_unlock(); } $savemsg = get_std_save_message($retval); -- cgit v1.1