diff options
author | Phil Davis <phil.davis@inf.org> | 2017-01-13 16:13:51 +0545 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-13 16:13:51 +0545 |
commit | 257dd20749a235538855cc5e5fc7484e4fbfbf68 (patch) | |
tree | 30923ca035eb9fd23765f12b01585001f7778631 /src/usr/local/www/services_wol_edit.php | |
parent | c1f1072e147e2b77fc1bbf7d6230267b9d340c83 (diff) | |
download | pfsense-257dd20749a235538855cc5e5fc7484e4fbfbf68.zip pfsense-257dd20749a235538855cc5e5fc7484e4fbfbf68.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.
Diffstat (limited to 'src/usr/local/www/services_wol_edit.php')
-rw-r--r-- | src/usr/local/www/services_wol_edit.php | 7 |
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 9cd6638..b93aab5 100644 --- a/src/usr/local/www/services_wol_edit.php +++ b/src/usr/local/www/services_wol_edit.php @@ -81,6 +81,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']; |