summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include/rcmail.php
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-01-28 12:52:24 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-01-28 12:52:24 +0000
commitb64bb011f4104b4a62df119a5d7b643f3c570d51 (patch)
tree0f4de8736675e931e8faf2df5eb5df2ec7707ee9 /roundcubemail/program/include/rcmail.php
parentf01835508614938c2cf0382b82ea62c2c4dedd16 (diff)
- Login preformance: Create default folders on first login only
git-svn-id: https://svn.roundcube.net/trunk@3232 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcmail.php')
-rw-r--r--roundcubemail/program/include/rcmail.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/roundcubemail/program/include/rcmail.php b/roundcubemail/program/include/rcmail.php
index 1afb7d72a..e3c826111 100644
--- a/roundcubemail/program/include/rcmail.php
+++ b/roundcubemail/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;
}