diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-03-23 16:06:57 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-04-28 23:41:36 -0300 |
commit | 6f41a3edc0bb7a297a28f3e5fa81fb68e3d71a1f (patch) | |
tree | 6934f8b244580a3daf8362d1bd76613d944bbedb /settings/Controller | |
parent | c9ccdca1ec2f586b8884b41a5319e4a908888df7 (diff) | |
download | nextcloud-server-6f41a3edc0bb7a297a28f3e5fa81fb68e3d71a1f.tar.gz nextcloud-server-6f41a3edc0bb7a297a28f3e5fa81fb68e3d71a1f.zip |
store verification status in accounts table and update lookup server
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'settings/Controller')
-rw-r--r-- | settings/Controller/UsersController.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php index c9194d85308..e80c4956bcb 100644 --- a/settings/Controller/UsersController.php +++ b/settings/Controller/UsersController.php @@ -516,6 +516,12 @@ class UsersController extends Controller { public function getVerificationCode($account) { $user = $this->userSession->getUser(); + + if ($user === null) { + return new DataResponse([], Http::STATUS_BAD_REQUEST); + } + + $accountData = $this->accountManager->getUser($user); $cloudId = $user->getCloudId(); $message = "Use my Federated Cloud ID to share with me: " . $cloudId; $privateKey = $this->keyManager->getKey($user)->getPrivate(); @@ -527,17 +533,20 @@ class UsersController extends Controller { switch ($account) { case 'verify-twitter': + $accountData[AccountManager::PROPERTY_TWITTER]['verified'] = AccountManager::VERIFICATION_IN_PROGRESS; $msg = $this->l10n->t('In order to verify your Twitter account post following tweet on Twitter:'); $code = $codeMd5; break; case 'verify-website': + $accountData[AccountManager::PROPERTY_WEBSITE]['verified'] = AccountManager::VERIFICATION_IN_PROGRESS; $msg = $this->l10n->t('In order to verify your Website store following content in your webroot at \'CloudIdVerificationCode.txt\':'); break; default: return new DataResponse([], Http::STATUS_BAD_REQUEST); - break; } + $this->accountManager->updateUser($user, $accountData); + return new DataResponse(['msg' => $msg, 'code' => $code]); } |