summaryrefslogtreecommitdiffstats
path: root/lib/private/User/Manager.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/User/Manager.php')
-rw-r--r--lib/private/User/Manager.php17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php
index be5151313c4..dc31eece414 100644
--- a/lib/private/User/Manager.php
+++ b/lib/private/User/Manager.php
@@ -44,8 +44,7 @@ use OCP\IGroup;
use OCP\IUser;
use OCP\IUserBackend;
use OCP\IUserManager;
-use OCP\Notification\IManager;
-use OCP\Support\Subscription\IRegistry;
+use OCP\Support\Subscription\IAssertion;
use OCP\User\Backend\IGetRealUIDBackend;
use OCP\User\Backend\ISearchKnownUsersBackend;
use OCP\User\Backend\ICheckPasswordBackend;
@@ -386,19 +385,15 @@ class Manager extends PublicEmitter implements IUserManager {
/**
* @param string $uid
* @param string $password
- * @throws \InvalidArgumentException
* @return false|IUser the created user or false
+ * @throws \InvalidArgumentException
+ * @throws HintException
*/
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
- /** @var IRegistry $registry */
- $registry = \OC::$server->get(IRegistry::class);
- /** @var IManager $notificationManager */
- $notificationManager = \OC::$server->get(IManager::class);
- if ($registry->delegateIsHardUserLimitReached($notificationManager)) {
- $l = \OC::$server->getL10N('lib');
- throw new HintException($l->t('The user limit has been reached and the user was not created.'));
- }
+ /** @var IAssertion $assertion */
+ $assertion = \OC::$server->get(IAssertion::class);
+ $assertion->createUserIsLegit();
$localBackends = [];
foreach ($this->backends as $backend) {