Report when user credentials are not set for #653 and #680

This commit is contained in:
the-djmaze 2022-11-17 11:40:37 +01:00
parent 30577b677a
commit 8cf5bd9c0a

View file

@ -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;