Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-11299 - Make objectClass string comparison case insensitive.

LDAP serves accept attribute names in a case insensitive way, so don't
force the users to use any particular spelling. (backported from HEAD).
  • Loading branch information...
commit 764d44c11eac34e539afb0b4f91e755659f67b94 1 parent c2c3f6e
iarenaza authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 auth/ldap/lib.php
View
6 auth/ldap/lib.php
@@ -1180,8 +1180,10 @@ function auth_ldap_init () {
}
}
//hack prefix to objectclass
- if ('objectClass=' != substr($CFG->ldap_objectclass, 0, 12)) {
- $CFG->ldap_objectclass = 'objectClass='.$CFG->ldap_objectclass;
+ if (empty($CFG->ldap_objectclass)) { // Can't send empty filter
+ $CFG->ldap_objectclass = 'objectClass=*';
+ } else if (stripos($CFG->ldap_objectclass, 'objectClass=') !== 0) {
+ $CFG->ldap_objectclass = 'objectClass='.$CFG->ldap_objectclass;
}
//all chages go in $CFG , no need to return value
Please sign in to comment.
Something went wrong with that request. Please try again.