aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMichael Weimann <mail@michael-weimann.eu>2019-01-29 19:42:12 +0100
committerMichael Weimann <mail@michael-weimann.eu>2019-01-29 19:42:12 +0100
commit6c5282138979a7d56feeb5d38462761f1102f1d1 (patch)
tree625a7eb8fabadef393a09582e9530575d35b4d37 /lib
parentb8d25a1247c7b602976cf3bca2dfb7a2aac5bb81 (diff)
downloadnextcloud-server-6c5282138979a7d56feeb5d38462761f1102f1d1.tar.gz
nextcloud-server-6c5282138979a7d56feeb5d38462761f1102f1d1.zip
Make the where is your data section optional
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Settings/Personal/PersonalInfo.php31
1 files changed, 25 insertions, 6 deletions
diff --git a/lib/private/Settings/Personal/PersonalInfo.php b/lib/private/Settings/Personal/PersonalInfo.php
index 306e5271d8d..c018ea80ded 100644
--- a/lib/private/Settings/Personal/PersonalInfo.php
+++ b/lib/private/Settings/Personal/PersonalInfo.php
@@ -116,9 +116,6 @@ class PersonalInfo implements ISettings {
$localeParameters = $this->getLocales($user);
$messageParameters = $this->getMessageParameters($userData);
- $adminContactConfigId = $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER_ADMIN_CONTACT);
- $adminContact = $this->userManager->get($adminContactConfigId);
-
$parameters = [
'total_space' => $totalSpace,
'usage' => \OC_Helper::humanFileSize($storageInfo['used']),
@@ -144,16 +141,38 @@ class PersonalInfo implements ISettings {
'twitterScope' => $userData[AccountManager::PROPERTY_TWITTER]['scope'],
'twitterVerification' => $userData[AccountManager::PROPERTY_TWITTER]['verified'],
'groups' => $this->getGroups($user),
+ ] + $this->getWhereIsYourDataParams() + $messageParameters + $languageParameters + $localeParameters;
+
+ return new TemplateResponse('settings', 'settings/personal/personal.info', $parameters, '');
+ }
+
+ /**
+ * Returns the "where is your data" template params.
+ *
+ * @return array
+ */
+ private function getWhereIsYourDataParams() {
+
+ $adminContactConfigId = $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER_ADMIN_CONTACT);
+ $adminContact = $this->userManager->get($adminContactConfigId);
+
+ $params = [
'dataLocation' => $this->config->getSystemValue(ServerInfo::SETTING_LOCATION),
'provider' => $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER),
'providerLink' => $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER_WEBSITE),
'providerPrivacyLink' => $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER_PRIVACY_LINK),
'encryptionEnabled' => $this->encryptionManager->isEnabled(),
'adminName' => $adminContact !== null ? $adminContact->getDisplayName() : '',
- 'adminMail' => $adminContact !== null ? $adminContact->getEMailAddress() : '',
- ] + $messageParameters + $languageParameters + $localeParameters;
+ 'adminMail' => $adminContact !== null ? $adminContact->getEMailAddress() : ''
+ ];
+
+ $params['show_where_is_your_data_section'] = empty($params['dataLocation']) === false
+ || empty($params['provider']) === false
+ || $params['encryptionEnabled'] === true
+ || empty($params['adminName']) === false;
+
+ return $params;
- return new TemplateResponse('settings', 'settings/personal/personal.info', $parameters, '');
}
/**