Bugfix: additional account switch failed due to the old ParentEmail

This commit is contained in:
djmaze 2021-12-01 10:51:58 +01:00
parent d4e77a97f5
commit 8aad63fcf8
3 changed files with 2 additions and 9 deletions

View file

@ -193,7 +193,7 @@ abstract class Account implements \JsonSerializable
array $aAccountHash,
bool $bThrowExceptionOnFalse = false): ?self
{
if (!empty($aAccountHash[0]) && 'account' === $aAccountHash[0] && 7 === \count($aAccountHash)) {
if (!empty($aAccountHash[0]) && 'account' === $aAccountHash[0] && 7 <= \count($aAccountHash)) {
$oAccount = static::NewInstanceByLogin(
$oActions,
$aAccountHash[1] ?: '',

View file

@ -17,13 +17,6 @@ class AdditionalAccount extends Account
return \md5(parent::Hash() . $this->ParentEmail());
}
public function jsonSerialize()
{
$aData = parent::jsonSerialize();
$aData[] = ''; // was ParentEmail
return $aData;
}
public function asTokenArray(MainAccount $oMainAccount) : array
{
$sHash = $oMainAccount->CryptKey();

View file

@ -192,6 +192,6 @@ abstract class Crypt
}
\SnappyMail\Crypt::setCipher(\RainLoop\API::Config()->Get('security', 'encrypt_cipher', 'aes-256-cbc-hmac-sha1'))
\SnappyMail\Crypt::setCipher(\RainLoop\Api::Config()->Get('security', 'encrypt_cipher', 'aes-256-cbc-hmac-sha1'))
|| \SnappyMail\Crypt::setCipher('aes-256-cbc-hmac-sha1')
|| \SnappyMail\Crypt::setCipher('aes-256-xts');