mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
show warning on personal settings page
Signed-off-by: Vitor Mattos <vitor@php.rio>
This commit is contained in:
parent
e55ceb2bb1
commit
6f7ca3432c
2 changed files with 23 additions and 1 deletions
|
|
@ -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 = [
|
||||
|
|
@ -190,6 +197,14 @@ class PersonalInfo implements ISettings {
|
|||
return new TemplateResponse('settings', 'settings/personal/personal.info', $parameters, '');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -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') ?>">
|
||||
|
|
|
|||
Loading…
Reference in a new issue