From 767cf960f4f7f6f525d971f6247c663590c1637e Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 25 Sep 2012 11:50:08 -0400 Subject: Refine OpenVPN client/server deletion to allow for removing invalid empty entries. Fixes #2643 --- usr/local/www/vpn_openvpn_client.php | 6 +++--- usr/local/www/vpn_openvpn_server.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php index f2002ed..8b269f5 100644 --- a/usr/local/www/vpn_openvpn_client.php +++ b/usr/local/www/vpn_openvpn_client.php @@ -75,12 +75,12 @@ else if ($_GET['act'] == "del") { - if (!$a_client[$id]) { + if (!isset($a_client[$id])) { pfSenseHeader("vpn_openvpn_client.php"); exit; } - - openvpn_delete('client', $a_client[$id]); + if (!empty($a_client[$id])) + openvpn_delete('client', $a_client[$id]); unset($a_client[$id]); write_config(); $savemsg = gettext("Client successfully deleted")."
"; diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php index d098f43..f038271 100644 --- a/usr/local/www/vpn_openvpn_server.php +++ b/usr/local/www/vpn_openvpn_server.php @@ -76,12 +76,12 @@ else if ($_GET['act'] == "del") { - if (!$a_server[$id]) { + if (!isset($a_server[$id])) { pfSenseHeader("vpn_openvpn_server.php"); exit; } - - openvpn_delete('server', $a_server[$id]); + if (!empty($a_server[$id])) + openvpn_delete('server', $a_server[$id]); unset($a_server[$id]); write_config(); $savemsg = gettext("Server successfully deleted")."
"; -- cgit v1.1