mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
96_allowed.pm: add disabledForIntervals (Forum #122077)
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@24751 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ab4b0ee534
commit
d76ce91bc8
@ -32,6 +32,7 @@ allowed_Initialize($)
|
|||||||
basicAuthExpiry
|
basicAuthExpiry
|
||||||
basicAuthMsg
|
basicAuthMsg
|
||||||
disable:1,0
|
disable:1,0
|
||||||
|
disabledForIntervals
|
||||||
globalpassword
|
globalpassword
|
||||||
password
|
password
|
||||||
reportAuthAttempts
|
reportAuthAttempts
|
||||||
@ -95,7 +96,7 @@ allowed_Authorize($$$$;$)
|
|||||||
{
|
{
|
||||||
my ($me, $cl, $type, $arg, $silent) = @_;
|
my ($me, $cl, $type, $arg, $silent) = @_;
|
||||||
|
|
||||||
return 0 if($me->{disabled});
|
return 0 if($me->{disabled} && IsDisabled($me->{NAME}));
|
||||||
my $vName = $cl->{SNAME} ? $cl->{SNAME} : $cl->{NAME};
|
my $vName = $cl->{SNAME} ? $cl->{SNAME} : $cl->{NAME};
|
||||||
return 0 if(!$me->{".validFor"}{$vName});
|
return 0 if(!$me->{".validFor"}{$vName});
|
||||||
my $mName = $me->{NAME};
|
my $mName = $me->{NAME};
|
||||||
@ -150,7 +151,7 @@ allowed_Authenticate($$$$)
|
|||||||
return $r;
|
return $r;
|
||||||
};
|
};
|
||||||
|
|
||||||
return 0 if($me->{disabled});
|
return 0 if($me->{disabled} && IsDisabled($aName));
|
||||||
my $vName = $cl->{SNAME} ? $cl->{SNAME} : $cl->{NAME};
|
my $vName = $cl->{SNAME} ? $cl->{SNAME} : $cl->{NAME};
|
||||||
return 0 if(!$me->{".validFor"}{$vName});
|
return 0 if(!$me->{".validFor"}{$vName});
|
||||||
|
|
||||||
@ -306,8 +307,10 @@ allowed_Attr(@)
|
|||||||
|
|
||||||
my $set = ($type eq "del" ? 0 : (!defined($param[0]) || $param[0]) ? 1 : 0);
|
my $set = ($type eq "del" ? 0 : (!defined($param[0]) || $param[0]) ? 1 : 0);
|
||||||
|
|
||||||
if($attrName eq "disable") {
|
if($attrName eq "disable" ||
|
||||||
readingsSingleUpdate($hash, "state", $set ? "disabled" : "active", 1);
|
$attrName eq "disabledForIntervals") {
|
||||||
|
readingsSingleUpdate($hash, "state", $set ? "disabled" : "active", 1)
|
||||||
|
if($attrName eq "disable");
|
||||||
if($set) {
|
if($set) {
|
||||||
$hash->{disabled} = 1;
|
$hash->{disabled} = 1;
|
||||||
} else {
|
} else {
|
||||||
@ -454,8 +457,6 @@ EOF
|
|||||||
<a name="allowedattr"></a>
|
<a name="allowedattr"></a>
|
||||||
<b>Attributes</b>
|
<b>Attributes</b>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#disable">disable</a></li><br>
|
|
||||||
|
|
||||||
<a name="allowedCommands"></a>
|
<a name="allowedCommands"></a>
|
||||||
<li>allowedCommands<br>
|
<li>allowedCommands<br>
|
||||||
A comma separated list of commands allowed from the matching frontend
|
A comma separated list of commands allowed from the matching frontend
|
||||||
@ -511,6 +512,9 @@ EOF
|
|||||||
Only valid if basicAuth is set.
|
Only valid if basicAuth is set.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
|
<li><a href="#disable">disable</a></li></br>
|
||||||
|
<li><a href="#disabledForIntervals">disabledForIntervals</a></li></br>
|
||||||
|
|
||||||
<a name="password"></a>
|
<a name="password"></a>
|
||||||
<li>password<br>
|
<li>password<br>
|
||||||
Specify a password for telnet instances, which has to be entered as the
|
Specify a password for telnet instances, which has to be entered as the
|
||||||
@ -605,9 +609,6 @@ EOF
|
|||||||
<a name="allowedattr"></a>
|
<a name="allowedattr"></a>
|
||||||
<b>Attribute</b>
|
<b>Attribute</b>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#disable">disable</a>
|
|
||||||
</li><br>
|
|
||||||
|
|
||||||
<a name="allowedCommands"></a>
|
<a name="allowedCommands"></a>
|
||||||
<li>allowedCommands<br>
|
<li>allowedCommands<br>
|
||||||
Eine Komma getrennte Liste der erlaubten Befehle des passenden
|
Eine Komma getrennte Liste der erlaubten Befehle des passenden
|
||||||
@ -656,6 +657,9 @@ EOF
|
|||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
|
|
||||||
|
<li><a href="#disable">disable</a><br>disable</li></br>
|
||||||
|
<li><a href="#disabledForIntervals">disabledForIntervals</a></li></br>
|
||||||
|
|
||||||
<a name="password"></a>
|
<a name="password"></a>
|
||||||
<li>password<br>
|
<li>password<br>
|
||||||
Betrifft nur telnet Instanzen (siehe validFor): Bezeichnet ein
|
Betrifft nur telnet Instanzen (siehe validFor): Bezeichnet ein
|
||||||
|
Loading…
x
Reference in New Issue
Block a user