diff --git a/CHANGELOG b/CHANGELOG
index 1210d259a..80543659b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -11,6 +11,7 @@ CHANGELOG Roundcube Webmail
- Elastic: Improved UX of search dialogs (#6416)
- Elastic: Fix unwanted thread expanding when selecting a collapsed thread in non-mobile mode (#6445)
- Log errors caused by low pcre.backtrack_limit when sending a mail message (#6433)
+- Fix style/navigation on error page depending on authentication state (#6362)
- Fix so invalid smtp_helo_host is never used, fallback to localhost (#6408)
- Fix custom logo size in Elastic (#6424)
- Fix listing the same attachment multiple times on forwarded messages
diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php
index e3cca6e59..35e6b0972 100644
--- a/program/include/rcmail_output_html.php
+++ b/program/include/rcmail_output_html.php
@@ -483,8 +483,26 @@ EOF;
public function reset($all = false)
{
$framed = $this->framed;
+ $task = $this->env['task'];
$env = $all ? null : array_intersect_key($this->env, array('extwin'=>1, 'framed'=>1));
+ // keep jQuery-UI files
+ $css_files = $script_files = array();
+
+ foreach ($this->css_files as $file) {
+ if (strpos($file, 'plugins/jqueryui') === 0) {
+ $css_files[] = $file;
+ }
+ }
+
+ foreach ($this->script_files as $position => $files) {
+ foreach ($files as $file) {
+ if (strpos($file, 'plugins/jqueryui') === 0) {
+ $script_files[$position][] = $file;
+ }
+ }
+ }
+
parent::reset();
// let some env variables survive
@@ -492,16 +510,23 @@ EOF;
$this->framed = $framed || $this->env['framed'];
$this->js_labels = array();
$this->js_commands = array();
- $this->script_files = array();
$this->scripts = array();
$this->header = '';
$this->footer = '';
$this->body = '';
+ $this->css_files = array();
+ $this->script_files = array();
// load defaults
if (!$all) {
$this->__construct();
}
+
+ // Note: we merge jQuery-UI scripts after jQuery...
+ $this->css_files = array_merge($this->css_files, $css_files);
+ $this->script_files = array_merge_recursive($this->script_files, $script_files);
+
+ $this->set_env('orig_task', $task);
}
/**
@@ -573,7 +598,8 @@ EOF;
// if all js commands go to parent window we can ignore all
// script files and skip rcube_webmail initialization (#1489792)
- if ($framed) {
+ // but not on error pages where skins may need jQuery, etc.
+ if ($framed && empty($this->js_env['server_error'])) {
$this->scripts = array();
$this->script_files = array();
$this->header = '';
@@ -1651,9 +1677,9 @@ EOF;
* @param string $file File URL
* @param string $position Target position [head|foot]
*/
- public function include_script($file, $position='head')
+ public function include_script($file, $position = 'head', $add_path = true)
{
- if (!preg_match('|^https?://|i', $file) && $file[0] != '/') {
+ if ($add_path && !preg_match('|^https?://|i', $file) && $file[0] != '/') {
$file = $this->file_mod($this->scripts_path . $file);
}
diff --git a/program/js/app.js b/program/js/app.js
index 20b278d78..2f0c3625f 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1526,7 +1526,7 @@ function rcube_webmail()
if (task == 'mail')
url += '&_mbox=INBOX';
- else if (task == 'logout' && !this.env.server_error) {
+ else if (task == 'logout') {
url = this.secure_url(url);
this.clear_compose_data();
}
diff --git a/program/lib/Roundcube/rcube_plugin_api.php b/program/lib/Roundcube/rcube_plugin_api.php
index eb79f3e0d..ddf94bdfa 100644
--- a/program/lib/Roundcube/rcube_plugin_api.php
+++ b/program/lib/Roundcube/rcube_plugin_api.php
@@ -596,8 +596,7 @@ class rcube_plugin_api
{
if (is_object($this->output) && $this->output->type == 'html') {
$src = $this->resource_url($fn);
- $this->output->add_header(html::tag('script',
- array('type' => "text/javascript", 'src' => $src)));
+ $this->output->include_script($src, 'head', false);
}
}
diff --git a/program/steps/utils/error.inc b/program/steps/utils/error.inc
index aefb91bab..af075173b 100644
--- a/program/steps/utils/error.inc
+++ b/program/steps/utils/error.inc
@@ -127,6 +127,7 @@ EOF;
if ($rcmail->output && $rcmail->output->template_exists('error')) {
$rcmail->output->reset();
+ $rcmail->output->set_env('error_task', 'error' . (empty($rcmail->user) || empty($rcmail->user->ID) ? '-login' : ''));
$rcmail->output->set_env('server_error', $ERROR_CODE);
$rcmail->output->set_env('comm_path', $rcmail->comm_path);
$rcmail->output->send('error');
diff --git a/skins/elastic/styles/styles.less b/skins/elastic/styles/styles.less
index 3f79775c7..2316db40a 100644
--- a/skins/elastic/styles/styles.less
+++ b/skins/elastic/styles/styles.less
@@ -182,6 +182,12 @@ a {
}
}
+body.task-error-login #layout {
+ & > .menu,
+ & > .content > .header {
+ display: none;
+ }
+}
/*** Addressbook UI ***/
diff --git a/skins/elastic/templates/error.html b/skins/elastic/templates/error.html
index 3f8663496..0ae156091 100644
--- a/skins/elastic/templates/error.html
+++ b/skins/elastic/templates/error.html
@@ -3,8 +3,9 @@