summaryrefslogtreecommitdiffstats
path: root/apps/settings/lib
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2022-03-11 02:11:28 +0000
committerChristopher Ng <chrng8@gmail.com>2022-03-18 02:55:12 +0000
commit1fc0b4320c8921ad59bf4d41a88bf9936e1f653d (patch)
tree8d630f864f4a2760f72307e68553cc2ee0c516d4 /apps/settings/lib
parentd364edcf6a18fa237dc53f6b95614851ed5fdc9a (diff)
downloadnextcloud-server-1fc0b4320c8921ad59bf4d41a88bf9936e1f653d.tar.gz
nextcloud-server-1fc0b4320c8921ad59bf4d41a88bf9936e1f653d.zip
Add global profile toggle config
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'apps/settings/lib')
-rw-r--r--apps/settings/lib/Settings/Personal/PersonalInfo.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php
index def7e19f006..4bac8e67fb7 100644
--- a/apps/settings/lib/Settings/Personal/PersonalInfo.php
+++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php
@@ -56,7 +56,6 @@ use OCP\Notification\IManager;
use OCP\Settings\ISettings;
class PersonalInfo implements ISettings {
- use \OC\Profile\TProfileHelper;
/** @var IConfig */
private $config;
@@ -166,7 +165,8 @@ class PersonalInfo implements ISettings {
'twitterScope' => $account->getProperty(IAccountManager::PROPERTY_TWITTER)->getScope(),
'twitterVerification' => $account->getProperty(IAccountManager::PROPERTY_TWITTER)->getVerified(),
'groups' => $this->getGroups($user),
- 'isFairUseOfFreePushService' => $this->isFairUseOfFreePushService()
+ 'isFairUseOfFreePushService' => $this->isFairUseOfFreePushService(),
+ 'profileEnabledGlobally' => $this->profileManager->isProfileEnabled(),
] + $messageParameters + $languageParameters + $localeParameters;
$personalInfoParameters = [
@@ -174,7 +174,8 @@ class PersonalInfo implements ISettings {
'displayNameMap' => $this->getDisplayNameMap($account),
'emailMap' => $this->getEmailMap($account),
'languageMap' => $this->getLanguageMap($user),
- 'profileEnabled' => $this->isProfileEnabled($account),
+ 'profileEnabledGlobally' => $this->profileManager->isProfileEnabled(),
+ 'profileEnabled' => $this->profileManager->isProfileEnabled($user),
'organisationMap' => $this->getOrganisationMap($account),
'roleMap' => $this->getRoleMap($account),
'headlineMap' => $this->getHeadlineMap($account),
@@ -190,6 +191,7 @@ class PersonalInfo implements ISettings {
'profileConfig' => $this->profileManager->getProfileConfigWithMetadata($user, $user),
];
+ $this->initialStateService->provideInitialState('profileEnabledGlobally', $this->profileManager->isProfileEnabled());
$this->initialStateService->provideInitialState('personalInfoParameters', $personalInfoParameters);
$this->initialStateService->provideInitialState('accountParameters', $accountParameters);
$this->initialStateService->provideInitialState('profileParameters', $profileParameters);