mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Better bugfix for additional account switching
This commit is contained in:
parent
a736f3697d
commit
64e77de103
1 changed files with 2 additions and 9 deletions
|
|
@ -17,13 +17,6 @@ class AdditionalAccount extends Account
|
||||||
return \md5(parent::Hash() . $this->ParentEmail());
|
return \md5(parent::Hash() . $this->ParentEmail());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function jsonSerialize()
|
|
||||||
{
|
|
||||||
$aData = parent::jsonSerialize();
|
|
||||||
$aData[] = ''; // was ParentEmail
|
|
||||||
return $aData;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function asTokenArray(MainAccount $oMainAccount) : array
|
public function asTokenArray(MainAccount $oMainAccount) : array
|
||||||
{
|
{
|
||||||
$sHash = $oMainAccount->CryptKey();
|
$sHash = $oMainAccount->CryptKey();
|
||||||
|
|
@ -40,9 +33,9 @@ class AdditionalAccount extends Account
|
||||||
bool $bThrowExceptionOnFalse = false) : ?Account /* PHP7.4: ?self*/
|
bool $bThrowExceptionOnFalse = false) : ?Account /* PHP7.4: ?self*/
|
||||||
{
|
{
|
||||||
$iCount = \count($aAccountHash);
|
$iCount = \count($aAccountHash);
|
||||||
if (!empty($aAccountHash[0]) && 'account' === $aAccountHash[0] && 8 <= $iCount && 9 >= $iCount) {
|
if (!empty($aAccountHash[0]) && 'account' === $aAccountHash[0] && 7 <= $iCount && 9 >= $iCount) {
|
||||||
$sHash = $oActions->getMainAccountFromToken()->CryptKey();
|
$sHash = $oActions->getMainAccountFromToken()->CryptKey();
|
||||||
$sPasswordHMAC = (8 < $iCount) ? \array_pop($aAccountHash) : null;
|
$sPasswordHMAC = (7 < $iCount) ? \array_pop($aAccountHash) : null;
|
||||||
if ($sPasswordHMAC && $sPasswordHMAC === \hash_hmac('sha1', $aAccountHash[3], $sHash)) {
|
if ($sPasswordHMAC && $sPasswordHMAC === \hash_hmac('sha1', $aAccountHash[3], $sHash)) {
|
||||||
$aAccountHash[3] = \SnappyMail\Crypt::DecryptUrlSafe($aAccountHash[3], $sHash);
|
$aAccountHash[3] = \SnappyMail\Crypt::DecryptUrlSafe($aAccountHash[3], $sHash);
|
||||||
$aAccountHash[6] = \SnappyMail\Crypt::DecryptUrlSafe($aAccountHash[6], $sHash);
|
$aAccountHash[6] = \SnappyMail\Crypt::DecryptUrlSafe($aAccountHash[6], $sHash);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue