summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfSense.geekgod.com>2009-06-21 19:18:48 -0400
committerScott Ullrich <sullrich@pfSense.geekgod.com>2009-06-21 19:19:13 -0400
commite4fdbcf2769cae47728662fce02f05494f71b18c (patch)
treebe8e7e2d19c2be51489016deba5b27e3d79ab1a0 /usr/local/www
parenta2c59511cde1ad4be26a1250baf6c0eaf0898481 (diff)
downloadpfsense-e4fdbcf2769cae47728662fce02f05494f71b18c.zip
pfsense-e4fdbcf2769cae47728662fce02f05494f71b18c.tar.gz
Commit patches from jim-p:
1. When deleting a lease, if you were viewing all leases, it should now retain that view after deleting. 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 777da4a..a05447e 100755
--- a/usr/local/www/diag_dhcp_leases.php
+++ b/usr/local/www/diag_dhcp_leases.php
@@ -66,7 +66,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");
@@ -364,7 +364,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 b5b75bd..96dd735 100755
--- a/usr/local/www/services_dhcp.php
+++ b/usr/local/www/services_dhcp.php
@@ -38,6 +38,8 @@ require("guiconfig.inc");
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