summaryrefslogtreecommitdiffstats
path: root/settings/Controller
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-04-27 12:27:36 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-04-28 23:41:38 -0300
commit806ca43b527809e6b37573b6995535638102039c (patch)
tree6fa63aa1c0db8207295645d06a37cd31cce6fa32 /settings/Controller
parent9480b29413daba34432885642b575065ed5f5d6d (diff)
downloadnextcloud-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.php28
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]);
}