summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2017-01-13 16:13:51 +0545
committerRenato Botelho <renato@netgate.com>2017-01-13 18:49:19 -0200
commit848ace91857315ce3bc120e59a735d2fd7b9af98 (patch)
treedd27a8af8fc903c50890a492356bfc497530fc0a /src/usr
parente296b39919ebc9a74136c2074b7d77c250a3a17f (diff)
downloadpfsense-848ace91857315ce3bc120e59a735d2fd7b9af98.zip
pfsense-848ace91857315ce3bc120e59a735d2fd7b9af98.tar.gz
Check for duplicate Wake on LAN entries
Currently it is posible to enter an interface+MAC combination that is already in the WoL list. That seems silly. (cherry picked from commit 257dd20749a235538855cc5e5fc7484e4fbfbf68)
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/local/www/services_wol_edit.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/usr/local/www/services_wol_edit.php b/src/usr/local/www/services_wol_edit.php
index 25720a2..66064d5 100644
--- a/src/usr/local/www/services_wol_edit.php
+++ b/src/usr/local/www/services_wol_edit.php
@@ -113,6 +113,13 @@ if ($_POST) {
$input_errors[] = gettext("A valid MAC address must be specified.");
}
+ foreach ($a_wol as $wolidx => $wolentry) {
+ if ((!isset($id) || ($wolidx != $id)) && ($wolentry['interface'] == $_POST['interface']) && ($wolentry['mac'] == $_POST['mac'])) {
+ $input_errors[] = gettext("This interface and MAC address wake-on-LAN entry already exists.");
+ break;
+ }
+ }
+
if (!$input_errors) {
$wolent = array();
$wolent['interface'] = $_POST['interface'];
OpenPOWER on IntegriCloud