Skip to content

Commit

Permalink
fixup! Override user language if enforced
Browse files Browse the repository at this point in the history
Signed-off-by: GretaD <gretadoci@gmail.com>
  • Loading branch information
GretaD committed May 4, 2020
1 parent 6727d07 commit 9b68aa0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions apps/provisioning_api/lib/Controller/AUserData.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ protected function getUserData(string $userId): array {
throw new OCSNotFoundException($e->getMessage(), $e);
}

// Override language if enforced
$forceLanguage = $this->config->getSystemValue('force_language', false);

// Find the data
$data['id'] = $targetUserObject->getUID();
$data['lastLogin'] = $targetUserObject->getLastLogin() * 1000;
Expand All @@ -149,7 +146,7 @@ protected function getUserData(string $userId): array {
$data[AccountManager::PROPERTY_WEBSITE] = $userAccount[AccountManager::PROPERTY_WEBSITE]['value'];
$data[AccountManager::PROPERTY_TWITTER] = $userAccount[AccountManager::PROPERTY_TWITTER]['value'];
$data['groups'] = $gids;
$data['language'] = $forceLanguage ?? $this->config->getUserValue($targetUserObject->getUID(), 'core', 'lang');
$data['language'] = $this->config->getSystemValue('force_language', $this->config->getUserValue($targetUserObject->getUID(), 'core', 'lang'));
$data['locale'] = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'locale');

$backend = $targetUserObject->getBackend();
Expand Down
1 change: 1 addition & 0 deletions apps/settings/lib/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ public function usersList() {
$serverData['userCount'] = $userCount;
$serverData['languages'] = $languages;
$serverData['defaultLanguage'] = $this->config->getSystemValue('default_language', 'en');
$serverData['forceLanguage'] = $this->config->getSystemValue('force_language', false);
// Settings
$serverData['defaultQuota'] = $defaultQuota;
$serverData['canChangePassword'] = $canChangePassword;
Expand Down

0 comments on commit 9b68aa0

Please sign in to comment.