From a9f51ced216337fbff83d4e42d5c90aa4f577bb4 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 28 Nov 2021 08:39:12 +0100 Subject: [PATCH] CS fixes, update changelog --- CHANGELOG.md | 1 + program/include/rcmail_output_html.php | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48b4a2963..2bbf4e4db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - Improve auto-wrapping of plain text messages on preview and reply, don't wrap non-format=flowed content (#6974) - Improve searching by sender/recipient headers, support Reply-To and Followup-To (#6582) - Add option to control links handling behavior on html to text conversion (#6485) +- Add 'loginform_content' plugin hook (#8273, #6569) - SMTP: If requested use TLS also without authentication (#4590, #8111) - Display a generic error page on initial DB/configuration errors (#8222) - Display telephone numbers as tel: links (#8240) diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php index 107a84200..7453f8361 100644 --- a/program/include/rcmail_output_html.php +++ b/program/include/rcmail_output_html.php @@ -2375,8 +2375,8 @@ EOF; } } else if (is_array($default_host) && ($host = key($default_host)) !== null) { - $input_host = new html_hiddenfield([ - 'name' => '_host', 'id' => 'rcmloginhost', 'value' => is_numeric($host) ? $default_host[$host] : $host] + $attrib); + $val = is_numeric($host) ? $default_host[$host] : $host; + $input_host = new html_hiddenfield(['name' => '_host', 'id' => 'rcmloginhost', 'value' => $val] + $attrib); $form_content['hidden']['host'] = $input_host->show(); $input_host = null; @@ -2396,7 +2396,9 @@ EOF; if (rcube_utils::get_boolean($attrib['submit'])) { $button_attr = ['type' => 'submit', 'id' => 'rcmloginsubmit', 'class' => 'button mainaction submit']; - $form_content['buttons']['submit'] = ['outterclass' => 'formbuttons', 'content' => html::tag('button', $button_attr, $this->app->gettext('login'))]; + $button = html::tag('button', $button_attr, $this->app->gettext('login')); + + $form_content['buttons']['submit'] = ['outterclass' => 'formbuttons', 'content' => $button]; } // add oauth login button @@ -2408,8 +2410,15 @@ EOF; $form_content['buttons'] = []; } - $link_attr = ['href' => $this->app->url(['action' => 'oauth']), 'id' => 'rcmloginoauth', 'class' => 'button oauth ' . $this->config->get('oauth_provider')]; - $button = html::a($link_attr, $this->app->gettext(['name' => 'oauthlogin', 'vars' => ['provider' => $this->config->get('oauth_provider_name', 'OAuth')]])); + $link_attr = [ + 'href' => $this->app->url(['action' => 'oauth']), + 'id' => 'rcmloginoauth', + 'class' => 'button oauth ' . $this->config->get('oauth_provider') + ]; + + $provider = $this->config->get('oauth_provider_name', 'OAuth'); + $button = html::a($link_attr, $this->app->gettext(['name' => 'oauthlogin', 'vars' => ['provider' => $provider]])); + $form_content['buttons']['oauthlogin'] = ['outterclass' => 'oauthlogin', 'content' => $button]; }