Skip to content

Commit

Permalink
[Dovecot] mailcowauth minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddleSpl0it authored and DerLinkman committed Feb 8, 2024
1 parent 3725473 commit 3179c0e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions data/conf/dovecot/auth/mailcowauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
}
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;
Expand All @@ -32,8 +31,8 @@
$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;
}

Expand All @@ -48,7 +47,9 @@
$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;

0 comments on commit 3179c0e

Please sign in to comment.