diff options
author | Ermal <eri@pfsense.org> | 2010-09-01 15:51:38 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-09-01 15:51:38 +0000 |
commit | e847108459441367a88a6e8185165f2e33690d67 (patch) | |
tree | f6fef1f6cd75052641248cef39dbfa069203147a /usr/local/www/system_routes_edit.php | |
parent | 8e0c376055498bf0a43ff2114062cd8ef8992a09 (diff) | |
download | pfsense-e847108459441367a88a6e8185165f2e33690d67.zip pfsense-e847108459441367a88a6e8185165f2e33690d67.tar.gz |
Ticket #866 #632. Save old settings or actions to be taken for reconfiguring a route/vip on a tmp file and make use that information when apply settings buttons is clicked. This makes the gui behave as expected.
Diffstat (limited to 'usr/local/www/system_routes_edit.php')
-rwxr-xr-x | usr/local/www/system_routes_edit.php | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php index af50af2..9895d0e 100755 --- a/usr/local/www/system_routes_edit.php +++ b/usr/local/www/system_routes_edit.php @@ -1,5 +1,4 @@ <?php -/* $Id$ */ /* system_routes_edit.php part of m0n0wall (http://m0n0.ch/wall) @@ -122,10 +121,23 @@ if ($_POST) { $route['gateway'] = $_POST['gateway']; $route['descr'] = $_POST['descr']; - if (isset($id) && $a_routes[$id]) - $a_routes[$id] = $route; - else - $a_routes[] = $route; + if (!isset($id)) + $id = count($a_routes); + if (file_exists("{$g['tmp_path']}/.system_routes.apply")) + $toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/.system_routes.apply")); + else + $toapplylist = array(); + $oroute = $a_routes[$id]; + + $a_routes[$id] = $route; + + if (!empty($oroute)) { + $osn = explode('/', $oroute['network']); + $sn = explode('/', $route['network']); + if ($oroute['network'] <> $route['network']) + $toapplylist[] = "/sbin/route delete {$oroute['network']}"; + } + file_put_contents("{$g['tmp_path']}/.system_routes.apply", serialize($toapplylist)); staticroutes_sort(); mark_subsystem_dirty('staticroutes'); |