summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2012-07-20 23:31:08 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2012-07-20 23:31:08 +0200
commit53bdb049cb3d2b005e5f6d17117f878b74aa0194 (patch)
treeda99038473caff049e0d63ff647bcd0e9a725740
parent0af454a23bed216ffb21c2d0398e79648c688bcb (diff)
downloadnextcloud-server-53bdb049cb3d2b005e5f6d17117f878b74aa0194.tar.gz
nextcloud-server-53bdb049cb3d2b005e5f6d17117f878b74aa0194.zip
adapted to new SabreDav version
-rw-r--r--lib/connector/sabre/client.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/connector/sabre/client.php b/lib/connector/sabre/client.php
index 87f9d59b3ae..7e8f21264f9 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