From e18abd3962a41a69b0aeed146192948261f8e070 Mon Sep 17 00:00:00 2001 From: int2001 Date: Sat, 27 Sep 2025 10:41:13 +0000 Subject: [PATCH] Set custom header (which can be processed by reverse proxy) --- application/controllers/User.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/application/controllers/User.php b/application/controllers/User.php index 4d79426ba..8daa94c78 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -1109,6 +1109,8 @@ class User extends CI_Controller { if ($user->clubstation == 1) { log_message('debug', "User ID: [$uid] Login rejected because of a external clubstation login attempt with a modified cookie. Attack?"); $this->session->set_flashdata('error', __("This is not allowed!")); + $this->output->set_header('X-Login-Status: failed'); + $this->output->_display(); redirect('user/login'); } @@ -1144,6 +1146,8 @@ class User extends CI_Controller { $this->input->set_cookie('keep_login', '', -3600, ''); $this->input->set_cookie('re_login', '', -3600, ''); $this->session->set_flashdata('error', __("Login failed. Try again.")); + $this->set_header('X-Login-Status: failed'); + $this->output->_display(); redirect('user/login'); } } catch (Exception $e) { @@ -1153,8 +1157,9 @@ class User extends CI_Controller { // Delete keep_login cookie $this->input->set_cookie('keep_login', '', -3600, ''); $this->input->set_cookie('re_login', '', -3600, ''); - + $this->set_header('X-Login-Status: failed'); $this->session->set_flashdata('error', __("Login failed. Try again.")); + $this->output->_display(); redirect('user/login'); } @@ -1210,6 +1215,8 @@ class User extends CI_Controller { redirect('user/login'); } else { $this->session->set_flashdata('error', __("Incorrect username or password!")); + $this->output->set_header('X-Login-Status: failed'); + $this->output->_display(); redirect('user/login'); } }