summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2012-05-17 13:15:26 +0200
committerArthur Schiwon <blizzz@owncloud.com>2012-05-17 17:17:40 +0200
commit38c56388c1f7469139114d2db254f693cacd800f (patch)
tree3c6e8d85a78a560fbc5ff2e646a5d70247b798e0 /apps
parentb9cd0ecc8a03a58219134113cbfb4aef80788417 (diff)
downloadnextcloud-server-38c56388c1f7469139114d2db254f693cacd800f.tar.gz
nextcloud-server-38c56388c1f7469139114d2db254f693cacd800f.zip
LDAP: Fix case sensitivity issues with display name attribute
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/lib_ldap.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/user_ldap/lib_ldap.php b/apps/user_ldap/lib_ldap.php
index 614c6d916f4..4618921b4a6 100644
--- a/apps/user_ldap/lib_ldap.php
+++ b/apps/user_ldap/lib_ldap.php
@@ -484,8 +484,14 @@ class OC_LDAP {
$i = 0;
}
foreach($findings as $item) {
+ if(!is_array($item)) {
+ continue;
+ }
+ $item = array_change_key_case($item);
+
if($multiarray) {
foreach($attr as $key) {
+ $key = strtolower($key);
if(isset($item[$key])) {
if($key != 'dn'){
$selection[$i][$key] = $item[$key][0];
@@ -498,10 +504,6 @@ class OC_LDAP {
$i++;
} else {
//tribute to case insensitivity
- if(!is_array($item)) {
- continue;
- }
- $item = array_change_key_case($item);
$key = strtolower($attr[0]);
if(isset($item[$key])) {
@@ -599,10 +601,10 @@ class OC_LDAP {
self::$ldapBaseGroups = OCP\Config::getAppValue('user_ldap', 'ldap_base_groups', self::$ldapBase);
self::$ldapTLS = OCP\Config::getAppValue('user_ldap', 'ldap_tls',0);
self::$ldapNoCase = OCP\Config::getAppValue('user_ldap', 'ldap_nocase', 0);
- self::$ldapUserDisplayName = OCP\Config::getAppValue('user_ldap', 'ldap_display_name', OC_USER_BACKEND_LDAP_DEFAULT_DISPLAY_NAME);
+ self::$ldapUserDisplayName = strtolower(OCP\Config::getAppValue('user_ldap', 'ldap_display_name', OC_USER_BACKEND_LDAP_DEFAULT_DISPLAY_NAME));
self::$ldapUserFilter = OCP\Config::getAppValue('user_ldap', 'ldap_userlist_filter','objectClass=person');
self::$ldapLoginFilter = OCP\Config::getAppValue('user_ldap', 'ldap_login_filter', '(uid=%uid)');
- self::$ldapGroupDisplayName = OCP\Config::getAppValue('user_ldap', 'ldap_group_display_name', LDAP_GROUP_DISPLAY_NAME_ATTR);
+ self::$ldapGroupDisplayName = strtolower(OCP\Config::getAppValue('user_ldap', 'ldap_group_display_name', LDAP_GROUP_DISPLAY_NAME_ATTR));
if(empty(self::$ldapBaseUsers)) {
OCP\Util::writeLog('ldap', 'Base for Users is empty, using Base DN', OCP\Util::INFO);