summaryrefslogtreecommitdiffstats
path: root/lib/api/kolab_api_service_user.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-04-02 11:54:44 +0200
committerAleksander Machniak <machniak@kolabsys.com>2012-04-02 11:54:44 +0200
commit8b8c5d207d0b9ba1ea25319cd076efddbfd20635 (patch)
tree240cc42320985248e35094045a0f39248ebe7b49 /lib/api/kolab_api_service_user.php
parent1a8ffd90aa802155da1903b6c23ae68224f31b91 (diff)
downloadwebadmin-8b8c5d207d0b9ba1ea25319cd076efddbfd20635.tar.gz
Use 'id' as unique identifier (and entrydn), so API client don't need to know what real attribute name is
Diffstat (limited to 'lib/api/kolab_api_service_user.php')
-rw-r--r--lib/api/kolab_api_service_user.php45
1 files changed, 2 insertions, 43 deletions
diff --git a/lib/api/kolab_api_service_user.php b/lib/api/kolab_api_service_user.php
index 847646d..91c6c69 100644
--- a/lib/api/kolab_api_service_user.php
+++ b/lib/api/kolab_api_service_user.php
@@ -274,51 +274,10 @@ class kolab_api_service_user extends kolab_api_service
}
$auth = Auth::get_instance();
- $conf = Conf::get_instance();
- $user = $getdata['user'];
- $result = $auth->user_info($user);
+ $result = $auth->user_info($getdata['user']);
// normalize result
- $dn = key($result);
- $result = $result[$dn];
- $result['entrydn'] = $dn;
-
- // add user type id to the result
- $result['type_id'] = $this->object_type_id('user', $result['objectclass']);
-
- // Search for attributes associated with the type_id that are not part
- // of the results returned earlier. Example: nsrole / nsroledn / aci, etc.
- if ($result['type_id']) {
- $uta = $this->object_type_attributes('user', $result['type_id']);
- $attrs = array();
-
- foreach ($uta as $field_type => $attributes) {
- foreach ($attributes as $attribute => $data) {
- if (!array_key_exists($attribute, $result)) {
- $attrs[] = $attribute;
- }
- }
- }
-
- // Insert the persistent, unique attribute
- $unique_attr = $conf->get('unique_attribute');
- if (!$unique_attr) {
- $unique_attr = 'nsuniqueid';
- }
-
- if (!array_key_exists($unique_attr, $attrs)) {
- $attrs[] = 'nsuniqueid';
- }
-
- if (!empty($attrs)) {
- $attrs = $auth->get_attributes($result['entrydn'], $attrs);
- if (!empty($attrs)) {
- $result = array_merge($result, $attrs);
- }
- }
- }
-
- console($result);
+ $result = $this->parse_result_attributes('group', $result);
if ($result) {
return $result;