diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-07-05 17:36:43 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2018-06-27 13:15:19 +0200 |
commit | d8921ccd85f3414c1f3e13b23b6da735bf9b69b8 (patch) | |
tree | 69bd3669e1e1dec46030200d2991c77f20392b1c /apps/provisioning_api/lib | |
parent | 221f558f6609cdfcb9e0bf9e89e398f5940254fe (diff) | |
download | nextcloud-server-d8921ccd85f3414c1f3e13b23b6da735bf9b69b8.tar.gz nextcloud-server-d8921ccd85f3414c1f3e13b23b6da735bf9b69b8.zip |
Allow user to choose locale
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'apps/provisioning_api/lib')
-rw-r--r-- | apps/provisioning_api/lib/Controller/UsersController.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index 2e46492b842..0430226e12c 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -13,6 +13,7 @@ declare(strict_types=1); * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Tom Needham <tom@owncloud.com> * @author John Molakvoæ <skjnldsv@protonmail.com> + * @author Thomas Citharel <tcit@tcit.fr> * * @license AGPL-3.0 * @@ -391,6 +392,19 @@ class UsersController extends AUserData { } } + // Find the data + $data['id'] = $targetUserObject->getUID(); + $data['quota'] = $this->fillStorageInfo($targetUserObject->getUID()); + $data[AccountManager::PROPERTY_EMAIL] = $targetUserObject->getEMailAddress(); + $data[AccountManager::PROPERTY_DISPLAYNAME] = $targetUserObject->getDisplayName(); + $data[AccountManager::PROPERTY_PHONE] = $userAccount[AccountManager::PROPERTY_PHONE]['value']; + $data[AccountManager::PROPERTY_ADDRESS] = $userAccount[AccountManager::PROPERTY_ADDRESS]['value']; + $data[AccountManager::PROPERTY_WEBSITE] = $userAccount[AccountManager::PROPERTY_WEBSITE]['value']; + $data[AccountManager::PROPERTY_TWITTER] = $userAccount[AccountManager::PROPERTY_TWITTER]['value']; + $data['groups'] = $gids; + $data['language'] = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'lang'); + $data['locale'] = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'locale'); + return new DataResponse($permittedFields); } @@ -428,6 +442,7 @@ class UsersController extends AUserData { if ($this->config->getSystemValue('force_language', false) === false || $this->groupManager->isAdmin($currentLoggedInUser->getUID())) { $permittedFields[] = 'language'; + $permittedFields[] = 'locale'; } if ($this->appManager->isEnabledForUser('federatedfilesharing')) { @@ -456,6 +471,7 @@ class UsersController extends AUserData { $permittedFields[] = AccountManager::PROPERTY_EMAIL; $permittedFields[] = 'password'; $permittedFields[] = 'language'; + $permittedFields[] = 'locale'; $permittedFields[] = AccountManager::PROPERTY_PHONE; $permittedFields[] = AccountManager::PROPERTY_ADDRESS; $permittedFields[] = AccountManager::PROPERTY_WEBSITE; @@ -505,6 +521,10 @@ class UsersController extends AUserData { } $this->config->setUserValue($targetUser->getUID(), 'core', 'lang', $value); break; + case 'locale': + // do some stuff + $this->config->setUserValue($targetUser->getUID(), 'core', 'locale', $value); + break; case AccountManager::PROPERTY_EMAIL: if (filter_var($value, FILTER_VALIDATE_EMAIL) || $value === '') { $targetUser->setEMailAddress($value); |