2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-04 20:17:45 +00:00

95_dashboard: contrib 3.17.1

git-svn-id: https://svn.fhem.de/fhem/trunk@21176 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-02-11 07:15:07 +00:00
parent a770f191d1
commit 443fe698d1

View File

@ -42,6 +42,7 @@ package main;
use strict; use strict;
use warnings; use warnings;
eval "use FHEM::Meta;1" or my $modMetaAbsent = 1; eval "use FHEM::Meta;1" or my $modMetaAbsent = 1;
use Data::Dumper;
use vars qw(%FW_icons); # List of icons use vars qw(%FW_icons); # List of icons
use vars qw($FW_dir); # base directory for web server use vars qw($FW_dir); # base directory for web server
@ -1054,10 +1055,18 @@ sub Dashboard_GetActiveTab ($;$) {
} }
if (defined($FW_httpheader{Cookie})) { if (defined($FW_httpheader{Cookie})) {
Log3 ($name, 4, "Dashboard $name - Cookie set: ".$FW_httpheader{Cookie}); Log3 ($name, 4, "Dashboard $name - Cookie delivered: ".$FW_httpheader{Cookie});
my %cookie = map({ $_!~/^.*=$/ ? split('=', $_) : "" } split(/; */, $FW_httpheader{Cookie})); # 10.02.2020, Forum: https://forum.fhem.de/index.php/topic,16503.msg1023004.html#msg1023004
# my %cookie = map({ split('=', $_) } split(/; */, $FW_httpheader{Cookie})); # my %cookie = map({ split('=', $_) } split(/; */, $FW_httpheader{Cookie}));
if (defined($cookie{dashboard_activetab})) { my %cookie; # 10.02.2020, Forum: https://forum.fhem.de/index.php/topic,16503.msg1023004.html#msg1023004
foreach (split(/; */, $FW_httpheader{Cookie})) {
my ($k,$v) = split('=', $_);
next if(!defined $v);
$cookie{$k} = $v;
}
Log3($name, 5, "Dashboard $name - Cookie Hash: ". Dumper %cookie);
if (defined($cookie{dashboard_activetab})) {
$activeTab = $cookie{dashboard_activetab}; $activeTab = $cookie{dashboard_activetab};
$activeTab = ($activeTab <= $maxTab)?$activeTab:$maxTab; $activeTab = ($activeTab <= $maxTab)?$activeTab:$maxTab;
} }