summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/calendar/drivers/kolab/kolab_user_calendar.php4
-rw-r--r--plugins/kolab_auth/config.inc.php.dist4
-rw-r--r--plugins/kolab_auth/kolab_auth_ldap.php15
-rw-r--r--plugins/kolab_notes/kolab_notes.php2
-rw-r--r--plugins/libkolab/lib/kolab_storage_folder_user.php10
-rw-r--r--plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php2
6 files changed, 33 insertions, 4 deletions
diff --git a/plugins/calendar/drivers/kolab/kolab_user_calendar.php b/plugins/calendar/drivers/kolab/kolab_user_calendar.php
index 58c2296..859dc4c 100644
--- a/plugins/calendar/drivers/kolab/kolab_user_calendar.php
+++ b/plugins/calendar/drivers/kolab/kolab_user_calendar.php
@@ -74,7 +74,7 @@ class kolab_user_calendar extends kolab_calendar
*/
public function get_name()
{
- return $this->userdata['name'] ?: $this->userdata['mail'];
+ return $this->userdata['displayname'] ?: ($this->userdata['name'] ?: $this->userdata['mail']);
}
@@ -94,7 +94,7 @@ class kolab_user_calendar extends kolab_calendar
*/
public function get_title()
{
- return $this->userdata['mail'];
+ return trim($this->userdata['displayname'] . '; ' . $this->userdata['mail'], '; ');
}
diff --git a/plugins/kolab_auth/config.inc.php.dist b/plugins/kolab_auth/config.inc.php.dist
index 7a23301..785fb78 100644
--- a/plugins/kolab_auth/config.inc.php.dist
+++ b/plugins/kolab_auth/config.inc.php.dist
@@ -29,6 +29,10 @@ $rcmail_config['kolab_auth_name'] = array('name', 'cn');
$rcmail_config['kolab_auth_email'] = array('email');
$rcmail_config['kolab_auth_organization'] = array('organization');
+// Template for user names displayed in the UI.
+// You can use all attributes from the 'fieldmap' property of the 'kolab_auth_addressbook' configuration
+$rcmail_config['kolab_auth_user_displayname'] = '{name} ({ou})';
+
// Login and password of the admin user. Enables "Login As" feature.
$rcmail_config['kolab_auth_admin_login'] = '';
$rcmail_config['kolab_auth_admin_password'] = '';
diff --git a/plugins/kolab_auth/kolab_auth_ldap.php b/plugins/kolab_auth/kolab_auth_ldap.php
index 0e3f238..117db8c 100644
--- a/plugins/kolab_auth/kolab_auth_ldap.php
+++ b/plugins/kolab_auth/kolab_auth_ldap.php
@@ -28,12 +28,17 @@
class kolab_auth_ldap extends rcube_ldap_generic
{
private $icache = array();
+ private $conf = array();
+ private $fieldmap = array();
function __construct($p)
{
$rcmail = rcube::get_instance();
+ $this->conf = $p;
+ $this->conf['kolab_auth_user_displayname'] = $rcmail->config->get('kolab_auth_user_displayname', '{name}');
+
$this->fieldmap = $p['fieldmap'];
$this->fieldmap['uid'] = 'uid';
@@ -340,6 +345,16 @@ class kolab_auth_ldap extends rcube_ldap_generic
}
}
+ // compose display name according to config
+ if (empty($this->fieldmap['displayname'])) {
+ $entry['displayname'] = rcube_addressbook::compose_search_name(
+ $entry,
+ $entry['email'],
+ $entry['name'],
+ $this->conf['kolab_auth_user_displayname']
+ );
+ }
+
return $entry;
}
diff --git a/plugins/kolab_notes/kolab_notes.php b/plugins/kolab_notes/kolab_notes.php
index cf88772..8475b7d 100644
--- a/plugins/kolab_notes/kolab_notes.php
+++ b/plugins/kolab_notes/kolab_notes.php
@@ -220,7 +220,7 @@ class kolab_notes extends rcube_plugin
'id' => $list_id,
'name' => $fullname,
'listname' => $listname,
- 'title' => $folder->get_owner(),
+ 'title' => $folder->get_title(),
'virtual' => true,
'editable' => false,
'group' => 'other virtual',
diff --git a/plugins/libkolab/lib/kolab_storage_folder_user.php b/plugins/libkolab/lib/kolab_storage_folder_user.php
index 70ded87..1c37da9 100644
--- a/plugins/libkolab/lib/kolab_storage_folder_user.php
+++ b/plugins/libkolab/lib/kolab_storage_folder_user.php
@@ -65,6 +65,16 @@ class kolab_storage_folder_user extends kolab_storage_folder_virtual
}
/**
+ * Getter for a more informative title of this user folder
+ *
+ * @return string Title for the given user record
+ */
+ public function get_title()
+ {
+ return trim($this->ldaprec['displayname'] . '; ' . $this->ldaprec['mail'], '; ');
+ }
+
+ /**
* Returns the owner of the folder.
*
* @return string The owner of this folder.
diff --git a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
index e60719c..67baa4c 100644
--- a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
+++ b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
@@ -199,7 +199,7 @@ class tasklist_kolab_driver extends tasklist_driver
'id' => $list_id,
'name' => $folder->get_name(),
'listname' => $listname,
- 'title' => $folder->get_owner(),
+ 'title' => $folder->get_title(),
'virtual' => true,
'editable' => false,
'group' => 'other virtual',