summaryrefslogtreecommitdiffstats
path: root/lib/api/kolab_api_service_user.php
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-21 16:18:37 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-21 16:19:08 +0100
commit9584c1921850f2a4ca8be09e1b2acc8550704af1 (patch)
treeffc5191a2e1a85e10d7f57a818c15974257bb63a /lib/api/kolab_api_service_user.php
parent8feaede27eeb8a8e33d681c49a93944f3485f231 (diff)
downloadwebadmin-9584c1921850f2a4ca8be09e1b2acc8550704af1.tar.gz
Add additional user information that may be specified as being a part of the user type, but is not returned as a result in your average LDAP query.
Diffstat (limited to 'lib/api/kolab_api_service_user.php')
-rw-r--r--lib/api/kolab_api_service_user.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/api/kolab_api_service_user.php b/lib/api/kolab_api_service_user.php
index d8e79e7..0224b2b 100644
--- a/lib/api/kolab_api_service_user.php
+++ b/lib/api/kolab_api_service_user.php
@@ -121,6 +121,22 @@ class kolab_api_service_user extends kolab_api_service
$objectclass = $result[$user]['objectclass'];
$result[$user]['user_type_id'] = $this->user_type_id($objectclass);
+ // Search for attributes associated with the type_id that are not part
+ // of the results returned earlier. Example: nsrole / nsroledn / aci, etc.
+ $uta = $this->user_type_attributes($result[$user]['user_type_id']);
+
+ foreach ($uta as $field_type => $attributes) {
+ foreach ($attributes as $attribute => $data) {
+ if (!array_key_exists($attribute, $result[$user])) {
+ $attribute_value = $auth->user_get_attribute($user, $attribute);
+ if ($attribute_value) {
+ console("Got:", $attribute_value);
+ $result[$user][$attribute] = $attribute_value;
+ }
+ }
+ }
+ }
+
if ($result) {
return $result;
}