summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/services_wol.php
diff options
context:
space:
mode:
authorSteve Beaver <sbeaver@netgate.com>2017-02-14 14:42:13 -0500
committerSteve Beaver <sbeaver@netgate.com>2017-02-14 14:42:13 -0500
commit13541a81e1173fc02af9af8ab7fe46df2a51007d (patch)
treec87a8d90338bfb1e2c245b58e77cca67b70c8c60 /src/usr/local/www/services_wol.php
parentc946d7217bff529d246084f9b83212ad0ab730a3 (diff)
downloadpfsense-13541a81e1173fc02af9af8ab7fe46df2a51007d.zip
pfsense-13541a81e1173fc02af9af8ab7fe46df2a51007d.tar.gz
GET/POST conversions
Diffstat (limited to 'src/usr/local/www/services_wol.php')
-rw-r--r--src/usr/local/www/services_wol.php27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/usr/local/www/services_wol.php b/src/usr/local/www/services_wol.php
index 4119561..5afbf26 100644
--- a/src/usr/local/www/services_wol.php
+++ b/src/usr/local/www/services_wol.php
@@ -36,7 +36,7 @@ if (!is_array($config['wol']['wolentry'])) {
}
$a_wol = &$config['wol']['wolentry'];
-if ($_GET['wakeall'] != "") {
+if ($_REQUEST['wakeall'] != "") {
$i = 0;
$savemsg = "";
foreach ($a_wol as $wolent) {
@@ -59,25 +59,20 @@ if ($_GET['wakeall'] != "") {
}
}
-if ($_POST || $_GET['mac']) {
+if ($_POST['Submit'] || $_POST['mac']) {
unset($input_errors);
- if ($_GET['mac']) {
+ if ($_POST['mac']) {
/* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
- $_GET['mac'] = strtolower(str_replace("-", ":", $_GET['mac']));
- $mac = $_GET['mac'];
- $if = $_GET['if'];
- } else {
- /* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
- $_POST['mac'] = strtolower(str_replace("-", ":", $_POST['mac']));
- $mac = $_POST['mac'];
- $if = $_POST['interface'];
+ $mac = strtolower(str_replace("-", ":", $_POST['mac']));
+ $if = $_POST['if'];
}
/* input validation */
if (!$mac || !is_macaddr($mac)) {
$input_errors[] = gettext("A valid MAC address must be specified.");
}
+
if (!$if) {
$input_errors[] = gettext("A valid interface must be specified.");
}
@@ -101,9 +96,9 @@ if ($_POST || $_GET['mac']) {
}
}
-if ($_GET['act'] == "del") {
- if ($a_wol[$_GET['id']]) {
- unset($a_wol[$_GET['id']]);
+if ($_POST['act'] == "del") {
+ if ($a_wol[$_POST['id']]) {
+ unset($a_wol[$_POST['id']]);
write_config();
header("Location: services_wol.php");
exit;
@@ -192,8 +187,8 @@ print $form;
</td>
<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?>"></a>
- <a class="fa fa-power-off" title="<?=gettext('Wake Device')?>" href="?mac=<?=$wolent['mac'];?>&amp;if=<?=$wolent['interface'];?>"></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>
</td>
</tr>
<?php endforeach?>
OpenPOWER on IntegriCloud