diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2012-06-20 13:01:55 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2012-06-20 13:01:55 +0200 |
commit | 1ecbf459c9f181a23f25c8305a6f6ba3c99e7afe (patch) | |
tree | b5d224a25286b7467ccc875b2b772ba3a9a99c8a /apps | |
parent | 8d89bba07cc1add9d464a63a360c9338099e3d30 (diff) | |
parent | 5b02217906a44312ffe43a97124a6ad2f0707aef (diff) | |
download | nextcloud-server-1ecbf459c9f181a23f25c8305a6f6ba3c99e7afe.tar.gz nextcloud-server-1ecbf459c9f181a23f25c8305a6f6ba3c99e7afe.zip |
Merge branch 'master' of gitorious.org:owncloud/owncloud
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/group_ldap.php | 4 | ||||
-rw-r--r-- | apps/user_ldap/lib_ldap.php | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index 78bc5b46566..a3117b5a41e 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -166,7 +166,9 @@ class OC_GROUP_LDAP extends OC_Group_Backend { $result[] = OC_LDAP::dn2username($ldap_users[0]); continue; } else { - $result[] = OC_LDAP::dn2username($member); + if($ocname = OC_LDAP::dn2username($member)){ + $result[] = $ocname; + } } } if(!$isMemberUid) { diff --git a/apps/user_ldap/lib_ldap.php b/apps/user_ldap/lib_ldap.php index befdf267bcd..aa104eb5126 100644 --- a/apps/user_ldap/lib_ldap.php +++ b/apps/user_ldap/lib_ldap.php @@ -166,11 +166,14 @@ class OC_LDAP { * @brief returns the internal ownCloud name for the given LDAP DN of the group * @param $dn the dn of the group object * @param $ldapname optional, the display name of the object - * @returns string with with the name to use in ownCloud + * @returns string with with the name to use in ownCloud, false on DN outside of search DN * * returns the internal ownCloud name for the given LDAP DN of the group */ static public function dn2groupname($dn, $ldapname = null) { + if(strrpos($dn, self::$ldapBaseGroups) !== (strlen($dn)-strlen(self::$ldapBaseGroups))) { + return false; + } return self::dn2ocname($dn, $ldapname, false); } @@ -180,9 +183,12 @@ class OC_LDAP { * @param $ldapname optional, the display name of the object * @returns string with with the name to use in ownCloud * - * returns the internal ownCloud name for the given LDAP DN of the user + * returns the internal ownCloud name for the given LDAP DN of the user, false on DN outside of search DN */ static public function dn2username($dn, $ldapname = null) { + if(strrpos($dn, self::$ldapBaseUsers) !== (strlen($dn)-strlen(self::$ldapBaseUsers))) { + return false; + } return self::dn2ocname($dn, $ldapname, true); } |