diff options
author | Matthew Grooms <mgrooms@pfsense.org> | 2008-09-16 18:04:08 +0000 |
---|---|---|
committer | Matthew Grooms <mgrooms@pfsense.org> | 2008-09-16 18:04:08 +0000 |
commit | 99bbd213c9698e521dcce58e921ff68eb243fa19 (patch) | |
tree | 697df1e4d017bf348ecca430e1625cd5f3bd8b4a /usr/local/www/vpn_ipsec.php | |
parent | b63f2e8b294527f2fd860899fdc2906fddb0c2f7 (diff) | |
download | pfsense-99bbd213c9698e521dcce58e921ff68eb243fa19.zip pfsense-99bbd213c9698e521dcce58e921ff68eb243fa19.tar.gz |
Fix a few minor problems with the IPsec configuration interface. Make sure
we don't copy the ikeid when duplicating a phase1 entry. Simplify the code
that deletes all associated phase2 entries when a phase1 is deleted. I was
and still am learning the finer points of php.
Diffstat (limited to 'usr/local/www/vpn_ipsec.php')
-rwxr-xr-x | usr/local/www/vpn_ipsec.php | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/usr/local/www/vpn_ipsec.php b/usr/local/www/vpn_ipsec.php index 89016dd..1a42261 100755 --- a/usr/local/www/vpn_ipsec.php +++ b/usr/local/www/vpn_ipsec.php @@ -88,22 +88,14 @@ if ($_GET['act'] == "delph1") { if ($a_phase1[$_GET['p1index']]) { /* remove static route if interface is not WAN */ - if ($a_phase1[$_GET['p1index']]['interface'] <> "wan") { + if ($a_phase1[$_GET['p1index']]['interface'] <> "wan") mwexec("/sbin/route delete -host {$$a_phase1[$_GET['p1index']]['remote-gateway']}"); - } /* remove all phase2 entries that match the ikeid */ $ikeid = $a_phase1[$_GET['p1index']]['ikeid']; - $p2index = 0; - foreach ($a_phase2 as $ph2tmp) { - if ($ph2tmp['ikeid'] == $ikeid) { - /* remove the phase2 entry */ + foreach ($a_phase2 as $p2index => $ph2tmp) + if ($ph2tmp['ikeid'] == $ikeid) unset($a_phase2[$p2index]); - continue; - } - /* only skip if we remove an entry */ - $p2index++; - } /* remove the phase1 entry */ unset($a_phase1[$_GET['p1index']]); |