]> Kevux Git Server - koopa/commitdiff
Update: 'handle peer authentication failed for user' postgresql as an access denied...
authorKevin Day <thekevinday@gmail.com>
Sat, 3 Feb 2018 22:06:06 +0000 (16:06 -0600)
committerKevin Day <thekevinday@gmail.com>
Sat, 3 Feb 2018 22:06:06 +0000 (16:06 -0600)
common/standard/paths/u/user_login.php

index 5b2124ad1a8cd16c8aba15e45313dabb7c9152ef..08d594b0cc708b371988afb19b68c9f3e2bd8818 100644 (file)
@@ -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.');