2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

fhem.pl: add Authorization logging (Forum #46380)

git-svn-id: https://svn.fhem.de/fhem/trunk@10310 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-12-30 15:32:59 +00:00
parent ea39da0012
commit dba76334ab

View File

@ -4545,9 +4545,15 @@ Authorized($$$)
return 1 if(!$init_done || !$cl || !$cl->{SNAME}); # Safeguarding return 1 if(!$init_done || !$cl || !$cl->{SNAME}); # Safeguarding
RefreshAuthList() if($auth_refresh); RefreshAuthList() if($auth_refresh);
my $sname = $cl->{SNAME};
my $verbose = AttrVal($sname, "verbose", 1); # Speedup?
foreach my $a (@authorize) { foreach my $a (@authorize) {
my $r = CallFn($a, "AuthorizeFn", $defs{$a}, $cl, $type, $arg); my $r = CallFn($a, "AuthorizeFn", $defs{$a}, $cl, $type, $arg);
if($verbose >= 4) {
Log3 $sname, 4, "authorize $sname/$type/$arg: $a returned ".
($r == 0 ? "dont care" : $r == 1 ? "allowed" : "prohibited");
}
return 1 if($r == 1); return 1 if($r == 1);
return 0 if($r == 2); return 0 if($r == 2);
} }