MDL-43430 enrol_ldap: Enrolment lost if member of group with parenthesis

The group names we get from ldap_find_user_groups() can contain invalid LDAP
filter characters. So we need to escape them for LDAP filter usage.
This commit is contained in:
Iñaki Arenaza
2014-11-05 09:00:17 +01:00
parent 9807737734
commit 21302343ee
+1
View File
@@ -720,6 +720,7 @@ class enrol_ldap_plugin extends enrol_plugin {
$usergroups = $this->ldap_find_user_groups($extmemberuid);
if(count($usergroups) > 0) {
foreach ($usergroups as $group) {
$group = ldap_filter_addslashes($group);
$ldap_search_pattern .= '('.$this->get_config('memberattribute_role'.$role->id).'='.$group.')';
}
}