summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/smb.php
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-02-11 20:27:05 -0500
committerMichael Gapczynski <mtgap@owncloud.com>2013-02-11 20:27:05 -0500
commit6eba790a75ba128e3182771a30dbe88733ee0dfc (patch)
treeba313bec694c64928d82e2b76445d6307a305b22 /apps/files_external/lib/smb.php
parent6f08b1f829e9d4c49f66b19fdda8c229bc8ae3f3 (diff)
parent04bf8c1b66d6adef0466efae00c32745465767f2 (diff)
downloadnextcloud-server-6eba790a75ba128e3182771a30dbe88733ee0dfc.tar.gz
nextcloud-server-6eba790a75ba128e3182771a30dbe88733ee0dfc.zip
Merge branch 'master' into external_storage_ui_feedback
Conflicts: apps/files_external/js/dropbox.js apps/files_external/js/google.js apps/files_external/js/settings.js apps/files_external/lib/amazons3.php apps/files_external/lib/dropbox.php apps/files_external/lib/google.php apps/files_external/lib/smb.php apps/files_external/lib/swift.php apps/files_external/lib/webdav.php lib/filestorage.php
Diffstat (limited to 'apps/files_external/lib/smb.php')
-rw-r--r--apps/files_external/lib/smb.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index 5b73e993e4f..cea5de36817 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -6,9 +6,11 @@
* See the COPYING-README file.
*/
+namespace OC\Files\Storage;
+
require_once 'smb4php/smb.php';
-class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
+class SMB extends \OC\Files\Storage\StreamWrapper{
private $password;
private $user;
private $host;
@@ -34,14 +36,13 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
if (substr($this->share, -1, 1)=='/') {
$this->share=substr($this->share, 0, -1);
}
- //create the root folder if necesary
- if ( ! $this->is_dir('')) {
- $this->mkdir('');
- }
} else {
- throw new Exception();
+ throw new \Exception();
}
-
+ }
+
+ public function getId(){
+ return 'smb::' . $this->user . '@' . $this->host . '/' . $this->share . '/' . $this->root;
}
public function constructUrl($path) {
@@ -69,11 +70,13 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
/**
* check if a file or folder has been updated since $time
+ * @param string $path
* @param int $time
* @return bool
*/
- public function hasUpdated($path, $time) {
- if ( ! $path and $this->root=='/') {
+ public function hasUpdated($path,$time) {
+ $this->init();
+ if(!$path and $this->root=='/') {
// mtime doesn't work for shares, but giving the nature of the backend,
// doing a full update is still just fast enough
return true;