From 65b78515bd5864eb456c0717102a2b6eed7245cc Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 25 Jan 2021 21:06:07 +0100 Subject: make ILDAPProviderFactory usable when there is no ldap setup Signed-off-by: Robin Appelman --- lib/private/LDAP/NullLDAPProviderFactory.php | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 lib/private/LDAP/NullLDAPProviderFactory.php (limited to 'lib/private/LDAP') diff --git a/lib/private/LDAP/NullLDAPProviderFactory.php b/lib/private/LDAP/NullLDAPProviderFactory.php new file mode 100644 index 00000000000..b0c6192b17e --- /dev/null +++ b/lib/private/LDAP/NullLDAPProviderFactory.php @@ -0,0 +1,40 @@ + + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OC\LDAP; + +use OCP\IServerContainer; +use OCP\LDAP\ILDAPProviderFactory; + +class NullLDAPProviderFactory implements ILDAPProviderFactory { + public function __construct(IServerContainer $serverContainer) { + } + + public function getLDAPProvider() { + throw new \Exception("No LDAP provider is available"); + } + + public function isAvailable(): bool { + return false; + } +} -- cgit v1.2.3