diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-10-24 16:09:06 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-10-25 09:52:35 +0200 |
commit | 4130a4cbd8e5bb4506ac30a19a91b088aa35dd24 (patch) | |
tree | 1649216df56b9a685eec56cd694cef4f7ccbfa50 /apps/user_ldap/ajax/wizard.php | |
parent | 6435191a6e96600db9efbad8514d6c2eff1375d1 (diff) | |
download | nextcloud-server-4130a4cbd8e5bb4506ac30a19a91b088aa35dd24.tar.gz nextcloud-server-4130a4cbd8e5bb4506ac30a19a91b088aa35dd24.zip |
Make sure to use AccessFactory to create Access instances and use DI
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap/ajax/wizard.php')
-rw-r--r-- | apps/user_ldap/ajax/wizard.php | 23 |
1 files changed, 2 insertions, 21 deletions
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); |