diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-06-30 17:11:30 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-06-30 17:15:22 +0000 |
commit | a368a026db2e79ef7c48f5db0fbff27da5468c26 (patch) | |
tree | 0b68b80cafa3f8cc310d8deaaa8a8fbd2e2f0482 /usr/local/www/services_dhcp.php | |
parent | 6819b7f60c841f89e415d6547e2e776cf1a47c5e (diff) | |
download | pfsense-a368a026db2e79ef7c48f5db0fbff27da5468c26.zip pfsense-a368a026db2e79ef7c48f5db0fbff27da5468c26.tar.gz |
* Reorganize the 'apply' button infrustructure in the GUI.
- Present three new functions is/mark/clear_subsystem_dirty('name_of_subsystem'). This makes easier to create such things without needing to introduce new globals.
- Convert all pages to the new infrustructure
- This improves a lot the control on this notification
Diffstat (limited to 'usr/local/www/services_dhcp.php')
-rwxr-xr-x | usr/local/www/services_dhcp.php | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index 7c94947..7856828 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -312,17 +312,13 @@ if ($_POST) { if (isset($config['dnsmasq']['regdhcpstatic'])) { $retvaldns = services_dnsmasq_configure(); if ($retvaldns == 0) { - if (file_exists($d_hostsdirty_path)) - unlink($d_hostsdirty_path); - if (file_exists($d_staticmapsdirty_path)) - unlink($d_staticmapsdirty_path); + clear_subsystem_dirty('hosts'); + clear_subsystem_dirty('staticmaps'); } } else { $retvaldhcp = services_dhcpd_configure(); - if ($retvaldhcp == 0) { - if (file_exists($d_staticmapsdirty_path)) - unlink($d_staticmapsdirty_path); - } + if ($retvaldhcp == 0) + clear_subsystem_dirty('staticmaps'); } if($retvaldhcp == 1 || $retvaldns == 1) $retval = 1; @@ -335,9 +331,9 @@ if ($_GET['act'] == "del") { unset($a_maps[$_GET['id']]); write_config(); if(isset($config['dhcpd'][$if]['enable'])) { - touch($d_staticmapsdirty_path); + mark_subsystem_dirty('staticmaps'); if (isset($config['dnsmasq']['regdhcpstatic'])) - touch($d_hostsdirty_path); + mark_subsystem_dirty('hosts'); } header("Location: services_dhcp.php?if={$if}"); exit; @@ -426,7 +422,7 @@ function show_netboot_config() { exit; } ?> -<?php if (file_exists($d_staticmapsdirty_path)): ?><p> +<?php if (is_subsystem_dirty('staticmaps')): ?><p> <?php print_info_box_np("The static mapping configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br> <?php endif; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> |