Do not try to check the ldap credentials if the user has no ldap installed on server

This commit is contained in:
Alex Tselegidis 2024-06-18 15:45:31 +02:00
parent 88b8f87f97
commit ea95b20873
1 changed files with 4 additions and 4 deletions

View File

@ -50,14 +50,14 @@ class Ldap_client
*/ */
public function check_login(string $username, string $password): ?array public function check_login(string $username, string $password): ?array
{ {
if (!extension_loaded('ldap')) {
return null;
}
if (empty($username)) { if (empty($username)) {
throw new InvalidArgumentException('No username value provided.'); throw new InvalidArgumentException('No username value provided.');
} }
// Check LDAP environment and configuration
$this->check_environment();
$ldap_is_active = setting('ldap_is_active'); $ldap_is_active = setting('ldap_is_active');
if (!$ldap_is_active) { if (!$ldap_is_active) {