public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
[Dovecot] mailcowauth minor fixes
3179c0e7
data/conf/dovecot/auth/mailcowauth.php | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
Diff
diff --git a/data/conf/dovecot/auth/mailcowauth.php b/data/conf/dovecot/auth/mailcowauth.php
index fa505d70..0adb5d45 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;