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-10-30 22:52:33 +01:00
parent 1d17b54861
commit f7b5782d5c
+1
View File
@@ -704,6 +704,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.')';
}
}