. * */ namespace OCA\User_LDAP; use OCP\LDAP\ILDAPProviderFactory; use OCP\IServerContainer; use OCA\User_LDAP\User\DeletedUsersIndex; use OCA\User_LDAP\Mapping\UserMapping; class LDAPProviderFactory implements ILDAPProviderFactory { /** * Server container * * @var IServerContainer */ private $serverContainer; /** * Constructor for the LDAP provider factory * * @param IServerContainer $serverContainer server container */ public function __construct(IServerContainer $serverContainer) { $this->serverContainer = $serverContainer; } /** * creates and returns an instance of the ILDAPProvider * * @return OCP\LDAP\ILDAPProvider */ public function getLDAPProvider() { $dbConnection = $this->serverContainer->getDatabaseConnection(); $userMapping = new UserMapping($dbConnection); return new LDAPProvider($this->serverContainer, new Helper($this->serverContainer->getConfig()), new DeletedUsersIndex($this->serverContainer->getConfig(), $dbConnection, $userMapping)); } }