1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
From: William Desportes <williamdes@wdes.fr>
Date: Sat, 18 Mar 2023 17:31:38 +0100
Subject: Fix LDAP connect is a class on PHP 8.1 and not a resource anymore
Ref: https://www.php.net/manual/en/function.ldap-connect.php#refsect1-function.ldap-connect-changelog
In 8.1.0 -> Returns an LDAP\Connection instance now; previously, a resource was returned.
Origin: upstream
Forwarded: https://github.com/leenooks/phpLDAPadmin/commit/b035e8a0f4f49633c2492a07f0182eefb311848d
---
lib/ds_ldap.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/ds_ldap.php b/lib/ds_ldap.php
index 9537ff2..2f82eda 100644
--- a/lib/ds_ldap.php
+++ b/lib/ds_ldap.php
@@ -216,7 +216,7 @@ class ldap extends DS {
debug_log('LDAP Resource [%s], Host [%s], Port [%s]',16,0,__FILE__,__LINE__,__METHOD__,
$resource,$this->getValue('server','host'),$this->getValue('server','port'));
- if (! is_resource($resource))
+ if (!$resource)
debug_dump_backtrace('UNHANDLED, $resource is not a resource',1);
# Go with LDAP version 3 if possible (needed for renaming and Novell schema fetching)
@@ -337,7 +337,7 @@ class ldap extends DS {
$connect = $this->connect($method,false,$new);
# If we didnt log in...
- if (! is_resource($connect) || $this->noconnect || ! $this->userIsAllowedLogin($userDN)) {
+ if (!$connect || $this->noconnect || ! $this->userIsAllowedLogin($userDN)) {
$this->logout($method);
return false;
|