diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-05-08 17:51:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-08 17:51:07 +0200 |
commit | 9bc77f2914d4bc7cb7ba39cbf6969db7627a4338 (patch) | |
tree | 5bbfa0a9c2835d609ee702bbd4dd38576e0130a5 /settings | |
parent | ecba440574e96420e375217adf5bb19585aed0c6 (diff) | |
parent | 327cddc157169bd12b58239fed0b286bf0cac16c (diff) | |
download | nextcloud-server-9bc77f2914d4bc7cb7ba39cbf6969db7627a4338.tar.gz nextcloud-server-9bc77f2914d4bc7cb7ba39cbf6969db7627a4338.zip |
Merge pull request #4695 from nextcloud/reset-verify-state
reset verification state if max tries are reached
Diffstat (limited to 'settings')
-rw-r--r-- | settings/BackgroundJobs/VerifyUserData.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/settings/BackgroundJobs/VerifyUserData.php b/settings/BackgroundJobs/VerifyUserData.php index 4a32398f6c4..8c02ae1727c 100644 --- a/settings/BackgroundJobs/VerifyUserData.php +++ b/settings/BackgroundJobs/VerifyUserData.php @@ -96,6 +96,8 @@ class VerifyUserData extends Job { $jobList->remove($this, $this->argument); if ($this->retainJob) { $this->reAddJob($jobList, $this->argument); + } else { + $this->resetVerificationState(); } } @@ -270,4 +272,17 @@ class VerifyUserData extends Job { return ((time() - $lastRun) > $this->interval); } + + /** + * reset verification state after max tries are reached + */ + protected function resetVerificationState() { + $user = $this->userManager->get($this->argument['uid']); + if ($user !== null) { + $accountData = $this->accountManager->getUser($user); + $accountData[$this->argument['type']]['verified'] = AccountManager::NOT_VERIFIED; + $this->accountManager->updateUser($user, $accountData); + } + } + } |