New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the Net/LDAP3::domain_root_dn() function if it is available #268
Use the Net/LDAP3::domain_root_dn() function if it is available #268
Conversation
I catch the idea, but the change would need to be more complicated considering the body of this if statement https://github.com/roundcube/roundcubemail/blob/master/program/lib/Roundcube/rcube_ldap.php#L296. At least I'm sure we don't need to search for %dc two times. |
The |
Hmm, but And we don't want to execute this extra bind to resolve the root_dn every time but only when it's actually necessary. Like when there are actually |
I'm not sure why we are circling a |
Apparently I misunderstood your previous comment about "The $this->prop['search_bind_dn'] however is not correctly substituted any %dc". Anyway, I'm trying to avoid implicit calls to the rather costly |
The session may already have a bind dn associated with it, in which case this lookup isn't necessary either (for kolab_auth at least). |
I guess would consider to cache this lookup in session data later on. But first, here's my proposition to do this lookup in the first place: if (!empty($this->prop['domain_filter']) && !empty($this->prop['search_bind_dn'])
&& method_exists($this->ldap, 'domain_root_dn')) {
$this->ldap->bind($this->prop['search_bind_dn'], $this->prop['search_bind_pw']);
$dc = $this->ldap->domain_root_dn($d);
} That would at least limit the lookup to hosted configurations ( |
FWIW: |
IIRC, it uses caching only for subsequent repeated calls to the function in the same run, though, and nothing like a cross-request session, right? |
LDAP3.php Line 3052 uses whatever cache is configured and in Roundcube this is controlled by the |
…variable; replaces PR #268
Modified patch committed in 0f63418. Closing. |
Discovering the root dn used for a domain is a routine available in Net/LDAP3.