*/
namespace OCA\Files_External\Lib\Storage;
+use Sabre\DAV\Client;
/**
* ownCloud backend for external storage based on DAV backend.
$params['host'] = $host;
$params['root'] = $contextPath . self::OC_URL_SUFFIX . $root;
+ $params['authType'] = Client::AUTH_BASIC;
parent::__construct($params);
}
/** @var string */
protected $user;
/** @var string */
+ protected $authType;
+ /** @var string */
protected $host;
/** @var bool */
protected $secure;
$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');
}
$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 !== '') {