summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2017-01-16 23:20:46 +0100
committerRenato Botelho <renato@netgate.com>2017-01-17 09:37:17 -0200
commita929acf0ce4a6c7bdf90331771fe26e9e99f4727 (patch)
treef51707663d8e3a8b18a77b77a9c53d0ffa86adf1 /src/usr/local/www
parentdafe20effd3eaf87960856396b769a1cec83144c (diff)
downloadpfsense-a929acf0ce4a6c7bdf90331771fe26e9e99f4727.zip
pfsense-a929acf0ce4a6c7bdf90331771fe26e9e99f4727.tar.gz
Only show the DHCP Leases Status link if DHCP server is enabled
Does not make sense otherwise, can only contain stale data. (cherry picked from commit 8ed692516534248e58a20aec70f8cf3035d35348)
Diffstat (limited to 'src/usr/local/www')
-rw-r--r--src/usr/local/www/widgets/widgets/wake_on_lan.widget.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/usr/local/www/widgets/widgets/wake_on_lan.widget.php b/src/usr/local/www/widgets/widgets/wake_on_lan.widget.php
index 9ed1de7..bf8118d 100644
--- a/src/usr/local/www/widgets/widgets/wake_on_lan.widget.php
+++ b/src/usr/local/www/widgets/widgets/wake_on_lan.widget.php
@@ -3,7 +3,7 @@
* wake_on_lan.widget.php
*
* part of pfSense (https://www.pfsense.org)
- * Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
+ * Copyright (c) 2004-2017 Rubicon Communications, LLC (Netgate)
* Copyright (c) 2010 Yehuda Katz
* All rights reserved.
*
@@ -141,7 +141,20 @@ endif;
?>
</tbody>
</table>
-<p class="text-center"><a href="status_dhcp_leases.php" class="navlink"><?=gettext('DHCP Leases Status')?></a></p>
+<?php
+$dhcpd_enabled = false;
+if (is_array($config['dhcpd'])) {
+ foreach ($config['dhcpd'] as $dhcpif => $dhcp) {
+ if (isset($dhcp['enable']) && isset($config['interfaces'][$dhcpif]['enable'])) {
+ $dhcpd_enabled = true;
+ break;
+ }
+ }
+}
+?>
+<?php if ($dhcpd_enabled): ?>
+ <p class="text-center"><a href="status_dhcp_leases.php" class="navlink"><?=gettext('DHCP Leases Status')?></a></p>
+<?php endif; ?>
</div>
<!-- close the body we're wrapped in and add a configuration-panel -->
</div><div id="widget-<?=$widgetname?>_panel-footer" class="panel-footer collapse">
OpenPOWER on IntegriCloud