From a6057836c08b6f033ac61fa8a0b05fc684b962fa Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Wed, 3 Sep 2014 16:34:01 -0300 Subject: Use array id to delete phase2, it will simplify changes I'm working on and will commit soon --- usr/local/www/vpn_ipsec.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/usr/local/www/vpn_ipsec.php b/usr/local/www/vpn_ipsec.php index f46cd8c..ed5dbd9 100644 --- a/usr/local/www/vpn_ipsec.php +++ b/usr/local/www/vpn_ipsec.php @@ -150,14 +150,9 @@ if (isset($_GET['p1index']) && is_numericint($_GET['p1index']) && isset($a_phase mark_subsystem_dirty('ipsec'); } else if ($_GET['act'] == "delph2") { /* remove the phase2 entry */ - foreach ($a_phase2 as $ph2idx => $ph2) { - if ($ph2['uniqid'] == $_GET['p2index']) { - unset($a_phase2[$ph2idx]); - write_config(); - mark_subsystem_dirty('ipsec'); - break; - } - } + unset($a_phase2[$_GET['p2index']]); + write_config(); + mark_subsystem_dirty('ipsec'); } else if ($_GET['act'] == "toggle") { if (isset($a_phase1[$_GET['p1index']]['disabled'])) unset($a_phase1[$_GET['p1index']]['disabled']); @@ -410,7 +405,7 @@ include("head.inc"); $ph2ent): if ($ph2ent['ikeid'] != $ph1ent['ikeid']) continue; @@ -487,7 +482,7 @@ include("head.inc"); " width="17" height="17" border="0" alt="edit" /> - ')"> + ')"> " width="17" height="17" border="0" alt="delete" /> -- cgit v1.1