]> source.dussan.org Git - nextcloud-server.git/commitdiff
allow configuring authType for DAV backend 4000/head
authorJörn Friedrich Dreyer <jfd@butonic.de>
Wed, 22 Feb 2017 20:47:49 +0000 (21:47 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 23 Mar 2017 00:13:42 +0000 (18:13 -0600)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
apps/files_external/lib/Lib/Storage/OwnCloud.php
lib/private/Files/Storage/DAV.php

index 4a10844a770de57671123d3bcb0317dcf4da9bf8..427b55a4a54306e34140c670f6ee5328d73408db 100644 (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);
        }
index 76a6155df244a8bc3ef430b72628b2186875a773..73cf137181aae77f9bf7f32ca6aff07894b297fb 100644 (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 !== '') {