summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-04-01 19:27:07 +0200
committerAleksander Machniak <alec@alec.pl>2014-04-01 19:27:07 +0200
commitdc0b500e78aae13349b848303302a213ed3a1e65 (patch)
tree29ab0e108edad0456cbbdc3fddfd08fbf8ab7e72 /program/lib/Roundcube/rcube.php
parent0ee63280982734599f83fdc84ccc309fbf3db2c2 (diff)
Removed redundant default_folders config option (#1489737)
Implemented IMAP SPECIAL-USE extension support [RFC6154] (#1487830)
Diffstat (limited to 'program/lib/Roundcube/rcube.php')
-rw-r--r--program/lib/Roundcube/rcube.php33
1 files changed, 30 insertions, 3 deletions
diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php
index 69d95f023..4ff0a00d7 100644
--- a/program/lib/Roundcube/rcube.php
+++ b/program/lib/Roundcube/rcube.php
@@ -420,9 +420,6 @@ class rcube
$storage->set_charset($this->config->get('default_charset', RCUBE_CHARSET));
- if ($default_folders = $this->config->get('default_folders')) {
- $storage->set_default_folders($default_folders);
- }
if (isset($_SESSION['mbox'])) {
$storage->set_folder($_SESSION['mbox']);
}
@@ -433,6 +430,36 @@ class rcube
/**
+ * Set special folders type association.
+ * This must be done AFTER connecting to the server!
+ */
+ protected function set_special_folders()
+ {
+ $storage = $this->get_storage();
+ $folders = $storage->get_special_folders(true);
+ $prefs = array();
+
+ // check SPECIAL-USE flags on IMAP folders
+ foreach ($folders as $type => $folder) {
+ $idx = $type . '_mbox';
+ if ($folder !== $this->config->get($idx)) {
+ $prefs[$idx] = $folder;
+ }
+ }
+
+ // Some special folders differ, update user preferences
+ if (!empty($prefs) && $this->user) {
+ $this->user->save_prefs($prefs);
+ }
+
+ // create default folders (on login)
+ if ($this->config->get('create_default_folders')) {
+ $storage->create_default_folders();
+ }
+ }
+
+
+ /**
* Create session object and start the session.
*/
public function session_init()