mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +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:
parent
ea39da0012
commit
dba76334ab
@ -4545,9 +4545,15 @@ Authorized($$$)
|
||||
|
||||
return 1 if(!$init_done || !$cl || !$cl->{SNAME}); # Safeguarding
|
||||
RefreshAuthList() if($auth_refresh);
|
||||
my $sname = $cl->{SNAME};
|
||||
my $verbose = AttrVal($sname, "verbose", 1); # Speedup?
|
||||
|
||||
foreach my $a (@authorize) {
|
||||
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 0 if($r == 2);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user