Skip to content

Commit

Permalink
Merge pull request #32 from nextcloud/revert-25-downstream-160608
Browse files Browse the repository at this point in the history
Revert "Downstream 2016-06-08"
  • Loading branch information
blizzz committed Jun 9, 2016
2 parents b688aac + 51fd260 commit 2819373
Show file tree
Hide file tree
Showing 57 changed files with 171 additions and 743 deletions.
2 changes: 0 additions & 2 deletions apps/dav/lib/Connector/Sabre/Directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ public function getChild($name, $info = null) {
throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage());
} catch (\OCP\Files\InvalidPathException $ex) {
throw new InvalidPath($ex->getMessage());
} catch (ForbiddenException $e) {
throw new \Sabre\DAV\Exception\Forbidden();
}
}

Expand Down
9 changes: 5 additions & 4 deletions apps/dav/lib/Connector/Sabre/FilesPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,20 @@ public function initialize(\Sabre\DAV\Server $server) {
*/
function checkMove($source, $destination) {
$sourceNode = $this->tree->getNodeForPath($source);
if (!$sourceNode instanceof Node) {
if ($sourceNode instanceof FutureFile) {
return;
}
list($sourceDir,) = \Sabre\HTTP\URLUtil::splitPath($source);
list($destinationDir,) = \Sabre\HTTP\URLUtil::splitPath($destination);

if ($sourceDir !== $destinationDir) {
$sourceNodeFileInfo = $sourceNode->getFileInfo();
if (is_null($sourceNodeFileInfo)) {
$sourceFileInfo = $this->fileView->getFileInfo($source);

if ($sourceFileInfo === false) {
throw new NotFound($source . ' does not exist');
}

if (!$sourceNodeFileInfo->isDeletable()) {
if (!$sourceFileInfo->isDeletable()) {
throw new Forbidden($source . " cannot be deleted");
}
}
Expand Down
4 changes: 0 additions & 4 deletions apps/dav/lib/Connector/Sabre/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,4 @@ public function releaseLock($type) {
public function changeLock($type) {
$this->fileView->changeLock($this->path, $type);
}

public function getFileInfo() {
return $this->info;
}
}
2 changes: 0 additions & 2 deletions apps/dav/lib/Connector/Sabre/ObjectTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ public function getNodeForPath($path) {
throw new \Sabre\DAV\Exception\NotFound('Storage ' . $path . ' is invalid');
} catch (LockedException $e) {
throw new \Sabre\DAV\Exception\Locked();
} catch (ForbiddenException $e) {
throw new \Sabre\DAV\Exception\Forbidden();
}
}

Expand Down
60 changes: 22 additions & 38 deletions apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/
namespace OCA\DAV\Tests\unit\Connector\Sabre;

use OCA\DAV\Connector\Sabre\FilesPlugin;
use OCP\Files\StorageNotAvailableException;
use Sabre\DAV\PropFind;
use Sabre\DAV\PropPatch;
Expand All @@ -37,16 +36,16 @@
* See the COPYING-README file.
*/
class FilesPluginTest extends TestCase {
const GETETAG_PROPERTYNAME = FilesPlugin::GETETAG_PROPERTYNAME;
const FILEID_PROPERTYNAME = FilesPlugin::FILEID_PROPERTYNAME;
const INTERNAL_FILEID_PROPERTYNAME = FilesPlugin::INTERNAL_FILEID_PROPERTYNAME;
const SIZE_PROPERTYNAME = FilesPlugin::SIZE_PROPERTYNAME;
const PERMISSIONS_PROPERTYNAME = FilesPlugin::PERMISSIONS_PROPERTYNAME;
const LASTMODIFIED_PROPERTYNAME = FilesPlugin::LASTMODIFIED_PROPERTYNAME;
const DOWNLOADURL_PROPERTYNAME = FilesPlugin::DOWNLOADURL_PROPERTYNAME;
const OWNER_ID_PROPERTYNAME = FilesPlugin::OWNER_ID_PROPERTYNAME;
const OWNER_DISPLAY_NAME_PROPERTYNAME = FilesPlugin::OWNER_DISPLAY_NAME_PROPERTYNAME;
const DATA_FINGERPRINT_PROPERTYNAME = FilesPlugin::DATA_FINGERPRINT_PROPERTYNAME;
const GETETAG_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::GETETAG_PROPERTYNAME;
const FILEID_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::FILEID_PROPERTYNAME;
const INTERNAL_FILEID_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::INTERNAL_FILEID_PROPERTYNAME;
const SIZE_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::SIZE_PROPERTYNAME;
const PERMISSIONS_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::PERMISSIONS_PROPERTYNAME;
const LASTMODIFIED_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::LASTMODIFIED_PROPERTYNAME;
const DOWNLOADURL_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::DOWNLOADURL_PROPERTYNAME;
const OWNER_ID_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::OWNER_ID_PROPERTYNAME;
const OWNER_DISPLAY_NAME_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::OWNER_DISPLAY_NAME_PROPERTYNAME;
const DATA_FINGERPRINT_PROPERTYNAME = \OCA\DAV\Connector\Sabre\FilesPlugin::DATA_FINGERPRINT_PROPERTYNAME;

/**
* @var \Sabre\DAV\Server | \PHPUnit_Framework_MockObject_MockObject
Expand All @@ -59,7 +58,7 @@ class FilesPluginTest extends TestCase {
private $tree;

/**
* @var FilesPlugin
* @var \OCA\DAV\Connector\Sabre\FilesPlugin
*/
private $plugin;

Expand All @@ -85,11 +84,11 @@ public function setUp() {
->disableOriginalConstructor()
->getMock();
$this->config = $this->getMock('\OCP\IConfig');
$this->config->expects($this->any())->method('getSystemValue')
$this->config->method('getSystemValue')
->with($this->equalTo('data-fingerprint'), $this->equalTo(''))
->willReturn('my_fingerprint');

$this->plugin = new FilesPlugin(
$this->plugin = new \OCA\DAV\Connector\Sabre\FilesPlugin(
$this->tree,
$this->view,
$this->config
Expand Down Expand Up @@ -264,7 +263,7 @@ public function testGetPropertiesStorageNotAvailable() {
}

public function testGetPublicPermissions() {
$this->plugin = new FilesPlugin(
$this->plugin = new \OCA\DAV\Connector\Sabre\FilesPlugin(
$this->tree,
$this->view,
$this->config,
Expand Down Expand Up @@ -332,7 +331,7 @@ public function testGetPropertiesForRootDirectory() {
$node = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Directory')
->disableOriginalConstructor()
->getMock();
$node->expects($this->any())->method('getPath')->willReturn('/');
$node->method('getPath')->willReturn('/');

$propFind = new PropFind(
'/',
Expand Down Expand Up @@ -433,16 +432,11 @@ public function testMoveSrcNotDeletable() {
->method('isDeletable')
->willReturn(false);

$node = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Node')
->disableOriginalConstructor()
->getMock();
$node->expects($this->once())
$this->view->expects($this->once())
->method('getFileInfo')
->with('FolderA/test.txt')
->willReturn($fileInfoFolderATestTXT);

$this->tree->expects($this->once())->method('getNodeForPath')
->willReturn($node);

$this->plugin->checkMove('FolderA/test.txt', 'test.txt');
}

Expand All @@ -454,16 +448,11 @@ public function testMoveSrcDeletable() {
->method('isDeletable')
->willReturn(true);

$node = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Node')
->disableOriginalConstructor()
->getMock();
$node->expects($this->once())
$this->view->expects($this->once())
->method('getFileInfo')
->with('FolderA/test.txt')
->willReturn($fileInfoFolderATestTXT);

$this->tree->expects($this->once())->method('getNodeForPath')
->willReturn($node);

$this->plugin->checkMove('FolderA/test.txt', 'test.txt');
}

Expand All @@ -472,15 +461,10 @@ public function testMoveSrcDeletable() {
* @expectedExceptionMessage FolderA/test.txt does not exist
*/
public function testMoveSrcNotExist() {
$node = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Node')
->disableOriginalConstructor()
->getMock();
$node->expects($this->once())
$this->view->expects($this->once())
->method('getFileInfo')
->willReturn(null);

$this->tree->expects($this->once())->method('getNodeForPath')
->willReturn($node);
->with('FolderA/test.txt')
->willReturn(false);

$this->plugin->checkMove('FolderA/test.txt', 'test.txt');
}
Expand Down
59 changes: 0 additions & 59 deletions apps/dav/tests/unit/Connector/Sabre/RequestTest/DeleteTest.php

This file was deleted.

6 changes: 0 additions & 6 deletions apps/federatedfilesharing/l10n/ar.js

This file was deleted.

4 changes: 0 additions & 4 deletions apps/federatedfilesharing/l10n/ar.json

This file was deleted.

3 changes: 0 additions & 3 deletions apps/files/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@
this.$showHiddenFiles = $('input#showhiddenfilesToggle');
var showHidden = $('#showHiddenFiles').val() === "1";
this.$showHiddenFiles.prop('checked', showHidden);
if ($('#fileNotFound').val() === "1") {
OC.Notification.showTemporary(t('files', 'File could not be found'));
}

this._filesConfig = new OC.Backbone.Model({
showhidden: showHidden
Expand Down
6 changes: 0 additions & 6 deletions apps/files/l10n/da.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ OC.L10N.register(
"Could not get result from server." : "Kunne ikke hente resultat fra server.",
"Uploading..." : "Uploader...",
"..." : "...",
"Any moment now..." : "Når som helst...",
"Soon..." : "Snart...",
"File upload is in progress. Leaving the page now will cancel the upload." : "Fil upload kører. Hvis du forlader siden nu, vil uploadet blive annuleret.",
"Actions" : "Handlinger",
"Download" : "Download",
Expand All @@ -49,8 +47,6 @@ OC.L10N.register(
"This directory is unavailable, please check the logs or contact the administrator" : "Denne mappe er utilgængelig, tjek venligst loggene eller kontakt administratoren",
"Could not move \"{file}\", target exists" : "Kunne ikke flytte \"{file}\" - der findes allerede en fil med dette navn",
"Could not move \"{file}\"" : "Kunne ikke flytte \"{file}\"",
"{newName} already exists" : "{newName} eksistere allerede",
"Error deleting file \"{fileName}\"." : "Fejl under sletning af filen \"{fileName}\"",
"No entries in this folder match '{filter}'" : "Der er ingen poster i denne mappe, der matcher '{filter}'",
"Name" : "Navn",
"Size" : "Størrelse",
Expand All @@ -72,7 +68,6 @@ OC.L10N.register(
"_%n byte_::_%n bytes_" : ["%n byte","%n bytes"],
"Favorited" : "Gjort til foretrukken",
"Favorite" : "Foretrukken",
"Local link" : "Lokalt link",
"Folder" : "Mappe",
"New folder" : "Ny Mappe",
"{newname} already exists" : "{newname} eksistere allerede",
Expand Down Expand Up @@ -102,7 +97,6 @@ OC.L10N.register(
"Save" : "Gem",
"Missing permissions to edit from here." : "Rettighed mangler til at redigere på dette sted",
"Settings" : "Indstillinger",
"Show hidden files" : "Vis skjulte filer",
"WebDAV" : "WebDAV",
"No files in here" : "Her er ingen filer",
"Upload some content or sync with your devices!" : "Overfør indhold eller synkronisér med dine enheder!",
Expand Down
6 changes: 0 additions & 6 deletions apps/files/l10n/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
"Could not get result from server." : "Kunne ikke hente resultat fra server.",
"Uploading..." : "Uploader...",
"..." : "...",
"Any moment now..." : "Når som helst...",
"Soon..." : "Snart...",
"File upload is in progress. Leaving the page now will cancel the upload." : "Fil upload kører. Hvis du forlader siden nu, vil uploadet blive annuleret.",
"Actions" : "Handlinger",
"Download" : "Download",
Expand All @@ -47,8 +45,6 @@
"This directory is unavailable, please check the logs or contact the administrator" : "Denne mappe er utilgængelig, tjek venligst loggene eller kontakt administratoren",
"Could not move \"{file}\", target exists" : "Kunne ikke flytte \"{file}\" - der findes allerede en fil med dette navn",
"Could not move \"{file}\"" : "Kunne ikke flytte \"{file}\"",
"{newName} already exists" : "{newName} eksistere allerede",
"Error deleting file \"{fileName}\"." : "Fejl under sletning af filen \"{fileName}\"",
"No entries in this folder match '{filter}'" : "Der er ingen poster i denne mappe, der matcher '{filter}'",
"Name" : "Navn",
"Size" : "Størrelse",
Expand All @@ -70,7 +66,6 @@
"_%n byte_::_%n bytes_" : ["%n byte","%n bytes"],
"Favorited" : "Gjort til foretrukken",
"Favorite" : "Foretrukken",
"Local link" : "Lokalt link",
"Folder" : "Mappe",
"New folder" : "Ny Mappe",
"{newname} already exists" : "{newname} eksistere allerede",
Expand Down Expand Up @@ -100,7 +95,6 @@
"Save" : "Gem",
"Missing permissions to edit from here." : "Rettighed mangler til at redigere på dette sted",
"Settings" : "Indstillinger",
"Show hidden files" : "Vis skjulte filer",
"WebDAV" : "WebDAV",
"No files in here" : "Her er ingen filer",
"Upload some content or sync with your devices!" : "Overfør indhold eller synkronisér med dine enheder!",
Expand Down
Loading

0 comments on commit 2819373

Please sign in to comment.