From 8cf5bd9c0a44dbf56dfe4c37ebda3682b623acbb Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Thu, 17 Nov 2022 11:40:37 +0100 Subject: [PATCH] Report when user credentials are not set for #653 and #680 --- snappymail/v/0.0.0/app/libraries/snappymail/dav/client.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/dav/client.php b/snappymail/v/0.0.0/app/libraries/snappymail/dav/client.php index c51aa6061..7e19a4510 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/dav/client.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/dav/client.php @@ -38,7 +38,11 @@ class Client $this->HTTP = \SnappyMail\HTTP\Request::factory(/*'socket'*/); $this->HTTP->proxy = $settings['proxy'] ?? null; - $this->HTTP->setAuth(3, $settings['userName'] ?? '', $settings['password'] ?? ''); + if (!empty($settings['userName']) && !empty($settings['password'])) { + $this->HTTP->setAuth(3, $settings['userName'], $settings['password']); + } else { + \SnappyMail\Log::warning('DAV', 'No user credentials set'); + } $this->HTTP->max_response_kb = 0; $this->HTTP->timeout = 15; // timeout in seconds. $this->HTTP->max_redirects = 0;