Commit 46e132f8 authored by Frank Wall's avatar Frank Wall Committed by Franco Fichtner

DHCP leases: do not link to WOL page if WOL plugin is missing

parent 1a76aa95
...@@ -76,6 +76,8 @@ function remove_duplicate($array, $field) ...@@ -76,6 +76,8 @@ function remove_duplicate($array, $field)
$interfaces = legacy_config_get_interfaces(array('virtual' => false)); $interfaces = legacy_config_get_interfaces(array('virtual' => false));
$leasesfile = services_dhcpd_leasesfile(); $leasesfile = services_dhcpd_leasesfile();
/* Check if WOL plugin is installed */
$plugin_installed = count(plugins_scan('wol'));
if ($_SERVER['REQUEST_METHOD'] === 'GET') { if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$awk = "/usr/bin/awk"; $awk = "/usr/bin/awk";
...@@ -417,9 +419,13 @@ include("head.inc");?> ...@@ -417,9 +419,13 @@ include("head.inc");?>
<td><?=$data['int'];?></td> <td><?=$data['int'];?></td>
<td><?=$data['ip'];?></td> <td><?=$data['ip'];?></td>
<td> <td>
<? if ($plugin_installed) { ?>
<a href="services_wol.php?if=<?=$data['if'];?>&amp;mac=<?=$data['mac'];?>" title="<?=gettext("send Wake on LAN packet to this MAC address");?>"> <a href="services_wol.php?if=<?=$data['if'];?>&amp;mac=<?=$data['mac'];?>" title="<?=gettext("send Wake on LAN packet to this MAC address");?>">
<?=$data['mac'];?> <?=$data['mac'];?>
</a> </a>
<? } else { ?>
<?=$data['mac'];?>
<? } ?>
<br /> <br />
<small><i><?=!empty($mac_man[$mac_hi]) ? $mac_man[$mac_hi] : "";?></i></small> <small><i><?=!empty($mac_man[$mac_hi]) ? $mac_man[$mac_hi] : "";?></i></small>
</td> </td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment