diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-08-18 11:34:56 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-08-18 11:34:56 +0200 |
commit | d8c71ba734d95e954d4ff3af50a44b94f9f016ff (patch) | |
tree | c89cd494a618e621f9c8941bac52bfed15dbad4c /apps/files_external/lib | |
parent | 5c9aedac1b9e858e450ac0b1f009d8042206060b (diff) | |
parent | 12f4494de02457d51004ca6a82c1b2160189819f (diff) | |
download | nextcloud-server-d8c71ba734d95e954d4ff3af50a44b94f9f016ff.tar.gz nextcloud-server-d8c71ba734d95e954d4ff3af50a44b94f9f016ff.zip |
merge master in storage-wrapper-quota
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r-- | apps/files_external/lib/amazons3.php | 29 | ||||
-rwxr-xr-x | apps/files_external/lib/config.php | 26 | ||||
-rw-r--r-- | apps/files_external/lib/webdav.php | 1 |
3 files changed, 46 insertions, 10 deletions
diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index f2dd6108b1a..f4d1940b184 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -33,10 +33,25 @@ use Aws\S3\Exception\S3Exception; class AmazonS3 extends \OC\Files\Storage\Common { + /** + * @var \Aws\S3\S3Client + */ private $connection; + /** + * @var string + */ private $bucket; + /** + * @var array + */ private static $tmpFiles = array(); + /** + * @var bool + */ private $test = false; + /** + * @var int + */ private $timeout = 15; private function normalizePath($path) { @@ -96,6 +111,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { )); $this->testTimeout(); } catch (S3Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); throw new \Exception("Creation of bucket failed."); } } @@ -129,6 +145,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { )); $this->testTimeout(); } catch (S3Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } @@ -150,6 +167,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { $path ); } catch (S3Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } @@ -184,6 +202,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { )); $this->testTimeout(); } catch (S3Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } @@ -221,6 +240,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { return opendir('fakedir://amazons3' . $path); } catch (S3Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } } @@ -249,6 +269,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { return $stat; } catch(S3Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } } @@ -269,6 +290,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { return 'dir'; } } catch (S3Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } @@ -293,6 +315,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { )); $this->testTimeout(); } catch (S3Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } @@ -315,6 +338,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { 'SaveAs' => $tmpFile )); } catch (S3Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } @@ -361,6 +385,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { 'Key' => $path )); } catch (S3Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } @@ -398,6 +423,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { $this->testTimeout(); } } catch (S3Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } @@ -417,6 +443,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { )); $this->testTimeout(); } catch (S3Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } } else { @@ -432,6 +459,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { )); $this->testTimeout(); } catch (S3Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } @@ -514,6 +542,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { unlink($tmpFile); } catch (S3Exception $e) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; } } diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index e3a2cf0b30b..14e974d65ca 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -93,14 +93,18 @@ class OC_Mount_Config { 'root' => '&Root', 'secure' => '!Secure ftps://')); - if(OC_Mount_Config::checksmbclient()) $backends['\OC\Files\Storage\SMB']=array( - 'backend' => 'SMB / CIFS', - 'configuration' => array( - 'host' => 'URL', - 'user' => 'Username', - 'password' => '*Password', - 'share' => 'Share', - 'root' => '&Root')); + if (!OC_Util::runningOnWindows()) { + if (OC_Mount_Config::checksmbclient()) { + $backends['\OC\Files\Storage\SMB'] = array( + 'backend' => 'SMB / CIFS', + 'configuration' => array( + 'host' => 'URL', + 'user' => 'Username', + 'password' => '*Password', + 'share' => 'Share', + 'root' => '&Root')); + } + } if(OC_Mount_Config::checkcurl()) $backends['\OC\Files\Storage\DAV']=array( 'backend' => 'ownCloud / WebDAV', @@ -444,8 +448,10 @@ class OC_Mount_Config { public static function checkDependencies() { $l= new OC_L10N('files_external'); $txt=''; - if(!OC_Mount_Config::checksmbclient()) { - $txt.=$l->t('<b>Warning:</b> "smbclient" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it.').'<br />'; + if (!OC_Util::runningOnWindows()) { + if(!OC_Mount_Config::checksmbclient()) { + $txt.=$l->t('<b>Warning:</b> "smbclient" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it.').'<br />'; + } } if(!OC_Mount_Config::checkphpftp()) { $txt.=$l->t('<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it.').'<br />'; diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php index 57ff3707d36..0ef7646ace7 100644 --- a/apps/files_external/lib/webdav.php +++ b/apps/files_external/lib/webdav.php @@ -173,6 +173,7 @@ class DAV extends \OC\Files\Storage\Common{ curl_setopt($curl, CURLOPT_USERPWD, $this->user.':'.$this->password); curl_setopt($curl, CURLOPT_URL, $this->createBaseUri().$path); curl_setopt($curl, CURLOPT_FILE, $fp); + curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_exec ($curl); curl_close ($curl); |