Skip to content
Snippets Groups Projects
Commit 4749868f authored by Alexander Bias's avatar Alexander Bias
Browse files

Bugfix: Login via email for first-time LDAP logins did not work if multiple...

Bugfix: Login via email for first-time LDAP logins did not work if multiple LDAP contexts were configured
parent ce8d0e6e
Branches
Tags
No related merge requests found
...@@ -4,6 +4,10 @@ moodle-auth_ldap_syncplus ...@@ -4,6 +4,10 @@ moodle-auth_ldap_syncplus
Changes Changes
------- -------
### Unreleased
* 2018-02-07 - Bugfix: Login via email for first-time LDAP logins did not work if multiple LDAP contexts were configured; Credits to derhelge.
### v3.4-r2 ### v3.4-r2
* 2018-02-07 - Add forgotten sync_roles task definition * 2018-02-07 - Add forgotten sync_roles task definition
......
...@@ -517,8 +517,8 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap { ...@@ -517,8 +517,8 @@ class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
$ldapresult = ldap_list($ldapconnection, $context, $filter, array($authplugin->config->user_attribute)); $ldapresult = ldap_list($ldapconnection, $context, $filter, array($authplugin->config->user_attribute));
} }
// If there is no LDAP result, continue with next context. // If there is no LDAP result or if the user was not found in this context, continue with next context.
if (!$ldapresult) { if (!$ldapresult || ldap_count_entries($ldapconnection, $ldapresult) == 0) {
continue; continue;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment