From c0abb76adff03a0461d80a2880521ab622075dcd Mon Sep 17 00:00:00 2001 From: Mischa Siekmann Date: Tue, 20 Aug 2019 20:28:21 +0200 Subject: [PATCH 1/2] added logging of errrors for imap login Signed-off-by: Mischa Siekmann --- lib/imap.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/imap.php b/lib/imap.php index 9d05b73..9f4d3e5 100644 --- a/lib/imap.php +++ b/lib/imap.php @@ -72,6 +72,10 @@ public function checkPassword($uid, $password) { $uid = $pieces[0]; } } else { + OC::$server->getLogger()->error( + 'ERROR: Wrong domain: '.$this->domain, + ['app' => 'user_external'] + ); return false; } } else { @@ -101,7 +105,13 @@ public function checkPassword($uid, $password) { $uid = mb_strtolower($uid); $this->storeUser($uid, $groups); return $uid; + } else { + OC::$server->getLogger()->error( + 'ERROR: Could not connect via roundcube lib: '.$rcube->error, + ['app' => 'user_external'] + ); } + return false; } } From 1883b0c0830d680edc22c32c45f3dc86db45ea30 Mon Sep 17 00:00:00 2001 From: Mischa Siekmann Date: Fri, 23 Aug 2019 13:15:12 +0200 Subject: [PATCH 2/2] Corrected indentation and changed to a more specific error message. Signed-off-by: Mischa Siekmann --- lib/imap.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/imap.php b/lib/imap.php index 9f4d3e5..ac9e8ce 100644 --- a/lib/imap.php +++ b/lib/imap.php @@ -73,9 +73,9 @@ public function checkPassword($uid, $password) { } } else { OC::$server->getLogger()->error( - 'ERROR: Wrong domain: '.$this->domain, - ['app' => 'user_external'] - ); + 'ERROR: User has a wrong domain! Expecting: '.$this->domain, + ['app' => 'user_external'] + ); return false; } } else {