mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 03:59:21 +03:00
Contact sync use Account password hash
This commit is contained in:
parent
c13724fbbb
commit
1dd592f81f
2 changed files with 7 additions and 2 deletions
|
|
@ -32,7 +32,7 @@ trait Contacts
|
|||
\json_encode(array(
|
||||
'Enable' => $bEnabled,
|
||||
'User' => $sUser,
|
||||
'Password' => $sPassword ? \SnappyMail\Crypt::Encrypt($sPassword, $oAccount->Password() ?: APP_SALT) : null,
|
||||
'Password' => $sPassword ? \SnappyMail\Crypt::Encrypt($sPassword, $oAccount->PasswordHash()) : null,
|
||||
'Url' => $sUrl
|
||||
))
|
||||
);
|
||||
|
|
@ -253,7 +253,7 @@ trait Contacts
|
|||
if ($aData['Password']) {
|
||||
$aData['Password'] = \SnappyMail\Crypt::DecryptFromJSON(
|
||||
$aData['Password'],
|
||||
$oAccount->Password() ?: APP_SALT
|
||||
$oAccount->PasswordHash()
|
||||
);
|
||||
}
|
||||
return $aData;
|
||||
|
|
|
|||
|
|
@ -114,6 +114,11 @@ class Account implements \JsonSerializable
|
|||
return $this->IncPassword();
|
||||
}
|
||||
|
||||
public function PasswordHash() : string
|
||||
{
|
||||
return \sha1($this->IncPassword() + APP_SALT, true);
|
||||
}
|
||||
|
||||
public function ClientCert() : string
|
||||
{
|
||||
return $this->sClientCert;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue