Use new rcube_user::list_emails() for better performance (#3970)
This commit is contained in:
parent
ae93c7b345
commit
62ac800db7
5 changed files with 9 additions and 27 deletions
|
@ -1588,7 +1588,7 @@ class calendar extends rcube_plugin
|
|||
|
||||
// get user identity to create default attendee
|
||||
if ($this->ui->screen == 'calendar') {
|
||||
foreach ($this->rc->user->list_identities() as $rec) {
|
||||
foreach ($this->rc->user->list_emails() as $rec) {
|
||||
if (!$identity)
|
||||
$identity = $rec;
|
||||
$identity['emails'][] = $rec['email'];
|
||||
|
|
|
@ -375,7 +375,7 @@ class calendar_ui
|
|||
{
|
||||
$attrib['name'] = 'identity';
|
||||
$select = new html_select($attrib);
|
||||
$identities = $this->rc->user->list_identities();
|
||||
$identities = $this->rc->user->list_emails();
|
||||
|
||||
foreach ($identities as $ident) {
|
||||
$select->add(format_email_recipient($ident['email'], $ident['name']), $ident['identity_id']);
|
||||
|
|
|
@ -539,21 +539,6 @@ class kolab_delegation_engine
|
|||
return $parsed ? $this->parse_ldap_record($this->cache['user']) : $this->cache['user'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns current user identities
|
||||
*
|
||||
* @return array List of identities
|
||||
*/
|
||||
public function user_identities()
|
||||
{
|
||||
// cache result in-memory, we need it more than once
|
||||
if ($this->identities === null) {
|
||||
$this->identities = $this->rc->user->list_identities();
|
||||
}
|
||||
|
||||
return $this->identities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update LDAP record of current user
|
||||
*
|
||||
|
@ -596,7 +581,7 @@ class kolab_delegation_engine
|
|||
|
||||
$delegators = $this->list_delegators();
|
||||
$use_subs = $this->rc->config->get('kolab_use_subscriptions');
|
||||
$identities = $this->user_identities();
|
||||
$identities = $this->rc->user->list_emails();
|
||||
$emails = array();
|
||||
$uids = array();
|
||||
|
||||
|
@ -611,10 +596,7 @@ class kolab_delegation_engine
|
|||
// get user name from default identity
|
||||
if (!$idx) {
|
||||
$default = array(
|
||||
'name' => $ident['name'],
|
||||
// 'organization' => $ident['organization'],
|
||||
// 'signature' => $ident['signature'],
|
||||
// 'html_signature' => $ident['html_signature'],
|
||||
'name' => $ident['name'],
|
||||
);
|
||||
}
|
||||
$emails[$ident['identity_id']] = $ident['email'];
|
||||
|
@ -738,7 +720,7 @@ class kolab_delegation_engine
|
|||
return;
|
||||
}
|
||||
|
||||
$identities = $this->user_identities();
|
||||
$identities = $this->rc->user->list_emails();
|
||||
$emails = $_SESSION['delegators'][$context];
|
||||
|
||||
foreach ($identities as $ident) {
|
||||
|
@ -768,7 +750,7 @@ class kolab_delegation_engine
|
|||
}
|
||||
// return only user addresses (exclude all delegators addresses)
|
||||
else if (!empty($_SESSION['delegators'])) {
|
||||
$identities = $this->user_identities();
|
||||
$identities = $this->rc->user->list_emails();
|
||||
$emails[] = $this->rc->user->get_username();
|
||||
|
||||
foreach ($identities as $identity) {
|
||||
|
|
|
@ -381,7 +381,7 @@ class libcalendaring extends rcube_plugin
|
|||
}
|
||||
|
||||
$emails[] = $this->rc->user->get_username();
|
||||
foreach ($this->rc->user->list_identities() as $identity) {
|
||||
foreach ($this->rc->user->list_emails() as $identity) {
|
||||
$emails[] = strtolower($identity['email']);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ class tasklist_ui
|
|||
$settings['sort_order'] = $this->rc->config->get('tasklist_sort_order', 'asc');
|
||||
|
||||
// get user identity to create default attendee
|
||||
foreach ($this->rc->user->list_identities() as $rec) {
|
||||
foreach ($this->rc->user->list_emails() as $rec) {
|
||||
if (!$identity)
|
||||
$identity = $rec;
|
||||
|
||||
|
@ -118,7 +118,7 @@ class tasklist_ui
|
|||
{
|
||||
$attrib['name'] = 'identity';
|
||||
$select = new html_select($attrib);
|
||||
$identities = $this->rc->user->list_identities();
|
||||
$identities = $this->rc->user->list_emails();
|
||||
|
||||
foreach ($identities as $ident) {
|
||||
$select->add(format_email_recipient($ident['email'], $ident['name']), $ident['identity_id']);
|
||||
|
|
Loading…
Add table
Reference in a new issue