diff options
-rw-r--r-- | apps/files_external/3rdparty/smb4php/smb.php | 10 | ||||
-rw-r--r-- | apps/files_external/lib/streamwrapper.php | 36 | ||||
-rw-r--r-- | apps/files_external/tests/smb.php | 9 | ||||
-rw-r--r-- | core/css/styles.css | 3 | ||||
-rw-r--r-- | version.php | 4 |
5 files changed, 43 insertions, 19 deletions
diff --git a/apps/files_external/3rdparty/smb4php/smb.php b/apps/files_external/3rdparty/smb4php/smb.php index e7d1dfa09fe..e91b0a59581 100644 --- a/apps/files_external/3rdparty/smb4php/smb.php +++ b/apps/files_external/3rdparty/smb4php/smb.php @@ -181,6 +181,8 @@ class smb { return false; }elseif(substr($regs[0],0,31)=='NT_STATUS_OBJECT_PATH_NOT_FOUND'){ return false; + }elseif(substr($regs[0],0,31)=='NT_STATUS_OBJECT_NAME_NOT_FOUND'){ + return false; }elseif(substr($regs[0],0,29)=='NT_STATUS_FILE_IS_A_DIRECTORY'){ return false; } @@ -305,7 +307,8 @@ class smb { trigger_error('rename(): error in URL', E_USER_ERROR); } smb::clearstatcache ($url_from); - return smb::execute ('rename "'.$from['path'].'" "'.$to['path'].'"', $to); + $result = smb::execute ('rename "'.$from['path'].'" "'.$to['path'].'"', $to); + return $result !== false; } function mkdir ($url, $mode, $options) { @@ -430,7 +433,10 @@ class smb_stream_wrapper extends smb { case 'rb': case 'a': case 'a+': $this->tmpfile = tempnam('/tmp', 'smb.down.'); - smb::execute ('get "'.$pu['path'].'" "'.$this->tmpfile.'"', $pu); + $result = smb::execute ('get "'.$pu['path'].'" "'.$this->tmpfile.'"', $pu); + if($result === false){ + return $result; + } break; case 'w': case 'w+': diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php index beb4ec5605f..4a63dfb6e02 100644 --- a/apps/files_external/lib/streamwrapper.php +++ b/apps/files_external/lib/streamwrapper.php @@ -8,7 +8,7 @@ namespace OC\Files\Storage; -abstract class StreamWrapper extends Common{ +abstract class StreamWrapper extends Common { abstract public function constructUrl($path); public function mkdir($path) { @@ -16,7 +16,15 @@ abstract class StreamWrapper extends Common{ } public function rmdir($path) { - if($this->file_exists($path)) { + if ($this->file_exists($path)) { + $dh = $this->opendir($path); + while (($file = readdir($dh)) !== false) { + if ($this->is_dir($path . '/' . $file)) { + $this->rmdir($path . '/' . $file); + } else { + $this->unlink($path . '/' . $file); + } + } $success = rmdir($this->constructUrl($path)); clearstatcache(); return $success; @@ -34,11 +42,11 @@ abstract class StreamWrapper extends Common{ } public function isReadable($path) { - return true;//not properly supported + return true; //not properly supported } public function isUpdatable($path) { - return true;//not properly supported + return true; //not properly supported } public function file_exists($path) { @@ -55,15 +63,19 @@ abstract class StreamWrapper extends Common{ return fopen($this->constructUrl($path), $mode); } - public function touch($path, $mtime=null) { - if(is_null($mtime)) { - $fh = $this->fopen($path, 'a'); - fwrite($fh, ''); - fclose($fh); - - return true; + public function touch($path, $mtime = null) { + if ($this->file_exists($path)) { + if (is_null($mtime)) { + $fh = $this->fopen($path, 'a'); + fwrite($fh, ''); + fclose($fh); + + return true; + } else { + return false; //not supported + } } else { - return false;//not supported + $this->file_put_contents($path, ''); } } diff --git a/apps/files_external/tests/smb.php b/apps/files_external/tests/smb.php index ca2a93c8944..0291f293fa6 100644 --- a/apps/files_external/tests/smb.php +++ b/apps/files_external/tests/smb.php @@ -15,7 +15,7 @@ class SMB extends Storage { public function setUp() { $id = uniqid(); $this->config = include('files_external/tests/config.php'); - if ( ! is_array($this->config) or ! isset($this->config['smb']) or ! $this->config['smb']['run']) { + if (!is_array($this->config) or !isset($this->config['smb']) or !$this->config['smb']['run']) { $this->markTestSkipped('Samba backend not configured'); } $this->config['smb']['root'] .= $id; //make sure we have an new empty folder to work in @@ -28,4 +28,11 @@ class SMB extends Storage { \OCP\Files::rmdirr($this->instance->constructUrl('')); } } + + public function testRenameWithSpaces() { + $this->instance->mkdir('with spaces'); + $result = $this->instance->rename('with spaces', 'foo bar'); + $this->assertTrue($result); + $this->assertTrue($this->instance->is_dir('foo bar')); + } } diff --git a/core/css/styles.css b/core/css/styles.css index 6406bcd7e63..be53b67c858 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -431,7 +431,7 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } padding: 10px; color: #d2322d; background-color: rgba(0,0,0,.3); - text-align: center; + text-align: left; border-radius: 3px; cursor: default; } @@ -466,7 +466,6 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } } #body-login .warning { margin: 0 7px 5px; - font-weight: bold; } #body-login .warning legend { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; diff --git a/version.php b/version.php index b4396d1d2d8..b3e34b5df4b 100644 --- a/version.php +++ b/version.php @@ -1,10 +1,10 @@ <?php // We only can count up. The 4. digit is only for the internal patchlevel to trigger DB upgrades between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel when updating major/minor version number. -$OC_Version=array(5, 80, 8, 1); +$OC_Version=array(6, 00, 0, 0); // The human radable string -$OC_VersionString='6.0 pre alpha'; +$OC_VersionString='6.0 alpha 1'; // The ownCloud edition $OC_Edition=''; |