Skip to content

Commit 58b5ce9

Browse files
authored
Merge pull request #35130 from nextcloud/backport/35070/stable25
[stable25] [LDAP] always create instance of own user manager
2 parents 00ffe6f + 80ba0f2 commit 58b5ce9

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

apps/user_ldap/lib/AppInfo/Application.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@
3131
use OCA\User_LDAP\Controller\RenewPasswordController;
3232
use OCA\User_LDAP\Events\GroupBackendRegistered;
3333
use OCA\User_LDAP\Events\UserBackendRegistered;
34+
use OCA\User_LDAP\FilesystemHelper;
3435
use OCA\User_LDAP\Group_Proxy;
3536
use OCA\User_LDAP\GroupPluginManager;
3637
use OCA\User_LDAP\Handler\ExtStorageConfigHandler;
3738
use OCA\User_LDAP\Helper;
3839
use OCA\User_LDAP\ILDAPWrapper;
3940
use OCA\User_LDAP\LDAP;
4041
use OCA\User_LDAP\Notification\Notifier;
42+
use OCA\User_LDAP\User\Manager;
4143
use OCA\User_LDAP\User_Proxy;
4244
use OCA\User_LDAP\UserPluginManager;
4345
use OCP\AppFramework\App;
@@ -46,10 +48,17 @@
4648
use OCP\AppFramework\Bootstrap\IRegistrationContext;
4749
use OCP\AppFramework\IAppContainer;
4850
use OCP\EventDispatcher\IEventDispatcher;
51+
use OCP\IAvatarManager;
52+
use OCP\IConfig;
4953
use OCP\IGroupManager;
5054
use OCP\IL10N;
55+
use OCP\Image;
5156
use OCP\IServerContainer;
57+
use OCP\IUserManager;
5258
use OCP\Notification\IManager as INotificationManager;
59+
use OCP\Share\IManager as IShareManager;
60+
use Psr\Container\ContainerInterface;
61+
use Psr\Log\LoggerInterface;
5362
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
5463

5564
class Application extends App implements IBootstrap {
@@ -87,6 +96,24 @@ public function __construct() {
8796

8897
public function register(IRegistrationContext $context): void {
8998
$context->registerNotifierService(Notifier::class);
99+
100+
$context->registerService(
101+
Manager::class,
102+
function (ContainerInterface $c) {
103+
return new Manager(
104+
$c->get(IConfig::class),
105+
$c->get(FilesystemHelper::class),
106+
$c->get(LoggerInterface::class),
107+
$c->get(IAvatarManager::class),
108+
$c->get(Image::class),
109+
$c->get(IUserManager::class),
110+
$c->get(INotificationManager::class),
111+
$c->get(IShareManager::class),
112+
);
113+
},
114+
// the instance is specific to a lazy bound Access instance, thus cannot be shared.
115+
false
116+
);
90117
}
91118

92119
public function boot(IBootContext $context): void {

0 commit comments

Comments
 (0)