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 | |
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')
-rwxr-xr-x | usr/local/www/vpn_ipsec.php | 14 | ||||
-rw-r--r-- | usr/local/www/vpn_ipsec_phase1.php | 5 |
2 files changed, 7 insertions, 12 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']]); diff --git a/usr/local/www/vpn_ipsec_phase1.php b/usr/local/www/vpn_ipsec_phase1.php index c6eeca5..936a8dc 100644 --- a/usr/local/www/vpn_ipsec_phase1.php +++ b/usr/local/www/vpn_ipsec_phase1.php @@ -57,7 +57,10 @@ if (isset($_GET['dup'])) { if (isset($p1index) && $a_phase1[$p1index]) { - $pconfig['ikeid'] = $a_phase1[$p1index]['ikeid']; + // don't copy the ikeid on dup + if (!isset($_GET['dup'])) + $pconfig['ikeid'] = $a_phase1[$p1index]['ikeid']; + $pconfig['disabled'] = isset($a_phase1[$p1index]['disabled']); if ($a_phase1[$p1index]['interface']) |