summaryrefslogtreecommitdiff
path: root/plugins
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 /plugins
parent4446aea1e64361065e2cf902ada004546599fd0b (diff)
Fix issue where Archive folder wasn't protected in Folder Manager (#1490154)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/archive/archive.php16
1 files changed, 8 insertions, 8 deletions
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