2.20.5 - fix for broken admin login

In 2.20.5 if you try to login to admin panel you get errors:

PHP message: PHP Notice: Undefined variable: sToken in /(...)/snappymail/v/2.20.5/app/libraries/RainLoop/ActionsAdmin.php on line 126

SERVICE[WARNING]: Argument 1 passed to RainLoop\ActionsAdmin::setAdminAuthToken() must be of the type string, null given, called in /(...)/snappymail/v/2.20.5/app/libraries/RainLoop/ActionsAdmin.php on line 126
This commit is contained in:
LukaszC86 2022-11-08 09:36:13 +01:00 committed by GitHub
parent 883906f441
commit ed89b60892
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -123,7 +123,7 @@ class ActionsAdmin extends Actions
throw new ClientException(Notifications::AuthError);
}
$sToken = $this->setAdminAuthToken($sToken);
$sToken = $this->setAdminAuthToken();
return $this->DefaultResponse(__FUNCTION__, $sToken ? $this->AppData(true) : false);
}
@ -667,7 +667,7 @@ class ActionsAdmin extends Actions
return $this->DefaultResponse(__FUNCTION__, $QR->__toString());
}
private function setAdminAuthToken(string $sToken) : string
private function setAdminAuthToken() : string
{
$sRand = \MailSo\Base\Utils::Sha1Rand();
if (!$this->Cacher(null, true)->Set(KeyPathHelper::SessionAdminKey($sRand), \time())) {