summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-12-02 10:07:34 +0100
committerMorris Jobke <hey@morrisjobke.de>2020-12-02 15:20:03 +0100
commitc0a05c0412e11fd80adc2059b28c8963ba4252dc (patch)
treea2d9542e302c7bae3e6c148de96e101cb7e69749 /core
parentd87705a8941511a4e3bf8f6c97d6e0f36a42799e (diff)
downloadnextcloud-server-c0a05c0412e11fd80adc2059b28c8963ba4252dc.tar.gz
nextcloud-server-c0a05c0412e11fd80adc2059b28c8963ba4252dc.zip
Add notification for user limit
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'core')
-rw-r--r--core/Application.php4
-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 d9d6b92a2ad..bda271c41fe 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');
}
}