diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-04-27 12:27:36 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-04-28 23:41:38 -0300 |
commit | 806ca43b527809e6b37573b6995535638102039c (patch) | |
tree | 6fa63aa1c0db8207295645d06a37cd31cce6fa32 /settings/Controller | |
parent | 9480b29413daba34432885642b575065ed5f5d6d (diff) | |
download | nextcloud-server-806ca43b527809e6b37573b6995535638102039c.tar.gz nextcloud-server-806ca43b527809e6b37573b6995535638102039c.zip |
allow to display the verification code also while verification is already running
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'settings/Controller')
-rw-r--r-- | settings/Controller/UsersController.php | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php index 38c555e6a50..f481629e98b 100644 --- a/settings/Controller/UsersController.php +++ b/settings/Controller/UsersController.php @@ -518,9 +518,10 @@ class UsersController extends Controller { * @PasswordConfirmationRequired * * @param string $account + * @param bool $onlyVerificationCode only return verification code without updating the data * @return DataResponse */ - public function getVerificationCode($account) { + public function getVerificationCode($account, $onlyVerificationCode) { $user = $this->userSession->getUser(); @@ -554,19 +555,20 @@ class UsersController extends Controller { return new DataResponse([], Http::STATUS_BAD_REQUEST); } - $this->accountManager->updateUser($user, $accountData); + if ($onlyVerificationCode === false) { + $this->accountManager->updateUser($user, $accountData); - - $this->jobList->add('OC\Settings\BackgroundJobs\VerifyUserData', - [ - 'verificationCode' => $code, - 'data' => $data, - 'type' => $type, - 'uid' => $user->getUID(), - 'try' => 0, - 'lastRun' => $this->getCurrentTime() - ] - ); + $this->jobList->add('OC\Settings\BackgroundJobs\VerifyUserData', + [ + 'verificationCode' => $code, + 'data' => $data, + 'type' => $type, + 'uid' => $user->getUID(), + 'try' => 0, + 'lastRun' => $this->getCurrentTime() + ] + ); + } return new DataResponse(['msg' => $msg, 'code' => $code]); } |