Allow subscription to indicate that a userlimit is reached#23278
Merged
ChristophWurst merged 2 commits intomasterfrom Dec 2, 2020
Merged
Allow subscription to indicate that a userlimit is reached#23278ChristophWurst merged 2 commits intomasterfrom
ChristophWurst merged 2 commits intomasterfrom
Conversation
24d9915 to
21da73a
Compare
MorrisJobke
commented
Dec 2, 2020
Member
Author
|
/backport to stable20 |
0f4bace to
e0e032f
Compare
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
e0e032f to
c0a05c0
Compare
Member
Author
|
Ready for review 🚀 |
rullzer
approved these changes
Dec 2, 2020
Member
rullzer
left a comment
There was a problem hiding this comment.
Looks good! Didn't test in depth but a quick smoke test showed it OK. And the test seems sane!
blizzz
reviewed
Dec 2, 2020
Comment on lines
301
to
+307
| public function createUser($uid, $password) { | ||
| // DI injection is not used here as IRegistry needs the user manager itself for user count and thus it would create a cyclic dependency | ||
| if (\OC::$server->get(IRegistry::class)->delegateIsHardUserLimitReached()) { | ||
| $l = \OC::$server->getL10N('lib'); | ||
| throw new HintException($l->t('The user limit has been reached and the user was not created.')); | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
heads up, this will not catch users provisioned by other backends
Member
There was a problem hiding this comment.
Yes we know
will come in follup PRs
Member
jospoortvliet
left a comment
There was a problem hiding this comment.
Looks good, just these changes would be nice 👍
|
|
||
| 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.')); |
Member
There was a problem hiding this comment.
Suggested change
| $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->setParsedMessage($l->t('Enter your subscription key to increase the user limit. For more information about Nextcloud Enterprise see our website.')); |
| 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/'); |
Member
There was a problem hiding this comment.
Suggested change
| $notification->setLink('https://nextcloud.com/enterprise/order/'); | |
| $notification->setLink('https://nextcloud.com/enterprise/'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.