2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-22 08:11:44 +00:00

96_allowed: add logging for forbidden commands/devices (Forum #83203)

git-svn-id: https://svn.fhem.de/fhem/trunk@15994 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2018-01-25 22:26:58 +00:00
parent 90b9eb5f7b
commit d355dc7f1b

View File

@ -78,12 +78,16 @@ allowed_Authorize($$$$)
if($type eq "cmd") {
return 0 if(!$me->{allowedCommands});
# Return 0: allow stacking with other instances, see Forum#46380
return ($me->{allowedCommands} =~ m/\b\Q$arg\E\b/) ? 0 : 2;
return 0 if($me->{allowedCommands} =~ m/\b\Q$arg\E\b/);
Log3 $me, 4, "Forbidden command $arg for $cl->{NAME}";
return 2;
}
if($type eq "devicename") {
return 0 if(!$me->{allowedDevices});
return ($me->{allowedDevices} =~ m/\b\Q$arg\E\b/) ? 0 : 2;
return if($me->{allowedDevices} =~ m/\b\Q$arg\E\b/);
Log3 $me, 4, "Forbidden device $arg for $cl->{NAME}";
return 2;
}