diff options
author | Christoph Wurst <christoph@owncloud.com> | 2016-04-20 17:03:50 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-11-21 11:29:24 +0100 |
commit | 20739c93a680d7085d0e71c0e4f9c0bb24018fb9 (patch) | |
tree | ca8659d0fe9de7388a301fe14cee8f2cf2e88a96 /settings/Controller | |
parent | c42d977185648fcc34c8e0135973ebc1c4776512 (diff) | |
download | nextcloud-server-20739c93a680d7085d0e71c0e4f9c0bb24018fb9.tar.gz nextcloud-server-20739c93a680d7085d0e71c0e4f9c0bb24018fb9.zip |
Persist settings on the server
Persist personal settings federated sharing scopes
Show new settings fields in read-only mode too
Insert values on page load
Return updated values; show inline success feedback
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'settings/Controller')
-rw-r--r-- | settings/Controller/UsersController.php | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php index 89831a66aba..f06eabf6f96 100644 --- a/settings/Controller/UsersController.php +++ b/settings/Controller/UsersController.php @@ -493,17 +493,62 @@ class UsersController extends Controller { } /** - * Set the mail address of a user + * @todo add method description * * @NoAdminRequired * @NoSubadminRequired * @PasswordConfirmationRequired * + * @param string $userId + * @param string $displayname + * @param string $displaynameScope + * @param string $phone + * @param string $phoneScope + * @param string $email + * @param string $emailScope + * @param string $website + * @param string $websiteScope + * @param string $address + * @param string $addressScope + * @return DataResponse + */ + public function saveUserSettings($userId, + $displayname, $displaynameScope, + $phone, $phoneScope, + $email, $emailScope, + $website, $websiteScope, + $address, $addressScope) { + // TODO: implement + return new DataResponse( + array( + 'status' => 'success', + 'data' => array( + 'userId' => $userId, + 'displayname' => $displayname, + 'displaynameScope' => 'public', // force value for test purposes + 'email' => $email, + 'emailScope' => $emailScope, + 'website' => $website, + 'websiteScope' => $websiteScope, + 'address' => $address, + 'addressScope' => $addressScope, + 'message' => (string)$this->l10n->t('Settings saved') + ) + ), + Http::STATUS_OK + ); + } + + /** + * Set the mail address of a user + * + * @todo Merge into saveUserSettings + * * @param string $id * @param string $mailAddress * @return DataResponse */ - public function setMailAddress($id, $mailAddress) { + private function setMailAddress($id, $mailAddress) { $userId = $this->userSession->getUser()->getUID(); $user = $this->userManager->get($id); @@ -619,12 +664,13 @@ class UsersController extends Controller { * @NoAdminRequired * @NoSubadminRequired * @PasswordConfirmationRequired + * @todo merge into saveUserSettings * * @param string $username * @param string $displayName * @return DataResponse */ - public function setDisplayName($username, $displayName) { + private function setDisplayName($username, $displayName) { $currentUser = $this->userSession->getUser(); if ($username === null) { |