summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--program/include/rcmail.php15
-rw-r--r--program/include/rcube_imap.php2
3 files changed, 10 insertions, 8 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b99f20140..144d9d315 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail
===========================
+- Login preformance: Create default folders on first login only
- Import contacts into the selected address book (by Phil Weir)
- Add support for MDB2's 'sqlsrv' driver (#1486395)
- Use jQuery-1.4
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 1afb7d72a..e3c826111 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -492,17 +492,22 @@ class rcmail
if (!($imap_login = $this->imap->connect($host, $username, $pass, $imap_port, $imap_ssl)))
return false;
+ $this->set_imap_prop();
+
// user already registered -> update user's record
if (is_object($user)) {
+ // create default folders on first login
+ if (!$user->data['last_login'] && $config['create_default_folders'])
+ $this->imap->create_default_folders();
$user->touch();
}
// create new system user
else if ($config['auto_create_user']) {
if ($created = rcube_user::create($username, $host)) {
$user = $created;
-
- // get existing mailboxes (but why?)
- // $a_mailboxes = $this->imap->list_mailboxes();
+ // create default folders on first login
+ if ($config['create_default_folders'])
+ $this->imap->create_default_folders();
}
else {
raise_error(array(
@@ -537,12 +542,8 @@ class rcmail
$_SESSION['timezone'] = floatval($_REQUEST['_timezone']);
// force reloading complete list of subscribed mailboxes
- $this->set_imap_prop();
$this->imap->clear_cache('mailboxes');
- if ($config['create_default_folders'])
- $this->imap->create_default_folders();
-
return true;
}
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 9137ada99..128e77523 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -2139,7 +2139,7 @@ class rcube_imap
*/
function create_default_folders()
{
- $a_folders = iil_C_ListMailboxes($this->conn, $this->mod_mailbox(''), '*');
+ $a_folders = iil_C_ListMailboxes($this->conn, $this->mod_mailbox(''), 'Drafts');
$a_subscribed = iil_C_ListSubscribed($this->conn, $this->mod_mailbox(''), '*');
// create default folders if they do not exist