Merge branch 'master' of github.com:roundcube/roundcubemail

pull/176/head
Thomas Bruederli 11 years ago
commit 9155f3de2a

@ -355,29 +355,6 @@ class rcube
// for backward compat. (deprecated, will be removed) // for backward compat. (deprecated, will be removed)
$this->imap = $this->storage; $this->imap = $this->storage;
// enable caching of mail data
$storage_cache = $this->config->get("{$driver}_cache");
$messages_cache = $this->config->get('messages_cache');
// for backward compatybility
if ($storage_cache === null && $messages_cache === null && $this->config->get('enable_caching')) {
$storage_cache = 'db';
$messages_cache = true;
}
if ($storage_cache) {
$this->storage->set_caching($storage_cache);
}
if ($messages_cache) {
$this->storage->set_messages_caching(true);
}
// set pagesize from config
$pagesize = $this->config->get('mail_pagesize');
if (!$pagesize) {
$pagesize = $this->config->get('pagesize', 50);
}
$this->storage->set_pagesize($pagesize);
// set class options // set class options
$options = array( $options = array(
'auth_type' => $this->config->get("{$driver}_auth_type", 'check'), 'auth_type' => $this->config->get("{$driver}_auth_type", 'check'),
@ -412,19 +389,35 @@ class rcube
/** /**
* Set storage parameters. * Set storage parameters.
* This must be done AFTER connecting to the server!
*/ */
protected function set_storage_prop() protected function set_storage_prop()
{ {
$storage = $this->get_storage(); $storage = $this->get_storage();
// set pagesize from config
$pagesize = $this->config->get('mail_pagesize');
if (!$pagesize) {
$pagesize = $this->config->get('pagesize', 50);
}
$storage->set_pagesize($pagesize);
$storage->set_charset($this->config->get('default_charset', RCUBE_CHARSET)); $storage->set_charset($this->config->get('default_charset', RCUBE_CHARSET));
if (isset($_SESSION['mbox'])) { // enable caching of mail data
$storage->set_folder($_SESSION['mbox']); $driver = $this->config->get('storage_driver', 'imap');
$storage_cache = $this->config->get("{$driver}_cache");
$messages_cache = $this->config->get('messages_cache');
// for backward compatybility
if ($storage_cache === null && $messages_cache === null && $this->config->get('enable_caching')) {
$storage_cache = 'db';
$messages_cache = true;
} }
if (isset($_SESSION['page'])) {
$storage->set_page($_SESSION['page']); if ($storage_cache) {
$storage->set_caching($storage_cache);
}
if ($messages_cache) {
$storage->set_messages_caching(true);
} }
} }

@ -24,16 +24,15 @@
$RCMAIL->storage_init(); $RCMAIL->storage_init();
// set imap properties and session vars // set imap properties and session vars
if (strlen(trim($mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true)))) { if (!strlen($mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true))) {
$RCMAIL->storage->set_folder(($_SESSION['mbox'] = $mbox)); $mbox = strlen($_SESSION['mbox']) ? $_SESSION['mbox'] : 'INBOX';
} }
else if ($RCMAIL->storage) { if (!($page = intval($_GET['_page']))) {
$_SESSION['mbox'] = $RCMAIL->storage->get_folder(); $page = $_SESSION['page'] ? $_SESSION['page'] : 1;
} }
if (!empty($_GET['_page'])) { $RCMAIL->storage->set_folder($_SESSION['mbox'] = $mbox);
$RCMAIL->storage->set_page(($_SESSION['page'] = intval($_GET['_page']))); $RCMAIL->storage->set_page($_SESSION['page'] = $page);
}
$a_threading = $RCMAIL->config->get('message_threading', array()); $a_threading = $RCMAIL->config->get('message_threading', array());
$message_sort_col = $RCMAIL->config->get('message_sort_col'); $message_sort_col = $RCMAIL->config->get('message_sort_col');

Loading…
Cancel
Save