From 16e8f9ea9d0be6a6e165ba9b7a20edaeda46b3d1 Mon Sep 17 00:00:00 2001 From: Ilia Date: Sat, 28 May 2022 21:31:19 +0300 Subject: [PATCH] Cache mode --- web-lib-funcs.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index 297ad4914..f96bbb586 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -12138,8 +12138,12 @@ return $u eq 'root' || # Returns currently logged in user mode sub webmin_user_login_mode { -# Default mode -my $mode = 'root'; + +# Cache and store mode +state $mode; +return $mode + if ($mode); +$mode = 'root'; # Check for foreign modules my $foreign_virtual_server