summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-04-11 13:09:39 +0200
committerAleksander Machniak <machniak@kolabsys.com>2012-04-11 13:09:39 +0200
commitfc59194a2c0b2bc8f23a6af202138eb22c4d397b (patch)
tree4536877ab96289a05a36809d4706692d79779c11
parent4f37477cc1faaa76779d9c2a7d1f3eb8ae4b1ef7 (diff)
downloadwebadmin-fc59194a2c0b2bc8f23a6af202138eb22c4d397b.tar.gz
Simplified pretty-printing of OU - use ldap_dn2ufn()
-rw-r--r--lib/kolab_client_task.php20
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index e51af9e..380e590 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -720,24 +720,8 @@ class kolab_client_task
// Exceptions
if ($field['name'] == 'ou') {
- foreach ($options as $idx => $ou) {
- $dn = ldap_explode_dn($ou, 0);
- if (!empty($dn)) {
- unset($dn['count']);
- $ous = array();
- $dcs = array();
- foreach ($dn as $dn_item) {
- if (preg_match('/^ou=/', $dn_item)) {
- $ous[] = substr($dn_item, 3);
- }
- else {
- $dcs[] = substr($dn_item, 3);
- }
- }
- $ou = implode(', ', $ous) . ' (' . implode('.', $dcs) . ')';
- }
- $options[$idx] = $ou;
-
+ foreach ($options as $idx => $dn) {
+ $options[$idx] = ldap_dn2ufn($dn);
}
}
}