From 53bdb049cb3d2b005e5f6d17117f878b74aa0194 Mon Sep 17 00:00:00 2001
From: Bjoern Schiessle <schiessle@owncloud.com>
Date: Fri, 20 Jul 2012 23:31:08 +0200
Subject: [PATCH] adapted to new SabreDav version

---
 lib/connector/sabre/client.php | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/lib/connector/sabre/client.php b/lib/connector/sabre/client.php
index 87f9d59b3a..7e8f21264f 100644
--- a/lib/connector/sabre/client.php
+++ b/lib/connector/sabre/client.php
@@ -68,18 +68,13 @@ class OC_Connector_Sabre_Client extends Sabre_DAV_Client {
 				// Automatically follow redirects
 				CURLOPT_FOLLOWLOCATION => true,
 				CURLOPT_MAXREDIRS => 5,
-				CURLOPT_SSL_VERIFYPEER => true,
-				//CURLOPT_SSL_VERIFYPEER	=> false,
 		);
-		
+	
 		if($this->trustedCertificates) {
 			$curlSettings[CURLOPT_CAINFO] = $this->trustedCertificates;
 		}
-	
+		
 		switch ($method) {
-			case 'PUT':
-				$curlSettings[CURLOPT_PUT] = true;
-				break;
 			case 'HEAD' :
 	
 				// do not read body with HEAD requests (this is neccessary because cURL does not ignore the body with HEAD
@@ -110,8 +105,15 @@ class OC_Connector_Sabre_Client extends Sabre_DAV_Client {
 			$curlSettings[CURLOPT_PROXY] = $this->proxy;
 		}
 	
-		if ($this->userName) {
-			$curlSettings[CURLOPT_HTTPAUTH] = CURLAUTH_BASIC | CURLAUTH_DIGEST;
+		if ($this->userName && $this->authType) {
+			$curlType = 0;
+			if ($this->authType & self::AUTH_BASIC) {
+				$curlType |= CURLAUTH_BASIC;
+			}
+			if ($this->authType & self::AUTH_DIGEST) {
+				$curlType |= CURLAUTH_DIGEST;
+			}
+			$curlSettings[CURLOPT_HTTPAUTH] = $curlType;
 			$curlSettings[CURLOPT_USERPWD] = $this->userName . ':' . $this->password;
 		}
 	
@@ -167,5 +169,5 @@ class OC_Connector_Sabre_Client extends Sabre_DAV_Client {
 	
 		return $response;
 	
-	}
+	}	
 }
\ No newline at end of file
-- 
GitLab