mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-09 01:34:19 +00:00
01_FHEMWEB.pm: slight "deleteattr csrfToken" fixes (Forum #68133)
git-svn-id: https://svn.fhem.de/fhem/trunk@13613 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e578ad5d8e
commit
79284074c3
@ -2495,10 +2495,10 @@ FW_Attr(@)
|
||||
$modules{FHEMWEB}{AttrList} .= " ".join(" ",@add) if(@add);
|
||||
}
|
||||
|
||||
if($attrName eq "csrfToken" && $type eq "set") {
|
||||
if($attrName eq "csrfToken") {
|
||||
return undef if($FW_csrfTokenCache{$devName} && !$init_done);
|
||||
my $csrf = $param[0];
|
||||
if($csrf eq "random") {
|
||||
if($type eq "del" || $csrf eq "random") {
|
||||
my ($x,$y) = gettimeofday();
|
||||
($csrf = "csrf_".(rand($y)*rand($x))) =~ s/[^a-z_0-9]//g;
|
||||
}
|
||||
@ -2512,11 +2512,6 @@ FW_Attr(@)
|
||||
}
|
||||
}
|
||||
|
||||
if($attrName eq "csrfToken" && $type eq "del") {
|
||||
delete($hash->{CSRFTOKEN});
|
||||
delete($FW_csrfTokenCache{$devName});
|
||||
}
|
||||
|
||||
if($attrName eq "longpoll" && $type eq "set" && $param[0] eq "websocket") {
|
||||
eval { require Digest::SHA; };
|
||||
if($@) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user