Commit 89945eaa 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

(cherry picked from commit 46e132f8)
(cherry picked from commit 77dedce0)
parent 208d267f
......@@ -76,6 +76,8 @@ function remove_duplicate($array, $field)
$interfaces = legacy_config_get_interfaces(array('virtual' => false));
$leasesfile = services_dhcpd_leasesfile();
/* Check if WOL plugin is installed */
$plugin_installed = count(plugins_scan('wol'));
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$awk = "/usr/bin/awk";
......@@ -417,9 +419,16 @@ include("head.inc");?>
<td><?=$data['int'];?></td>
<td><?=$data['ip'];?></td>
<td>
<?php
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");?>">
<?=$data['mac'];?>
</a>
<?php
else: ?>
<?=$data['mac'];?>
<?php
endif; ?>
<br />
<small><i><?=!empty($mac_man[$mac_hi]) ? $mac_man[$mac_hi] : "";?></i></small>
</td>
......@@ -437,9 +446,13 @@ include("head.inc");?>
</a>
<?php
endif;?>
<?php
if ($plugin_installed): ?>
<a class="btn btn-default btn-xs" href="services_wol_edit.php?if=<?=$data['if'];?>&amp;mac=<?=$data['mac'];?>&amp;descr=<?=$data['hostname'];?>">
<span class="glyphicon glyphicon-flash" data-toggle="tooltip" title="<?=gettext("add a Wake on LAN mapping for this MAC address");?>" alt="add"></span>
</a>
<?php
endif;?>
<?php
if (($data['type'] == "dynamic") && ($data['online'] != "online")):?>
......
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