From 4130a4cbd8e5bb4506ac30a19a91b088aa35dd24 Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Mon, 24 Oct 2022 16:09:06 +0200 Subject: Make sure to use AccessFactory to create Access instances and use DI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/user_ldap/ajax/wizard.php | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'apps/user_ldap/ajax/wizard.php') diff --git a/apps/user_ldap/ajax/wizard.php b/apps/user_ldap/ajax/wizard.php index 814477d5db0..8cae22daf19 100644 --- a/apps/user_ldap/ajax/wizard.php +++ b/apps/user_ldap/ajax/wizard.php @@ -38,7 +38,6 @@ if (!isset($_POST['action'])) { } $action = (string)$_POST['action']; - if (!isset($_POST['ldap_serverconfig_chooser'])) { \OC_JSON::error(['message' => $l->t('No configuration specified')]); } @@ -52,26 +51,8 @@ $con->setConfiguration($configuration->getConfiguration()); $con->ldapConfigurationActive = true; $con->setIgnoreValidation(true); -$userManager = new \OCA\User_LDAP\User\Manager( - \OC::$server->getConfig(), - new \OCA\User_LDAP\FilesystemHelper(), - \OC::$server->get(\Psr\Log\LoggerInterface::class), - \OC::$server->getAvatarManager(), - new \OCP\Image(), - \OC::$server->getUserManager(), - \OC::$server->getNotificationManager(), - \OC::$server->get(\OCP\Share\IManager::class) -); - -$access = new \OCA\User_LDAP\Access( - $con, - $ldapWrapper, - $userManager, - new \OCA\User_LDAP\Helper(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection()), - \OC::$server->getConfig(), - \OC::$server->getUserManager(), - \OC::$server->get(\Psr\Log\LoggerInterface::class) -); +$factory = \OC::$server->get(\OCA\User_LDAP\AccessFactory::class); +$access = $factory->get($con); $wizard = new \OCA\User_LDAP\Wizard($configuration, $ldapWrapper, $access); -- cgit v1.2.3