diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-12-02 10:07:34 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2020-12-02 17:24:44 +0000 |
commit | a8780debd3d347132065007f558f37c41a898e05 (patch) | |
tree | 887e39f5ffe164f3a59b4645c2886b2d5b2a985a /core | |
parent | d2fd49c461ed6de7ab6f345ad3afa7c24ca25d90 (diff) | |
download | nextcloud-server-a8780debd3d347132065007f558f37c41a898e05.tar.gz nextcloud-server-a8780debd3d347132065007f558f37c41a898e05.zip |
Add notification for user limit
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'core')
-rw-r--r-- | core/Application.php | 4 | ||||
-rw-r--r-- | core/Notification/CoreNotifier.php (renamed from core/Notification/RemoveLinkSharesNotifier.php) | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/core/Application.php b/core/Application.php index f105dfd25d1..4a4d2c6ef35 100644 --- a/core/Application.php +++ b/core/Application.php @@ -39,7 +39,7 @@ use OC\Authentication\Listeners\RemoteWipeNotificationsListener; use OC\Authentication\Listeners\UserDeletedStoreCleanupListener; use OC\Authentication\Listeners\UserDeletedTokenCleanupListener; use OC\Authentication\Notifications\Notifier as AuthenticationNotifier; -use OC\Core\Notification\RemoveLinkSharesNotifier; +use OC\Core\Notification\CoreNotifier; use OC\DB\MissingColumnInformation; use OC\DB\MissingIndexInformation; use OC\DB\MissingPrimaryKeyInformation; @@ -71,7 +71,7 @@ class Application extends App { $eventDispatcher = $server->query(IEventDispatcher::class); $notificationManager = $server->getNotificationManager(); - $notificationManager->registerNotifierService(RemoveLinkSharesNotifier::class); + $notificationManager->registerNotifierService(CoreNotifier::class); $notificationManager->registerNotifierService(AuthenticationNotifier::class); $oldEventDispatcher = $server->getEventDispatcher(); diff --git a/core/Notification/RemoveLinkSharesNotifier.php b/core/Notification/CoreNotifier.php index 52a71fced25..dd362dac8c1 100644 --- a/core/Notification/RemoveLinkSharesNotifier.php +++ b/core/Notification/CoreNotifier.php @@ -7,6 +7,7 @@ declare(strict_types=1); * * @author Christoph Wurst <christoph@winzerhof-wurst.at> * @author Joas Schilling <coding@schilljs.com> + * @author Morris Jobke <hey@morrisjobke.de> * @author Roeland Jago Douma <roeland@famdouma.nl> * * @license GNU AGPL version 3 or any later version @@ -32,7 +33,7 @@ use OCP\L10N\IFactory; use OCP\Notification\INotification; use OCP\Notification\INotifier; -class RemoveLinkSharesNotifier implements INotifier { +class CoreNotifier implements INotifier { /** @var IFactory */ private $l10nFactory; @@ -73,6 +74,13 @@ class RemoveLinkSharesNotifier implements INotifier { return $notification; } + if ($notification->getSubject() === 'user_limit_reached') { + $notification->setParsedSubject($l->t('The user limit of this instance is reached.')); + $notification->setParsedMessage($l->t('Add a subscription key to increase the user limit of this instance. For more information have a look at the Enterprise subscription page.')); + $notification->setLink('https://nextcloud.com/enterprise/order/'); + return $notification; + } + throw new \InvalidArgumentException('Invalid subject'); } } |