summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-30 17:01:11 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-30 17:22:14 +0100
commit1d91f501f4516033d10741483186ac743f9c7fd8 (patch)
tree51a64bcf3c9802078a8758720fa5c28a9ef89f4e
parent7381230117b0861d635820dc9095f47e28cca390 (diff)
downloadwebadmin-1d91f501f4516033d10741483186ac743f9c7fd8.tar.gz
Use lowercase comparisons when trying to see of the members of a group can be expanded
-rw-r--r--lib/Auth/LDAP.php37
-rw-r--r--lib/api/kolab_api_service_group.php3
2 files changed, 25 insertions, 15 deletions
diff --git a/lib/Auth/LDAP.php b/lib/Auth/LDAP.php
index c44cfd2..5aff9f6 100644
--- a/lib/Auth/LDAP.php
+++ b/lib/Auth/LDAP.php
@@ -1171,22 +1171,24 @@ class LDAP
$entries = self::normalize_result($this->search($dn));
+ //console("ENTRIES for \$dn $dn", $entries);
+
foreach ($entries as $entry_dn => $entry) {
if (!isset($entry['objectclass'])) {
continue;
}
foreach ($entry['objectclass'] as $objectclass) {
- switch ($objectclass) {
- case "groupofnames":
- $group_members = array_merge($group_members, $this->_list_group_member($entry_dn, $entry));
- break;
- case "groupofuniquenames":
- $group_members = array_merge($group_members, $this->_list_group_uniquemember($entry_dn, $entry));
- break;
- case "groupofurls":
- $group_members = array_merge($group_members, $this->_list_group_memberurl($entry_dn, $entry));
- break;
+ switch (strtolower($objectclass)) {
+ case "groupofnames":
+ $group_members = array_merge($group_members, $this->_list_group_member($entry_dn, $entry));
+ break;
+ case "groupofuniquenames":
+ $group_members = array_merge($group_members, $this->_list_group_uniquemember($entry_dn, $entry));
+ break;
+ case "groupofurls":
+ $group_members = array_merge($group_members, $this->_list_group_memberurl($entry_dn, $entry));
+ break;
}
}
}
@@ -1227,7 +1229,7 @@ class LDAP
private function _list_group_uniquemember($dn, $entry)
{
- error_log("Called _list_group_uniquemember(" . $dn . ")");
+ //console("Called _list_group_uniquemember(" . $dn . ")", $entry);
// Use the member attributes to return an array of member ldap objects
// NOTE that the member attribute is supposed to contain a DN
@@ -1236,6 +1238,11 @@ class LDAP
return $group_members;
}
+ if (is_string($entry['uniquemember'])) {
+ //console("uniquemember for entry is not an array");
+ $entry['uniquemember'] = Array( $entry['uniquemember'] );
+ }
+
foreach ($entry['uniquemember'] as $member) {
$result = @ldap_read($this->conn, $member, '(objectclass=*)');
@@ -1247,10 +1254,10 @@ class LDAP
$group_members[$member] = array_pop($member_entry);
// Nested groups
-// $group_group_members = $this->_list_group_members($member, $member_entry);
-// if ($group_group_members) {
-// $group_members = array_merge($group_group_members, $group_members);
-// }
+ $group_group_members = $this->_list_group_members($member, $member_entry);
+ if ($group_group_members) {
+ $group_members = array_merge($group_group_members, $group_members);
+ }
}
return array_filter($group_members);
diff --git a/lib/api/kolab_api_service_group.php b/lib/api/kolab_api_service_group.php
index a527aa5..33a71a7 100644
--- a/lib/api/kolab_api_service_group.php
+++ b/lib/api/kolab_api_service_group.php
@@ -152,6 +152,8 @@ class kolab_api_service_group extends kolab_api_service
// add group type id to the result
$result['type_id'] = $this->object_type_id('group', $result['objectclass']);
+ //console($result);
+
if ($result) {
return $result;
}
@@ -172,6 +174,7 @@ class kolab_api_service_group extends kolab_api_service
$auth = Auth::get_instance();
if (empty($getdata['group'])) {
+ //error_log("Empty \$getdata['group']");
return FALSE;
}