summaryrefslogtreecommitdiffstats
path: root/settings/BackgroundJobs
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-05-04 14:53:24 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2017-05-04 14:53:24 +0200
commit327cddc157169bd12b58239fed0b286bf0cac16c (patch)
tree53f46e92c9d63edd9b4aa8de15fa662d9a342950 /settings/BackgroundJobs
parent4965f02bf4c4c5454e9ab97d4336e4bc6fa7151c (diff)
downloadnextcloud-server-327cddc157169bd12b58239fed0b286bf0cac16c.tar.gz
nextcloud-server-327cddc157169bd12b58239fed0b286bf0cac16c.zip
reset verification state if max tries are reached
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'settings/BackgroundJobs')
-rw-r--r--settings/BackgroundJobs/VerifyUserData.php15
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);
+ }
+ }
+
}