Project

General

Profile

Feature #15323 ยป services_wol-pf2.7.2-v1.0.php.patch

Phil Wardt, 03/08/2024 09:33 PM

View differences:

src/usr/local/www/services_wol.php
/* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
$mac = strtolower(str_replace("-", ":", $_POST['mac']));
$if = $_POST['if'];
$descr = $_POST['descr'];
}
/* input validation */
......
}
if (!$input_errors) {
send_wol($if, $mac, '', $savemsg, $class);
send_wol($if, $mac, $descr, $savemsg, $class);
}
}
......
<?=convert_friendly_interface_to_friendly_descr($wolent['interface']);?>
</td>
<td>
<a href="?mac=<?=$wolent['mac'];?>&amp;if=<?=$wolent['interface'];?>" usepost><?=strtolower($wolent['mac']);?></a>
<a href="?mac=<?=$wolent['mac'];?>&amp;descr=<?=$wolent['descr'];?>&amp;if=<?=$wolent['interface'];?>" usepost><?=strtolower($wolent['mac']);?></a>
</td>
<td>
<?=htmlspecialchars($wolent['descr']);?>
......
<td>
<a class="fa fa-pencil" title="<?=gettext('Edit Device')?>" href="services_wol_edit.php?id=<?=$i?>"></a>
<a class="fa fa-trash" title="<?=gettext('Delete Device')?>" href="services_wol.php?act=del&amp;id=<?=$i?>" usepost></a>
<a class="fa fa-power-off" title="<?=gettext('Wake Device')?>" href="?mac=<?=$wolent['mac'];?>&amp;if=<?=$wolent['interface'];?>" usepost></a>
<a class="fa fa-power-off" title="<?=gettext('Wake Device')?>" href="?mac=<?=$wolent['mac'];?>&amp;descr=<?=$wolent['descr'];?>&amp;if=<?=$wolent['interface'];?>" usepost></a>
</td>
</tr>
<?php endforeach?>
    (1-1/1)