summaryrefslogtreecommitdiffstats
path: root/lib/client/kolab_client_task_user.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/client/kolab_client_task_user.php')
-rw-r--r--lib/client/kolab_client_task_user.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/client/kolab_client_task_user.php b/lib/client/kolab_client_task_user.php
index 4765fb6..2daaead 100644
--- a/lib/client/kolab_client_task_user.php
+++ b/lib/client/kolab_client_task_user.php
@@ -232,6 +232,7 @@ class kolab_client_task_user extends kolab_client_task
'uidnumber' => 'system',
'gidnumber' => 'system',
'homedirectory' => 'system',
+ 'nsrole' => 'system',
'mailquota' => 'config',
'cyrususerquota' => 'config',
@@ -292,6 +293,17 @@ class kolab_client_task_user extends kolab_client_task
'section' => 'personal',
'value' => $accttypes[$type]['content'],
);
+
+ // Roles (extract role names)
+ if (!empty($fields['nsrole']) && !empty($data['nsrole'])) {
+ $data['nsrole'] = array_combine($data['nsrole'], $data['nsrole']);
+ foreach ($data['nsrole'] as $dn => $val) {
+ // @TODO: maybe ldap_explode_dn() would be better?
+ if (preg_match('/^cn=([^,]+)/i', $val, $m)) {
+ $data['nsrole'][$dn] = $m[1];
+ }
+ }
+ }
}
// Create form object and populate with fields