diff --git a/plugins/kolab_delegation/config.inc.php.dist b/plugins/kolab_delegation/config.inc.php.dist
index 56d7bdb4..a242ef8f 100644
--- a/plugins/kolab_delegation/config.inc.php.dist
+++ b/plugins/kolab_delegation/config.inc.php.dist
@@ -1,25 +1,14 @@
rc = rcube::get_instance();
-
- // Default filter of LDAP queries
- $this->ldap_filter = $this->rc->config->get('kolab_delegation_filter');
- // Name of the LDAP field for delegates list
- $this->ldap_delegate_field = $this->rc->config->get('kolab_delegation_delegate_field');
- // Name of the LDAP field with authentication ID
- $this->ldap_login_field = $this->rc->config->get('kolab_delegation_login_field');
- // Name of the LDAP field with user name used for identities
- $this->ldap_name_field = $this->rc->config->get('kolab_delegation_name_field');
- // Name of the LDAP field with email addresses used for identities
- $this->ldap_email_field = $this->rc->config->get('kolab_delegation_email_field');
- // Encoded LDAP DN of current user, set on login by kolab_auth plugin
- $this->ldap_dn = $_SESSION['kolab_dn'];
}
/**
@@ -234,6 +222,22 @@ class kolab_delegation_engine
return null;
}
+ // Default filter of LDAP queries
+ $this->ldap_filter = $this->rc->config->get('kolab_delegation_filter');
+ // Name of the LDAP field for delegates list
+ $this->ldap_delegate_field = $this->rc->config->get('kolab_delegation_delegate_field');
+ // Encoded LDAP DN of current user, set on login by kolab_auth plugin
+ $this->ldap_dn = $_SESSION['kolab_dn'];
+
+ // Name of the LDAP field with authentication ID
+ $this->ldap_login_field = $this->rc->config->get('kolab_auth_login');
+ // Name of the LDAP field with user name used for identities
+ $this->ldap_name_field = $this->rc->config->get('kolab_auth_name');
+ // Name of the LDAP field with email addresses used for identities
+ $this->ldap_email_field = $this->rc->config->get('kolab_auth_email');
+ // Name of the LDAP field with organization name for identities
+ $this->ldap_org_field = $this->rc->config->get('kolab_auth_organization');
+
$ldap->set_filter($this->ldap_filter);
return $ldap;
@@ -470,6 +474,14 @@ class kolab_delegation_engine
}
}
+ // Organization for identity
+ foreach ((array)$this->ldap_org_field as $field) {
+ $organization = is_array($data[$field]) ? $data[$field][0] : $data[$field];
+ if (!empty($organization)) {
+ break;
+ }
+ }
+
$realname = $name;
if ($uid && $name) {
$name .= ' (' . $uid . ')';
@@ -491,6 +503,7 @@ class kolab_delegation_engine
'imap_uid' => $imap_uid,
'email' => $email,
'ID' => $data['ID'],
+ 'organization' => $organization,
);
}
@@ -610,6 +623,7 @@ class kolab_delegation_engine
// @TODO: "Delegatorname" or "Username on behalf of Delegatorname"?
$default['name'] = $delegator['realname'];
$default['email'] = $email;
+ $default['organization'] = $delegator['organization'];
$this->rc->user->insert_identity($default);
}
diff --git a/plugins/kolab_delegation/package.xml b/plugins/kolab_delegation/package.xml
index 3901e471..21f3a466 100644
--- a/plugins/kolab_delegation/package.xml
+++ b/plugins/kolab_delegation/package.xml
@@ -15,9 +15,9 @@
machniak@kolabsys.com
yes
- 2012-12-04
+ 2012-12-19
- 0.1
+ 0.2
0.1