xperseguers / t3ext-ig_ldap_sso_auth

TYPO3 Extension ig_ldap_sso_auth. This extension provides LDAP and SSO support for TYPO3.
https://extensions.typo3.org/extension/ig_ldap_sso_auth
27 stars 70 forks source link

Wrong conditions in LdapUtility #141

Closed frohland closed 2 years ago

frohland commented 2 years ago

I had a problem to log in my AD users with this Extension under TYPO3 v11.5 and PHP v8.1 . It did some debugging and found a bug in the file Causal\IgLdapSsoAuth\Utility\LdapUtility. There a these two functions:

public function getDn()
{
    $dn = ''; // TODO: better return null?
    if (is_resource($this->firstResultEntry)) {
        $dn = ldap_get_dn($this->connection, $this->firstResultEntry);
    }
    return $dn;
}

public function getAttributes()
{
    $attributes = [];
    if (is_resource($this->firstResultEntry)) {
        $attributes = ldap_get_attributes($this->connection, $this->firstResultEntry);
    }
    return $attributes;
}

The condition in this functions is is_resource. But this condition was never met. I did some research and found that ...

All resource types used in the LDAP extension are converted to use standard PHP classes in PHP 8.1.

I hope this helps and we can get a quick fix for this. Thank you :)