Bugfix ContactsSync

This commit is contained in:
djmaze 2021-11-18 13:51:28 +01:00
parent 17932f2905
commit 98aff451f5
2 changed files with 3 additions and 2 deletions

View file

@ -33,6 +33,7 @@
td + td {
text-align: center;
vertical-align: middle;
white-space: nowrap;
}
a {

View file

@ -241,7 +241,7 @@ trait Contacts
public function setContactsSyncData(\RainLoop\Model\Account $oAccount, array $aData) : bool
{
$oMainAccount = $this->getAccountFromToken();
$oMainAccount = $this->getMainAccountFromToken();
if ($aData['Password']) {
$aData['Password'] = \SnappyMail\Crypt::EncryptToJSON($aData['Password'], $oMainAccount->CryptKey());
}
@ -264,7 +264,7 @@ trait Contacts
$aData = \json_decode($sData);
if ($aData) {
if ($aData['Password']) {
$oMainAccount = $this->getAccountFromToken();
$oMainAccount = $this->getMainAccountFromToken();
// Verify oAccount password hasn't changed so that Password can be decrypted
if ($aData['PasswordHMAC'] !== \hash_hmac('sha1', $aData['Password'], $oMainAccount->CryptKey())) {
// Failed