aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2021-08-26 22:09:52 +0200
committerGitHub <noreply@github.com>2021-08-26 22:09:52 +0200
commit78a5768888e5dbeb8aefeea9f5bf5ed032977f5d (patch)
tree9b88f8f7c57b827efa785677eb5da39baaaecd12 /apps/settings/lib
parentfd93aa816231954ca628daa85bd091fd6ff3a570 (diff)
parentc67a6e5bcb58cadd1e922df65b1e0035c0fbafaf (diff)
downloadnextcloud-server-78a5768888e5dbeb8aefeea9f5bf5ed032977f5d.tar.gz
nextcloud-server-78a5768888e5dbeb8aefeea9f5bf5ed032977f5d.zip
Merge pull request #28028 from nextcloud/feat/27869/full-name
Diffstat (limited to 'apps/settings/lib')
-rw-r--r--apps/settings/lib/Settings/Personal/PersonalInfo.php30
1 files changed, 28 insertions, 2 deletions
diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php
index 387843c5522..d69d4b33b4c 100644
--- a/apps/settings/lib/Settings/Personal/PersonalInfo.php
+++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php
@@ -145,14 +145,17 @@ class PersonalInfo implements ISettings {
'groups' => $this->getGroups($user),
] + $messageParameters + $languageParameters + $localeParameters;
- $emails = $this->getEmails($account);
+ $personalInfoParameters = [
+ 'displayNames' => $this->getDisplayNames($account),
+ 'emails' => $this->getEmails($account),
+ ];
$accountParameters = [
'displayNameChangeSupported' => $user->canChangeDisplayName(),
'lookupServerUploadEnabled' => $lookupServerUploadEnabled,
];
- $this->initialStateService->provideInitialState('emails', $emails);
+ $this->initialStateService->provideInitialState('personalInfoParameters', $personalInfoParameters);
$this->initialStateService->provideInitialState('accountParameters', $accountParameters);
return new TemplateResponse('settings', 'settings/personal/personal.info', $parameters, '');
@@ -197,6 +200,29 @@ class PersonalInfo implements ISettings {
}
/**
+ * returns the primary display name in an
+ * associative array
+ *
+ * NOTE may be extended to provide additional display names (i.e. aliases) in the future
+ *
+ * @param IAccount $account
+ * @return array
+ */
+ private function getDisplayNames(IAccount $account): array {
+ $primaryDisplayName = [
+ 'value' => $account->getProperty(IAccountManager::PROPERTY_DISPLAYNAME)->getValue(),
+ 'scope' => $account->getProperty(IAccountManager::PROPERTY_DISPLAYNAME)->getScope(),
+ 'verified' => $account->getProperty(IAccountManager::PROPERTY_DISPLAYNAME)->getVerified(),
+ ];
+
+ $displayNames = [
+ 'primaryDisplayName' => $primaryDisplayName,
+ ];
+
+ return $displayNames;
+ }
+
+ /**
* returns the primary email and additional emails in an
* associative array
*