diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2020-10-22 11:25:33 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2020-10-23 12:25:31 +0200 |
commit | 86e5e7d9274241b0373bfa494896534b251e1978 (patch) | |
tree | 93bf7a5cee299889b8143304537265b1a5553b33 /apps/user_ldap/lib/AppInfo/Application.php | |
parent | 872f03209cccd376c0be908581164f245e558070 (diff) | |
download | nextcloud-server-86e5e7d9274241b0373bfa494896534b251e1978.tar.gz nextcloud-server-86e5e7d9274241b0373bfa494896534b251e1978.zip |
LDAP simplify User_Proxy and Group_Proxy signatures
- make User_Proxy and Group_Proxy easy to instantiate
- simplify dependent code
- move commands to info.xml
- make UpdateGroups job class non-static
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/lib/AppInfo/Application.php')
-rw-r--r-- | apps/user_ldap/lib/AppInfo/Application.php | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/apps/user_ldap/lib/AppInfo/Application.php b/apps/user_ldap/lib/AppInfo/Application.php index 93f7ccb379d..8dad63fbaf8 100644 --- a/apps/user_ldap/lib/AppInfo/Application.php +++ b/apps/user_ldap/lib/AppInfo/Application.php @@ -46,11 +46,9 @@ use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; use OCP\AppFramework\IAppContainer; use OCP\EventDispatcher\IEventDispatcher; -use OCP\IConfig; use OCP\IGroupManager; use OCP\IL10N; use OCP\IServerContainer; -use OCP\IUserSession; use OCP\Notification\IManager as INotificationManager; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -86,28 +84,23 @@ class Application extends App implements IBootstrap { } public function boot(IBootContext $context): void { - $context->injectFn(function (IConfig $config, - INotificationManager $notificationManager, - IUserSession $userSession, - IAppContainer $appContainer, - EventDispatcherInterface $legacyDispatcher, - IEventDispatcher $dispatcher, - IGroupManager $groupManager) { - $helper = new Helper($config); + $context->injectFn(function ( + INotificationManager $notificationManager, + IAppContainer $appContainer, + EventDispatcherInterface $legacyDispatcher, + IEventDispatcher $dispatcher, + IGroupManager $groupManager, + User_Proxy $userBackend, + Group_Proxy $groupBackend, + Helper $helper + ) { $configPrefixes = $helper->getServerConfigurationPrefixes(true); if (count($configPrefixes) > 0) { - $ldapWrapper = new LDAP(); - $notificationManager->registerNotifierService(Notifier::class); $userPluginManager = $appContainer->get(UserPluginManager::class); $groupPluginManager = $appContainer->get(GroupPluginManager::class); - $userBackend = new User_Proxy( - $configPrefixes, $ldapWrapper, $config, $notificationManager, $userSession, $userPluginManager - ); - $groupBackend = new Group_Proxy($configPrefixes, $ldapWrapper, $groupPluginManager); - \OC_User::useBackend($userBackend); $groupManager->addBackend($groupBackend); |