From ffa0c3e20cfd12324de62288009aad661e588631 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 3 Feb 2018 16:06:06 -0600 Subject: [PATCH] Update: 'handle peer authentication failed for user' postgresql as an access denied login error --- common/standard/paths/u/user_login.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/standard/paths/u/user_login.php b/common/standard/paths/u/user_login.php index 5b2124a..08d594b 100644 --- a/common/standard/paths/u/user_login.php +++ b/common/standard/paths/u/user_login.php @@ -512,12 +512,16 @@ class c_standard_path_user_login extends c_standard_path { unset($errors); $details = $error->get_details(); + $error_message = $error->get_message(); unset($error); // @todo: not just database errors, but also session create errors need to be checked. if (isset($details['arguments'][':{error_message}'][0]['message']) && is_string($details['arguments'][':{error_message}'][0]['message'])) { $problems[] = c_base_form_problem::s_create_error(NULL, 'Unable to login, ' . $details['arguments'][':{error_message}'][0]['message']); } + else if (preg_match('/Peer authentication failed for user/i', $error_message) > 0) { + $problems[] = c_base_form_problem::s_create_error(NULL, 'Unable to login, access is denied.'); + } else { // here the reason for failure is unknown. $problems[] = c_base_form_problem::s_create_error(NULL, 'Unable to login.'); -- 1.8.3.1