2018-01-05 14:27:36 +01:00
|
|
|
<?php
|
2025-04-27 14:38:18 +02:00
|
|
|
|
2018-01-05 14:27:36 +01:00
|
|
|
/**
|
2024-05-29 11:32:54 +02:00
|
|
|
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2018-01-05 14:27:36 +01:00
|
|
|
*/
|
|
|
|
namespace OCA\User_LDAP;
|
|
|
|
|
|
|
|
use OCA\User_LDAP\User\Manager;
|
2024-06-20 14:44:02 +02:00
|
|
|
use OCP\IAppConfig;
|
2018-01-05 14:27:36 +01:00
|
|
|
use OCP\IConfig;
|
2018-03-19 15:53:30 +01:00
|
|
|
use OCP\IUserManager;
|
2023-04-24 16:03:40 +02:00
|
|
|
use OCP\Server;
|
2021-10-12 17:19:51 +02:00
|
|
|
use Psr\Log\LoggerInterface;
|
2018-01-05 14:27:36 +01:00
|
|
|
|
|
|
|
class AccessFactory {
|
|
|
|
|
|
|
|
public function __construct(
|
2024-06-20 14:44:02 +02:00
|
|
|
private ILDAPWrapper $ldap,
|
|
|
|
private Helper $helper,
|
|
|
|
private IConfig $config,
|
|
|
|
private IAppConfig $appConfig,
|
|
|
|
private IUserManager $ncUserManager,
|
|
|
|
private LoggerInterface $logger,
|
|
|
|
) {
|
2018-01-05 14:27:36 +01:00
|
|
|
$this->ldap = $ldap;
|
|
|
|
$this->helper = $helper;
|
|
|
|
$this->config = $config;
|
2018-03-19 15:53:30 +01:00
|
|
|
$this->ncUserManager = $ncUserManager;
|
2021-10-12 17:19:51 +02:00
|
|
|
$this->logger = $logger;
|
2018-01-05 14:27:36 +01:00
|
|
|
}
|
|
|
|
|
2022-10-24 16:09:06 +02:00
|
|
|
public function get(Connection $connection): Access {
|
2023-04-27 11:21:53 +02:00
|
|
|
/* Each Access instance gets its own Manager instance, see OCA\User_LDAP\AppInfo\Application::register() */
|
2018-01-05 14:27:36 +01:00
|
|
|
return new Access(
|
|
|
|
$this->ldap,
|
2024-06-20 14:44:02 +02:00
|
|
|
$connection,
|
2023-04-24 16:03:40 +02:00
|
|
|
Server::get(Manager::class),
|
2018-01-05 14:27:36 +01:00
|
|
|
$this->helper,
|
2018-03-19 15:53:30 +01:00
|
|
|
$this->config,
|
2021-10-12 17:19:51 +02:00
|
|
|
$this->ncUserManager,
|
2024-06-20 14:44:02 +02:00
|
|
|
$this->logger,
|
|
|
|
$this->appConfig,
|
2018-01-05 14:27:36 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|