mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
fix email verification status
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
parent
981c110f7e
commit
5fa0e6df39
2 changed files with 6 additions and 2 deletions
|
|
@ -97,7 +97,7 @@ class AccountManager {
|
|||
if (empty($userData)) {
|
||||
$this->insertNewUser($user, $data);
|
||||
} elseif ($userData !== $data) {
|
||||
$this->checkEmailVerification($userData, $data, $user);
|
||||
$data = $this->checkEmailVerification($userData, $data, $user);
|
||||
$data = $this->updateVerifyStatus($userData, $data);
|
||||
$this->updateExistingUser($user, $data);
|
||||
} else {
|
||||
|
|
@ -147,6 +147,7 @@ class AccountManager {
|
|||
* @param $oldData
|
||||
* @param $newData
|
||||
* @param IUser $user
|
||||
* @return array
|
||||
*/
|
||||
protected function checkEmailVerification($oldData, $newData, IUser $user) {
|
||||
if ($oldData[self::PROPERTY_EMAIL]['value'] !== $newData[self::PROPERTY_EMAIL]['value']) {
|
||||
|
|
@ -160,7 +161,10 @@ class AccountManager {
|
|||
'lastRun' => time()
|
||||
]
|
||||
);
|
||||
$newData[AccountManager::PROPERTY_EMAIL]['verified'] = AccountManager::VERIFICATION_IN_PROGRESS;
|
||||
}
|
||||
|
||||
return $newData;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class AccountsManagerTest extends TestCase {
|
|||
|
||||
if ($updateExisting) {
|
||||
$accountManager->expects($this->once())->method('checkEmailVerification')
|
||||
->with($oldData, $newData, $user);
|
||||
->with($oldData, $newData, $user)->willReturn($newData);
|
||||
$accountManager->expects($this->once())->method('updateVerifyStatus')
|
||||
->with($oldData, $newData)->willReturn($newData);
|
||||
$accountManager->expects($this->once())->method('updateExistingUser')
|
||||
|
|
|
|||
Loading…
Reference in a new issue