mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 00:17:03 +03:00
Changes for #176
This commit is contained in:
parent
6465c95a91
commit
b80e62adfc
1 changed files with 9 additions and 2 deletions
|
|
@ -32,8 +32,15 @@ trait Admin
|
||||||
|
|
||||||
private function getAdminAuthKey() : string
|
private function getAdminAuthKey() : string
|
||||||
{
|
{
|
||||||
$aAdminHash = Utils::DecodeKeyValuesQ(Utils::GetCookie(static::$AUTH_ADMIN_TOKEN_KEY, ''));
|
$cookie = Utils::GetCookie(static::$AUTH_ADMIN_TOKEN_KEY, '');
|
||||||
return (empty($aAdminHash[1]) || 'token' !== $aAdminHash[0]) ? '' : $aAdminHash[1];
|
if ($cookie) {
|
||||||
|
$aAdminHash = Utils::DecodeKeyValuesQ($cookie);
|
||||||
|
if (!empty($aAdminHash[1]) && 'token' === $aAdminHash[0]) {
|
||||||
|
return $aAdminHash[1];
|
||||||
|
}
|
||||||
|
Utils::ClearCookie(static::$AUTH_ADMIN_TOKEN_KEY);
|
||||||
|
}
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
private function setAdminAuthToken(string $sToken) : void
|
private function setAdminAuthToken(string $sToken) : void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue