From 3179c0e712258b8a9e2149b78aa9a31d5d35ca1a Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Thu, 6 Jul 2023 16:00:26 +0200 Subject: [PATCH] [Dovecot] mailcowauth minor fixes --- data/conf/dovecot/auth/mailcowauth.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/data/conf/dovecot/auth/mailcowauth.php b/data/conf/dovecot/auth/mailcowauth.php index fa505d709..0adb5d45a 100644 --- a/data/conf/dovecot/auth/mailcowauth.php +++ b/data/conf/dovecot/auth/mailcowauth.php @@ -18,7 +18,6 @@ if (file_exists('../../../web/inc/vars.local.inc.php')) { } require_once '../../../web/inc/lib/vendor/autoload.php'; -// Do not show errors, we log to using error_log ini_set('error_reporting', 0); // Init database //$dsn = $database_type . ':host=' . $database_host . ';dbname=' . $database_name; @@ -32,8 +31,8 @@ try { $pdo = new PDO($dsn, $database_user, $database_pass, $opt); } catch (PDOException $e) { - error_log("MAILCOWAUTH: " . $e . PHP_EOL); - http_response_code(501); + $return = array("success" => false, "role" => ''); + echo json_encode($return); exit; } @@ -48,7 +47,9 @@ $iam_provider = identity_provider('init'); $result = check_login($post['username'], $post['password'], $post['protocol'], true); if ($result) { $return = array("success" => true, "role" => $result); +} else { + $return = array("success" => false, "role" => ''); } echo json_encode($return); -exit(); +exit;