Set up logger instance in base constructor. Fixes #270
Signed-off-by: Holger Schletz <holger.schletz@web.de>
This commit is contained in:
@@ -27,14 +27,14 @@ class WebDavAuth extends Base {
|
||||
public function checkPassword($uid, $password) {
|
||||
$arr = explode('://', $this->webDavAuthUrl, 2);
|
||||
if (! isset($arr) or count($arr) !== 2) {
|
||||
\OC::$server->getLogger()->error('ERROR: Invalid WebdavUrl: "'.$this->webDavAuthUrl.'" ', ['app' => 'user_external']);
|
||||
$this->logger->error('ERROR: Invalid WebdavUrl: "'.$this->webDavAuthUrl.'" ', ['app' => 'user_external']);
|
||||
return false;
|
||||
}
|
||||
list($protocol, $path) = $arr;
|
||||
$url = $protocol.'://'.urlencode($uid).':'.urlencode($password).'@'.$path;
|
||||
$headers = get_headers($url);
|
||||
if ($headers === false) {
|
||||
\OC::$server->getLogger()->error('ERROR: Not possible to connect to WebDAV Url: "'.$protocol.'://'.$path.'" ', ['app' => 'user_external']);
|
||||
$this->logger->error('ERROR: Not possible to connect to WebDAV Url: "'.$protocol.'://'.$path.'" ', ['app' => 'user_external']);
|
||||
return false;
|
||||
}
|
||||
$returnCode = substr($headers[0], 9, 3);
|
||||
|
||||
Reference in New Issue
Block a user