aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/AppInfo/Application.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2020-10-22 11:25:33 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2020-10-23 12:25:31 +0200
commit86e5e7d9274241b0373bfa494896534b251e1978 (patch)
tree93bf7a5cee299889b8143304537265b1a5553b33 /apps/user_ldap/lib/AppInfo/Application.php
parent872f03209cccd376c0be908581164f245e558070 (diff)
downloadnextcloud-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.php27
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);