From ea95b20873935a551226338dd0a2ff99dbfc9117 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Tue, 18 Jun 2024 15:45:31 +0200 Subject: [PATCH] Do not try to check the ldap credentials if the user has no ldap installed on server --- application/libraries/Ldap_client.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/libraries/Ldap_client.php b/application/libraries/Ldap_client.php index 1095fc96..3e77332e 100644 --- a/application/libraries/Ldap_client.php +++ b/application/libraries/Ldap_client.php @@ -50,14 +50,14 @@ class Ldap_client */ public function check_login(string $username, string $password): ?array { + if (!extension_loaded('ldap')) { + return null; + } + if (empty($username)) { throw new InvalidArgumentException('No username value provided.'); } - // Check LDAP environment and configuration - - $this->check_environment(); - $ldap_is_active = setting('ldap_is_active'); if (!$ldap_is_active) {