allow configuring authType for DAV backend

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Jörn Friedrich Dreyer 2017-02-22 21:47:49 +01:00 committed by Morris Jobke
parent d551b8e6fd
commit 9eca1da1dd
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
2 changed files with 12 additions and 2 deletions

View File

@ -23,6 +23,7 @@
*/
namespace OCA\Files_External\Lib\Storage;
use Sabre\DAV\Client;
/**
* ownCloud backend for external storage based on DAV backend.
@ -69,6 +70,7 @@ class OwnCloud extends \OC\Files\Storage\DAV{
$params['host'] = $host;
$params['root'] = $contextPath . self::OC_URL_SUFFIX . $root;
$params['authType'] = Client::AUTH_BASIC;
parent::__construct($params);
}

View File

@ -64,6 +64,8 @@ class DAV extends Common {
/** @var string */
protected $user;
/** @var string */
protected $authType;
/** @var string */
protected $host;
/** @var bool */
protected $secure;
@ -95,6 +97,9 @@ class DAV extends Common {
$this->host = $host;
$this->user = $params['user'];
$this->password = $params['password'];
if (isset($params['authType'])) {
$this->authType = $params['authType'];
}
if (isset($params['secure'])) {
if (is_string($params['secure'])) {
$this->secure = ($params['secure'] === 'true');
@ -133,11 +138,14 @@ class DAV extends Common {
}
$this->ready = true;
$settings = array(
$settings = [
'baseUri' => $this->createBaseUri(),
'userName' => $this->user,
'password' => $this->password,
);
];
if (isset($this->authType)) {
$settings['authType'] = $this->authType;
}
$proxy = \OC::$server->getConfig()->getSystemValue('proxy', '');
if($proxy !== '') {