|
46 | 46 | use OCP\AppFramework\Bootstrap\IRegistrationContext; |
47 | 47 | use OCP\AppFramework\IAppContainer; |
48 | 48 | use OCP\EventDispatcher\IEventDispatcher; |
49 | | -use OCP\IConfig; |
50 | 49 | use OCP\IGroupManager; |
51 | 50 | use OCP\IL10N; |
52 | 51 | use OCP\IServerContainer; |
53 | | -use OCP\IUserSession; |
54 | 52 | use OCP\Notification\IManager as INotificationManager; |
55 | 53 | use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
56 | 54 |
|
@@ -86,28 +84,23 @@ public function register(IRegistrationContext $context): void { |
86 | 84 | } |
87 | 85 |
|
88 | 86 | public function boot(IBootContext $context): void { |
89 | | - $context->injectFn(function (IConfig $config, |
90 | | - INotificationManager $notificationManager, |
91 | | - IUserSession $userSession, |
92 | | - IAppContainer $appContainer, |
93 | | - EventDispatcherInterface $legacyDispatcher, |
94 | | - IEventDispatcher $dispatcher, |
95 | | - IGroupManager $groupManager) { |
96 | | - $helper = new Helper($config); |
| 87 | + $context->injectFn(function ( |
| 88 | + INotificationManager $notificationManager, |
| 89 | + IAppContainer $appContainer, |
| 90 | + EventDispatcherInterface $legacyDispatcher, |
| 91 | + IEventDispatcher $dispatcher, |
| 92 | + IGroupManager $groupManager, |
| 93 | + User_Proxy $userBackend, |
| 94 | + Group_Proxy $groupBackend, |
| 95 | + Helper $helper |
| 96 | + ) { |
97 | 97 | $configPrefixes = $helper->getServerConfigurationPrefixes(true); |
98 | 98 | if (count($configPrefixes) > 0) { |
99 | | - $ldapWrapper = new LDAP(); |
100 | | - |
101 | 99 | $notificationManager->registerNotifierService(Notifier::class); |
102 | 100 |
|
103 | 101 | $userPluginManager = $appContainer->get(UserPluginManager::class); |
104 | 102 | $groupPluginManager = $appContainer->get(GroupPluginManager::class); |
105 | 103 |
|
106 | | - $userBackend = new User_Proxy( |
107 | | - $configPrefixes, $ldapWrapper, $config, $notificationManager, $userSession, $userPluginManager |
108 | | - ); |
109 | | - $groupBackend = new Group_Proxy($configPrefixes, $ldapWrapper, $groupPluginManager); |
110 | | - |
111 | 104 | \OC_User::useBackend($userBackend); |
112 | 105 | $groupManager->addBackend($groupBackend); |
113 | 106 |
|
|
0 commit comments