From 39cd51aff59d8a85321474ee573b09b507b3f24e Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 04 Dec 2008 14:07:29 -0500
Subject: [PATCH] - performance: connect to imap server only when needed (some mail actions do not require imap connection)
---
program/include/rcube_user.php | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/program/include/rcube_user.php b/program/include/rcube_user.php
index cc09028..00f5cd7 100644
--- a/program/include/rcube_user.php
+++ b/program/include/rcube_user.php
@@ -31,7 +31,7 @@
{
public $ID = null;
public $data = null;
- public $language = 'en_US';
+ public $language = null;
private $db = null;
@@ -78,7 +78,8 @@
*/
function get_prefs()
{
- $prefs = array('language' => $this->language);
+ if (!empty($this->language))
+ $prefs = array('language' => $this->language);
if ($this->ID && $this->data['preferences'])
$prefs += (array)unserialize($this->data['preferences']);
@@ -156,7 +157,7 @@
WHERE del<>1
AND user_id=?
$sql_add
- ORDER BY ".$this->db->quoteIdentifier('standard')." DESC, name ASC",
+ ORDER BY ".$this->db->quoteIdentifier('standard')." DESC, name ASC, identity_id ASC",
$this->ID);
return $sql_result;
@@ -372,9 +373,9 @@
$user_name = $user != $user_email ? $user : '';
// try to resolve the e-mail address from the virtuser table
- if ($virtuser_query = $rcmail->config->get('virtuser_query') &&
- ($sql_result = $dbh->query(preg_replace('/%u/', $dbh->escapeSimple($user), $virtuser_query))) &&
- ($dbh->num_rows() > 0))
+ if (($virtuser_query = $rcmail->config->get('virtuser_query'))
+ && ($sql_result = $dbh->query(preg_replace('/%u/', $dbh->escapeSimple($user), $virtuser_query)))
+ && ($dbh->num_rows() > 0))
{
while ($sql_arr = $dbh->fetch_array($sql_result))
{
--
Gitblit v1.9.1