summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-11-15 10:03:35 +0100
committerAleksander Machniak <alec@alec.pl>2014-11-15 10:03:35 +0100
commit9f1fd396951dd1bf9a082422d0835ca1a229255d (patch)
tree5e552d4d410224317a2b6b26f7d33763a2dba00f
parent4446aea1e64361065e2cf902ada004546599fd0b (diff)
Fix issue where Archive folder wasn't protected in Folder Manager (#1490154)
-rw-r--r--CHANGELOG1
-rw-r--r--plugins/archive/archive.php16
2 files changed, 9 insertions, 8 deletions
diff --git a/CHANGELOG b/CHANGELOG
index ca80cc3ff..88c9394d7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,7 @@ CHANGELOG Roundcube Webmail
===========================
- Disable TinyMCE contextmenu plugin as there are more cons than pros in using it (#1490118)
+- Fix issue where Archive folder wasn't protected in Folder Manager (#1490154)
- Fix compatibility with PHP 5.2. in rcube_imap_generic (#1490115)
- Fix setting flags on servers with no PERMANENTFLAGS response (#1490087)
- Fix regression in SHAA password generation in ldap driver of password plugin (#1490094)
diff --git a/plugins/archive/archive.php b/plugins/archive/archive.php
index a0fd2efa9..ed0141abb 100644
--- a/plugins/archive/archive.php
+++ b/plugins/archive/archive.php
@@ -17,11 +17,17 @@ class archive extends rcube_plugin
function init()
{
$rcmail = rcmail::get_instance();
+ $archive_folder = $rcmail->config->get('archive_mbox');
+
+ // add archive folder to the list of default mailboxes
+ if (($default_folders = $rcmail->config->get('default_folders')) && !in_array($archive_folder, $default_folders)) {
+ $default_folders[] = $archive_folder;
+ $rcmail->config->set('default_folders', $default_folders);
+ }
// There is no "Archived flags"
// $GLOBALS['IMAP_FLAGS']['ARCHIVED'] = 'Archive';
- if ($rcmail->task == 'mail' && ($rcmail->action == '' || $rcmail->action == 'show')
- && ($archive_folder = $rcmail->config->get('archive_mbox'))) {
+ if ($archive_folder && $rcmail->task == 'mail' && ($rcmail->action == '' || $rcmail->action == 'show')) {
$skin_path = $this->local_skin_path();
if (is_file($this->home . "/$skin_path/archive.css"))
$this->include_stylesheet("$skin_path/archive.css");
@@ -48,12 +54,6 @@ class archive extends rcube_plugin
// set env variables for client
$rcmail->output->set_env('archive_folder', $archive_folder);
$rcmail->output->set_env('archive_type', $rcmail->config->get('archive_type',''));
-
- // add archive folder to the list of default mailboxes
- if (($default_folders = $rcmail->config->get('default_folders')) && !in_array($archive_folder, $default_folders)) {
- $default_folders[] = $archive_folder;
- $rcmail->config->set('default_folders', $default_folders);
- }
}
else if ($rcmail->task == 'mail') {
// handler for ajax request