diff options
author | Vitor Mattos <vitor@php.rio> | 2021-10-21 13:24:53 -0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-10-23 00:54:51 +0200 |
commit | 6f7ca3432c0e6d1e1925179e952f79c6273295f3 (patch) | |
tree | 94b3f805934b6a1bceca94ea36ef5d9cbcd4e11b /apps/settings | |
parent | e55ceb2bb1c22105cd46533f8b41157c52e5da2d (diff) | |
download | nextcloud-server-6f7ca3432c0e6d1e1925179e952f79c6273295f3.tar.gz nextcloud-server-6f7ca3432c0e6d1e1925179e952f79c6273295f3.zip |
show warning on personal settings page
Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'apps/settings')
-rw-r--r-- | apps/settings/lib/Settings/Personal/PersonalInfo.php | 17 | ||||
-rw-r--r-- | apps/settings/templates/settings/personal/personal.info.php | 7 |
2 files changed, 23 insertions, 1 deletions
diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php index 928c18998df..72c443ed1b6 100644 --- a/apps/settings/lib/Settings/Personal/PersonalInfo.php +++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php @@ -52,6 +52,7 @@ use OCP\IUser; use OCP\IUserManager; use OCP\L10N\IFactory; use OC\Profile\ProfileManager; +use OCP\Notification\IManager; use OCP\Settings\ISettings; class PersonalInfo implements ISettings { @@ -84,6 +85,9 @@ class PersonalInfo implements ISettings { /** @var IInitialState */ private $initialStateService; + /** @var IManager */ + private $manager; + public function __construct( IConfig $config, IUserManager $userManager, @@ -93,7 +97,8 @@ class PersonalInfo implements ISettings { IAppManager $appManager, IFactory $l10nFactory, IL10N $l, - IInitialState $initialStateService + IInitialState $initialStateService, + IManager $manager ) { $this->config = $config; $this->userManager = $userManager; @@ -104,6 +109,7 @@ class PersonalInfo implements ISettings { $this->l10nFactory = $l10nFactory; $this->l = $l; $this->initialStateService = $initialStateService; + $this->manager = $manager; } public function getForm(): TemplateResponse { @@ -160,6 +166,7 @@ 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() ] + $messageParameters + $languageParameters + $localeParameters; $personalInfoParameters = [ @@ -191,6 +198,14 @@ class PersonalInfo implements ISettings { } /** + * Check if is fair use of free push service + * @return boolean + */ + private function isFairUseOfFreePushService(): bool { + return $this->manager->isFairUseOfFreePushService(); + } + + /** * returns the primary biography in an * associative array */ diff --git a/apps/settings/templates/settings/personal/personal.info.php b/apps/settings/templates/settings/personal/personal.info.php index d258f616229..4cd0e4e34d6 100644 --- a/apps/settings/templates/settings/personal/personal.info.php +++ b/apps/settings/templates/settings/personal/personal.info.php @@ -35,6 +35,13 @@ script('settings', [ 'vue-settings-personal-info', ]); ?> +<?php if (!$_['isFairUseOfFreePushService']) : ?> + <div class="section"> + <div class="warning"> + <?php p($l->t('This community release of Nextcloud is unsupported and instant notifications are unavailable.')); ?> + </div> + </div> +<?php endif; ?> <div id="personal-settings" data-federation-enabled="<?php p($_['federationEnabled'] ? 'true' : 'false') ?>" data-lookup-server-upload-enabled="<?php p($_['lookupServerUploadEnabled'] ? 'true' : 'false') ?>"> |