Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/roundcube/roundcubemail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2020-12-18 20:17:01 +0300
committerAleksander Machniak <alec@alec.pl>2020-12-18 20:17:01 +0300
commitdcfd12e98aa526940c3280297c6a942a0da9c8c7 (patch)
treef2019aa65405d8aac664fe00b64d07c3e8ec9eec /index.php
parent84949fbb4e6c139f41d759364dd40728c386ee97 (diff)
CS fixes, potential PHP8 warning (#7781)
Diffstat (limited to 'index.php')
-rw-r--r--index.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/index.php b/index.php
index 4dd1ebaa0..c3795e203 100644
--- a/index.php
+++ b/index.php
@@ -111,6 +111,7 @@ if ($RCMAIL->task == 'login' && $RCMAIL->action == 'login') {
'user' => trim(rcube_utils::get_input_value('_user', rcube_utils::INPUT_POST)),
'pass' => rcube_utils::get_input_value('_pass', rcube_utils::INPUT_POST, true, $pass_charset),
'valid' => $request_valid,
+ 'error' => null,
'cookiecheck' => true,
]);
@@ -168,7 +169,12 @@ if ($RCMAIL->task == 'login' && $RCMAIL->action == 'login') {
rcmail::ERROR_RATE_LIMIT => 'accountlocked',
];
- $error_message = !empty($auth['error']) && !is_numeric($auth['error']) ? $auth['error'] : ($error_labels[$error_code] ?: 'loginfailed');
+ if (!empty($auth['error']) && !is_numeric($auth['error'])) {
+ $error_message = $auth['error'];
+ }
+ else {
+ $error_message = !empty($error_labels[$error_code]) ? $error_labels[$error_code] : 'loginfailed';
+ }
$RCMAIL->output->show_message($error_message, 'warning');
@@ -176,7 +182,10 @@ if ($RCMAIL->task == 'login' && $RCMAIL->action == 'login') {
$RCMAIL->log_login($auth['user'], true, $error_code);
$RCMAIL->plugins->exec_hook('login_failed', [
- 'code' => $error_code, 'host' => $auth['host'], 'user' => $auth['user']]);
+ 'code' => $error_code,
+ 'host' => $auth['host'],
+ 'user' => $auth['user'],
+ ]);
if (!isset($_SESSION['user_id'])) {
$RCMAIL->kill_session();