summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorjim-p <jim@pingle.org>2009-06-21 11:39:57 -0400
committerjim-p <jim@pingle.org>2009-06-21 11:41:32 -0400
commit69ec9ecfb43ac85c5e9bb59b563f9471e169ad0e (patch)
tree259b45fcde8b80c4ae43e0a575199b710b78c661 /usr/local/www
parent32a7a1f64d2673756c8461b05c711306148ba3a9 (diff)
downloadpfsense-69ec9ecfb43ac85c5e9bb59b563f9471e169ad0e.zip
pfsense-69ec9ecfb43ac85c5e9bb59b563f9471e169ad0e.tar.gz
Fix a couple minor bugs in DHCP lease deletion.
1. When deleting a lease, if you were viewing all leases, it should now retain that view. 2. When checking for leases to clean, bail if there is no leases file. Otherwise there is an ugly error about not being able to open the dhcpd.leases file.
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/diag_dhcp_leases.php4
-rwxr-xr-xusr/local/www/services_dhcp.php2
2 files changed, 4 insertions, 2 deletions
diff --git a/usr/local/www/diag_dhcp_leases.php b/usr/local/www/diag_dhcp_leases.php
index 21a4f70..bdf02c9 100755
--- a/usr/local/www/diag_dhcp_leases.php
+++ b/usr/local/www/diag_dhcp_leases.php
@@ -74,7 +74,7 @@ if (($_GET['deleteip']) && (is_ipaddr($_GET['deleteip']))) {
/* Restart DHCP Service */
services_dhcpd_configure();
- header("Location: diag_dhcp_leases.php");
+ header("Location: diag_dhcp_leases.php?all={$_GET['all']}");
}
include("head.inc");
@@ -382,7 +382,7 @@ foreach ($leases as $data) {
/* Only show the button for offline dynamic leases */
if (($data['type'] == "dynamic") && ($data['online'] != "online")) {
- echo "<td class=\"list\" valign=\"middle\"><a href=\"diag_dhcp_leases.php?deleteip={$data['ip']}\">";
+ echo "<td class=\"list\" valign=\"middle\"><a href=\"diag_dhcp_leases.php?deleteip={$data['ip']}&all={$_GET['all']}\">";
echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_x.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"delete this dhcp lease\"></a></td>\n";
}
echo "</tr>\n";
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php
index 99651cb..7c94947 100755
--- a/usr/local/www/services_dhcp.php
+++ b/usr/local/www/services_dhcp.php
@@ -50,6 +50,8 @@ if(!$g['services_dhcp_server_enable']) {
function dhcp_clean_leases() {
global $g, $config;
$leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases";
+ if (!file_exists($leasesfile))
+ return;
/* Build list of static MACs */
$staticmacs = array();
foreach($config['interfaces'] as $ifname => $ifarr)
OpenPOWER on IntegriCloud