summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/comments/lib/Notification/Notifier.php13
-rw-r--r--apps/comments/tests/Unit/AppInfo/ApplicationTest.php4
-rw-r--r--apps/comments/tests/Unit/Notification/NotifierTest.php102
-rw-r--r--apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php2
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php7
-rw-r--r--apps/dav/lib/Files/FileSearchBackend.php265
-rw-r--r--apps/dav/lib/Server.php9
-rw-r--r--apps/dav/tests/unit/Files/FileSearchBackendTest.php299
-rw-r--r--apps/federatedfilesharing/tests/TestCase.php18
-rw-r--r--apps/federation/appinfo/routes.php14
-rw-r--r--apps/files/js/file-upload.js2
-rw-r--r--apps/files/l10n/ca.js3
-rw-r--r--apps/files/l10n/ca.json3
-rw-r--r--apps/files/l10n/ja.js5
-rw-r--r--apps/files/l10n/ja.json5
-rw-r--r--apps/files/l10n/tr.js1
-rw-r--r--apps/files/l10n/tr.json1
-rw-r--r--apps/files_sharing/tests/TestCase.php25
-rw-r--r--apps/systemtags/l10n/fr.js4
-rw-r--r--apps/systemtags/l10n/fr.json4
-rw-r--r--apps/theming/l10n/hu.js27
-rw-r--r--apps/theming/l10n/hu.json25
-rw-r--r--apps/theming/l10n/pt_BR.js8
-rw-r--r--apps/theming/l10n/pt_BR.json8
-rw-r--r--apps/twofactor_backupcodes/l10n/tr.js9
-rw-r--r--apps/twofactor_backupcodes/l10n/tr.json9
-rw-r--r--apps/updatenotification/l10n/bg.js24
-rw-r--r--apps/updatenotification/l10n/bg.json22
-rw-r--r--apps/updatenotification/l10n/tr.js3
-rw-r--r--apps/updatenotification/l10n/tr.json3
-rw-r--r--apps/user_ldap/appinfo/app.php2
-rw-r--r--apps/user_ldap/lib/Access.php4
-rw-r--r--apps/user_ldap/tests/User_LDAPTest.php2
-rw-r--r--apps/workflowengine/l10n/bg.js1
-rw-r--r--apps/workflowengine/l10n/bg.json1
-rw-r--r--apps/workflowengine/l10n/tr.js71
-rw-r--r--apps/workflowengine/l10n/tr.json69
-rw-r--r--apps/workflowengine/lib/AppInfo/Application.php2
-rw-r--r--apps/workflowengine/lib/Check/FileMimeType.php21
39 files changed, 1003 insertions, 94 deletions
diff --git a/apps/comments/lib/Notification/Notifier.php b/apps/comments/lib/Notification/Notifier.php
index a9daef3031f..09092da539c 100644
--- a/apps/comments/lib/Notification/Notifier.php
+++ b/apps/comments/lib/Notification/Notifier.php
@@ -23,7 +23,7 @@ namespace OCA\Comments\Notification;
use OCP\Comments\ICommentsManager;
use OCP\Comments\NotFoundException;
-use OCP\Files\Folder;
+use OCP\Files\IRootFolder;
use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\L10N\IFactory;
@@ -35,8 +35,8 @@ class Notifier implements INotifier {
/** @var IFactory */
protected $l10nFactory;
- /** @var Folder */
- protected $userFolder;
+ /** @var IRootFolder */
+ protected $rootFolder;
/** @var ICommentsManager */
protected $commentsManager;
@@ -49,13 +49,13 @@ class Notifier implements INotifier {
public function __construct(
IFactory $l10nFactory,
- Folder $userFolder,
+ IRootFolder $rootFolder,
ICommentsManager $commentsManager,
IURLGenerator $url,
IUserManager $userManager
) {
$this->l10nFactory = $l10nFactory;
- $this->userFolder = $userFolder;
+ $this->rootFolder = $rootFolder;
$this->commentsManager = $commentsManager;
$this->url = $url;
$this->userManager = $userManager;
@@ -93,7 +93,8 @@ class Notifier implements INotifier {
if($parameters[0] !== 'files') {
throw new \InvalidArgumentException('Unsupported comment object');
}
- $nodes = $this->userFolder->getById($parameters[1]);
+ $userFolder = $this->rootFolder->getUserFolder($notification->getUser());
+ $nodes = $userFolder->getById($parameters[1]);
if(empty($nodes)) {
throw new \InvalidArgumentException('Cannot resolve file id to Node instance');
}
diff --git a/apps/comments/tests/Unit/AppInfo/ApplicationTest.php b/apps/comments/tests/Unit/AppInfo/ApplicationTest.php
index e0a47dbfff9..5adfbbcc635 100644
--- a/apps/comments/tests/Unit/AppInfo/ApplicationTest.php
+++ b/apps/comments/tests/Unit/AppInfo/ApplicationTest.php
@@ -22,6 +22,7 @@
namespace OCA\Comments\Tests\Unit\AppInfo;
use OCA\Comments\AppInfo\Application;
+use OCA\Comments\Notification\Notifier;
use Test\TestCase;
/**
@@ -56,7 +57,8 @@ class ApplicationTest extends TestCase {
'OCA\Comments\Activity\Listener',
'OCA\Comments\Activity\Provider',
'OCA\Comments\Activity\Setting',
- 'OCA\Comments\Notification\Listener'
+ 'OCA\Comments\Notification\Listener',
+ Notifier::class,
];
foreach($services as $service) {
diff --git a/apps/comments/tests/Unit/Notification/NotifierTest.php b/apps/comments/tests/Unit/Notification/NotifierTest.php
index 25b8b4b278d..0b08849030b 100644
--- a/apps/comments/tests/Unit/Notification/NotifierTest.php
+++ b/apps/comments/tests/Unit/Notification/NotifierTest.php
@@ -28,6 +28,7 @@ use OCP\Comments\IComment;
use OCP\Comments\ICommentsManager;
use OCP\Comments\NotFoundException;
use OCP\Files\Folder;
+use OCP\Files\IRootFolder;
use OCP\Files\Node;
use OCP\IL10N;
use OCP\IURLGenerator;
@@ -41,41 +42,33 @@ class NotifierTest extends TestCase {
/** @var Notifier */
protected $notifier;
-
/** @var IFactory|\PHPUnit_Framework_MockObject_MockObject */
protected $l10nFactory;
-
- /** @var Folder|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var IL10N|\PHPUnit_Framework_MockObject_MockObject */
+ protected $l;
+ /** @var IRootFolder|\PHPUnit_Framework_MockObject_MockObject */
protected $folder;
-
- /** @var ICommentsManager|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var ICommentsManager|\PHPUnit_Framework_MockObject_MockObject */
protected $commentsManager;
/** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */
protected $url;
- /** @var IUserManager|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var IUserManager|\PHPUnit_Framework_MockObject_MockObject */
protected $userManager;
-
-
- /** @var string */
- protected $lc = 'tlh_KX';
-
- /** @var INotification|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var INotification|\PHPUnit_Framework_MockObject_MockObject */
protected $notification;
-
- /** @var IL10N|\PHPUnit_Framework_MockObject_MockObject */
- protected $l;
-
- /** @var IComment|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var IComment|\PHPUnit_Framework_MockObject_MockObject */
protected $comment;
+ /** @var string */
+ protected $lc = 'tlh_KX';
protected function setUp() {
parent::setUp();
- $this->l10nFactory = $this->getMockBuilder('OCP\L10N\IFactory')->getMock();
- $this->folder = $this->getMockBuilder('OCP\Files\Folder')->getMock();
- $this->commentsManager = $this->getMockBuilder('OCP\Comments\ICommentsManager')->getMock();
+ $this->l10nFactory = $this->createMock(IFactory::class);
+ $this->folder = $this->createMock(IRootFolder::class);
+ $this->commentsManager = $this->createMock(ICommentsManager::class);
$this->url = $this->createMock(IURLGenerator::class);
- $this->userManager = $this->getMockBuilder('OCP\IUserManager')->getMock();
+ $this->userManager = $this->createMock(IUserManager::class);
$this->notifier = new Notifier(
$this->l10nFactory,
@@ -92,8 +85,8 @@ class NotifierTest extends TestCase {
return vsprintf($text, $parameters);
}));
- $this->notification = $this->getMockBuilder('OCP\Notification\INotification')->getMock();
- $this->comment = $this->getMockBuilder('OCP\Comments\IComment')->getMock();
+ $this->notification = $this->createMock(INotification::class);
+ $this->comment = $this->createMock(IComment::class);
}
public function testPrepareSuccess() {
@@ -102,24 +95,31 @@ class NotifierTest extends TestCase {
$message = 'Huraga mentioned you in a comment on “Gre\'thor.odp”';
/** @var IUser|\PHPUnit_Framework_MockObject_MockObject $user */
- $user = $this->getMockBuilder('OCP\IUser')->getMock();
+ $user = $this->createMock(IUser::class);
$user->expects($this->once())
->method('getDisplayName')
->willReturn($displayName);
- /** @var Node|\PHPUnit_Framework_MockObject_MockObject */
- $node = $this->getMockBuilder('OCP\Files\Node')->getMock();
+ /** @var Node|\PHPUnit_Framework_MockObject_MockObject $node */
+ $node = $this->createMock(Node::class);
$node
->expects($this->atLeastOnce())
->method('getName')
->willReturn($fileName);
- $this->folder
- ->expects($this->once())
+ $userFolder = $this->createMock(Folder::class);
+ $this->folder->expects($this->once())
+ ->method('getUserFolder')
+ ->with('you')
+ ->willReturn($userFolder);
+ $userFolder->expects($this->once())
->method('getById')
->with('678')
->willReturn([$node]);
+ $this->notification->expects($this->once())
+ ->method('getUser')
+ ->willReturn('you');
$this->notification
->expects($this->once())
->method('getApp')
@@ -172,7 +172,7 @@ class NotifierTest extends TestCase {
->willReturn('users');
$this->commentsManager
- ->expects(($this->once()))
+ ->expects($this->once())
->method('get')
->willReturn($this->comment);
@@ -189,19 +189,26 @@ class NotifierTest extends TestCase {
$fileName = 'Gre\'thor.odp';
$message = 'A (now) deleted user mentioned you in a comment on “Gre\'thor.odp”';
- /** @var Node|\PHPUnit_Framework_MockObject_MockObject */
- $node = $this->getMockBuilder('OCP\Files\Node')->getMock();
+ /** @var Node|\PHPUnit_Framework_MockObject_MockObject $node */
+ $node = $this->createMock(Node::class);
$node
->expects($this->atLeastOnce())
->method('getName')
->willReturn($fileName);
- $this->folder
- ->expects($this->once())
+ $userFolder = $this->createMock(Folder::class);
+ $this->folder->expects($this->once())
+ ->method('getUserFolder')
+ ->with('you')
+ ->willReturn($userFolder);
+ $userFolder->expects($this->once())
->method('getById')
->with('678')
->willReturn([$node]);
+ $this->notification->expects($this->once())
+ ->method('getUser')
+ ->willReturn('you');
$this->notification
->expects($this->once())
->method('getApp')
@@ -254,7 +261,7 @@ class NotifierTest extends TestCase {
->willReturn(ICommentsManager::DELETED_USER);
$this->commentsManager
- ->expects(($this->once()))
+ ->expects($this->once())
->method('get')
->willReturn($this->comment);
@@ -292,7 +299,7 @@ class NotifierTest extends TestCase {
->method('get');
$this->commentsManager
- ->expects(($this->never()))
+ ->expects($this->never())
->method('get');
$this->userManager
@@ -329,7 +336,7 @@ class NotifierTest extends TestCase {
->method('get');
$this->commentsManager
- ->expects(($this->once()))
+ ->expects($this->once())
->method('get')
->willThrowException(new NotFoundException());
@@ -347,7 +354,7 @@ class NotifierTest extends TestCase {
$displayName = 'Huraga';
/** @var IUser|\PHPUnit_Framework_MockObject_MockObject $user */
- $user = $this->getMockBuilder('OCP\IUser')->getMock();
+ $user = $this->createMock(IUser::class);
$user->expects($this->once())
->method('getDisplayName')
->willReturn($displayName);
@@ -390,7 +397,7 @@ class NotifierTest extends TestCase {
->willReturn('users');
$this->commentsManager
- ->expects(($this->once()))
+ ->expects($this->once())
->method('get')
->willReturn($this->comment);
@@ -410,7 +417,7 @@ class NotifierTest extends TestCase {
$displayName = 'Huraga';
/** @var IUser|\PHPUnit_Framework_MockObject_MockObject $user */
- $user = $this->getMockBuilder('OCP\IUser')->getMock();
+ $user = $this->createMock(IUser::class);
$user->expects($this->once())
->method('getDisplayName')
->willReturn($displayName);
@@ -454,7 +461,7 @@ class NotifierTest extends TestCase {
->willReturn('users');
$this->commentsManager
- ->expects(($this->once()))
+ ->expects($this->once())
->method('get')
->willReturn($this->comment);
@@ -474,17 +481,24 @@ class NotifierTest extends TestCase {
$displayName = 'Huraga';
/** @var IUser|\PHPUnit_Framework_MockObject_MockObject $user */
- $user = $this->getMockBuilder('OCP\IUser')->getMock();
+ $user = $this->createMock(IUser::class);
$user->expects($this->once())
->method('getDisplayName')
->willReturn($displayName);
- $this->folder
- ->expects($this->once())
+ $userFolder = $this->createMock(Folder::class);
+ $this->folder->expects($this->once())
+ ->method('getUserFolder')
+ ->with('you')
+ ->willReturn($userFolder);
+ $userFolder->expects($this->once())
->method('getById')
->with('678')
->willReturn([]);
+ $this->notification->expects($this->once())
+ ->method('getUser')
+ ->willReturn('you');
$this->notification
->expects($this->once())
->method('getApp')
@@ -520,7 +534,7 @@ class NotifierTest extends TestCase {
->willReturn('users');
$this->commentsManager
- ->expects(($this->once()))
+ ->expects($this->once())
->method('get')
->willReturn($this->comment);
diff --git a/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php b/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php
index c330e5d203a..3baacfc064a 100644
--- a/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FakeLockerPlugin.php
@@ -136,7 +136,9 @@ class FakeLockerPlugin extends ServerPlugin {
new LockDiscovery([$lockInfo])
]);
+ $response->setStatus(200);
$response->setBody($body);
+ $response->setStatus(200);
return false;
}
diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php
index d0826ee5a8c..391d42393f5 100644
--- a/apps/dav/lib/Connector/Sabre/File.php
+++ b/apps/dav/lib/Connector/Sabre/File.php
@@ -206,7 +206,12 @@ class File extends Node implements IFile {
// allow sync clients to send the mtime along in a header
$request = \OC::$server->getRequest();
if (isset($request->server['HTTP_X_OC_MTIME'])) {
- if ($this->fileView->touch($this->path, $request->server['HTTP_X_OC_MTIME'])) {
+ $mtimeStr = $request->server['HTTP_X_OC_MTIME'];
+ if (!is_numeric($mtimeStr)) {
+ throw new \InvalidArgumentException('X-OC-Mtime header must be an integer (unix timestamp).');
+ }
+ $mtime = intval($mtimeStr);
+ if ($this->fileView->touch($this->path, $mtime)) {
header('X-OC-MTime: accepted');
}
}
diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php
new file mode 100644
index 00000000000..c429a1727f8
--- /dev/null
+++ b/apps/dav/lib/Files/FileSearchBackend.php
@@ -0,0 +1,265 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\DAV\Files;
+
+use OC\Files\Search\SearchBinaryOperator;
+use OC\Files\Search\SearchComparison;
+use OC\Files\Search\SearchOrder;
+use OC\Files\Search\SearchQuery;
+use OC\Files\View;
+use OCA\DAV\Connector\Sabre\Directory;
+use OCA\DAV\Connector\Sabre\FilesPlugin;
+use OCP\Files\Cache\ICacheEntry;
+use OCP\Files\Folder;
+use OCP\Files\IRootFolder;
+use OCP\Files\Node;
+use OCP\Files\Search\ISearchOperator;
+use OCP\Files\Search\ISearchOrder;
+use OCP\Files\Search\ISearchQuery;
+use OCP\IUser;
+use OCP\Share\IManager;
+use Sabre\DAV\Exception\NotFound;
+use Sabre\DAV\Tree;
+use SearchDAV\Backend\ISearchBackend;
+use SearchDAV\Backend\SearchPropertyDefinition;
+use SearchDAV\Backend\SearchResult;
+use SearchDAV\XML\BasicSearch;
+use SearchDAV\XML\Literal;
+use SearchDAV\XML\Operator;
+use SearchDAV\XML\Order;
+
+class FileSearchBackend implements ISearchBackend {
+ /** @var Tree */
+ private $tree;
+
+ /** @var IUser */
+ private $user;
+
+ /** @var IRootFolder */
+ private $rootFolder;
+
+ /** @var IManager */
+ private $shareManager;
+
+ /** @var View */
+ private $view;
+
+ /**
+ * FileSearchBackend constructor.
+ *
+ * @param Tree $tree
+ * @param IUser $user
+ * @param IRootFolder $rootFolder
+ * @param IManager $shareManager
+ * @param View $view
+ * @internal param IRootFolder $rootFolder
+ */
+ public function __construct(Tree $tree, IUser $user, IRootFolder $rootFolder, IManager $shareManager, View $view) {
+ $this->tree = $tree;
+ $this->user = $user;
+ $this->rootFolder = $rootFolder;
+ $this->shareManager = $shareManager;
+ $this->view = $view;
+ }
+
+ /**
+ * Search endpoint will be remote.php/dav
+ *
+ * @return string
+ */
+ public function getArbiterPath() {
+ return '';
+ }
+
+ public function isValidScope($href, $depth, $path) {
+ // only allow scopes inside the dav server
+ if (is_null($path)) {
+ return false;
+ }
+
+ try {
+ $node = $this->tree->getNodeForPath($path);
+ return $node instanceof Directory;
+ } catch (NotFound $e) {
+ return false;
+ }
+ }
+
+ public function getPropertyDefinitionsForScope($href, $path) {
+ // all valid scopes support the same schema
+
+ //todo dynamically load all propfind properties that are supported
+ return [
+ // queryable properties
+ new SearchPropertyDefinition('{DAV:}displayname', true, false, true),
+ new SearchPropertyDefinition('{DAV:}getcontenttype', true, true, true),
+ new SearchPropertyDefinition('{DAV:}getlastmodifed', true, true, true, SearchPropertyDefinition::DATATYPE_DATETIME),
+ new SearchPropertyDefinition(FilesPlugin::SIZE_PROPERTYNAME, true, true, true, SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER),
+
+ // select only properties
+ new SearchPropertyDefinition('{DAV:}resourcetype', false, true, false),
+ new SearchPropertyDefinition('{DAV:}getcontentlength', false, true, false),
+ new SearchPropertyDefinition(FilesPlugin::CHECKSUMS_PROPERTYNAME, false, true, false),
+ new SearchPropertyDefinition(FilesPlugin::PERMISSIONS_PROPERTYNAME, false, true, false),
+ new SearchPropertyDefinition(FilesPlugin::GETETAG_PROPERTYNAME, false, true, false),
+ new SearchPropertyDefinition(FilesPlugin::OWNER_ID_PROPERTYNAME, false, true, false),
+ new SearchPropertyDefinition(FilesPlugin::OWNER_DISPLAY_NAME_PROPERTYNAME, false, true, false),
+ new SearchPropertyDefinition(FilesPlugin::DATA_FINGERPRINT_PROPERTYNAME, false, true, false),
+ new SearchPropertyDefinition(FilesPlugin::HAS_PREVIEW_PROPERTYNAME, false, true, false, SearchPropertyDefinition::DATATYPE_BOOLEAN),
+ new SearchPropertyDefinition(FilesPlugin::INTERNAL_FILEID_PROPERTYNAME, false, true, false, SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER),
+ new SearchPropertyDefinition(FilesPlugin::FILEID_PROPERTYNAME, false, true, false, SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER),
+ ];
+ }
+
+ /**
+ * @param BasicSearch $search
+ * @return SearchResult[]
+ */
+ public function search(BasicSearch $search) {
+ if (count($search->from) !== 1) {
+ throw new \InvalidArgumentException('Searching more than one folder is not supported');
+ }
+ $query = $this->transformQuery($search);
+ $scope = $search->from[0];
+ if ($scope->path === null) {
+ throw new \InvalidArgumentException('Using uri\'s as scope is not supported, please use a path relative to the search arbiter instead');
+ }
+ $node = $this->tree->getNodeForPath($scope->path);
+ if (!$node instanceof Directory) {
+ throw new \InvalidArgumentException('Search is only supported on directories');
+ }
+
+ $fileInfo = $node->getFileInfo();
+ $folder = $this->rootFolder->get($fileInfo->getPath());
+ /** @var Folder $folder $results */
+ $results = $folder->search($query);
+
+ return array_map(function (Node $node) {
+ if ($node instanceof Folder) {
+ return new SearchResult(new \OCA\DAV\Connector\Sabre\Directory($this->view, $node, $this->tree, $this->shareManager), $this->getHrefForNode($node));
+ } else {
+ return new SearchResult(new \OCA\DAV\Connector\Sabre\File($this->view, $node, $this->shareManager), $this->getHrefForNode($node));
+ }
+ }, $results);
+ }
+
+ /**
+ * @param Node $node
+ * @return string
+ */
+ private function getHrefForNode(Node $node) {
+ $base = '/files/' . $this->user->getUID();
+ return $base . $this->view->getRelativePath($node->getPath());
+ }
+
+ /**
+ * @param BasicSearch $query
+ * @return ISearchQuery
+ */
+ private function transformQuery(BasicSearch $query) {
+ // TODO offset, limit
+ $orders = array_map([$this, 'mapSearchOrder'], $query->orderBy);
+ return new SearchQuery($this->transformSearchOperation($query->where), 0, 0, $orders);
+ }
+
+ /**
+ * @param Order $order
+ * @return ISearchOrder
+ */
+ private function mapSearchOrder(Order $order) {
+ return new SearchOrder($order->order === Order::ASC ? ISearchOrder::DIRECTION_ASCENDING : ISearchOrder::DIRECTION_DESCENDING, $this->mapPropertyNameToCollumn($order->property));
+ }
+
+ /**
+ * @param Operator $operator
+ * @return ISearchOperator
+ */
+ private function transformSearchOperation(Operator $operator) {
+ list(, $trimmedType) = explode('}', $operator->type);
+ switch ($operator->type) {
+ case Operator::OPERATION_AND:
+ case Operator::OPERATION_OR:
+ case Operator::OPERATION_NOT:
+ $arguments = array_map([$this, 'transformSearchOperation'], $operator->arguments);
+ return new SearchBinaryOperator($trimmedType, $arguments);
+ case Operator::OPERATION_EQUAL:
+ case Operator::OPERATION_GREATER_OR_EQUAL_THAN:
+ case Operator::OPERATION_GREATER_THAN:
+ case Operator::OPERATION_LESS_OR_EQUAL_THAN:
+ case Operator::OPERATION_LESS_THAN:
+ case Operator::OPERATION_IS_LIKE:
+ if (count($operator->arguments) !== 2) {
+ throw new \InvalidArgumentException('Invalid number of arguments for ' . $trimmedType . ' operation');
+ }
+ if (gettype($operator->arguments[0]) !== 'string') {
+ throw new \InvalidArgumentException('Invalid argument 1 for ' . $trimmedType . ' operation, expected property');
+ }
+ if (!($operator->arguments[1] instanceof Literal)) {
+ throw new \InvalidArgumentException('Invalid argument 2 for ' . $trimmedType . ' operation, expected literal');
+ }
+ return new SearchComparison($trimmedType, $this->mapPropertyNameToCollumn($operator->arguments[0]), $this->castValue($operator->arguments[0], $operator->arguments[1]->value));
+ case Operator::OPERATION_IS_COLLECTION:
+ return new SearchComparison('eq', 'mimetype', ICacheEntry::DIRECTORY_MIMETYPE);
+ default:
+ throw new \InvalidArgumentException('Unsupported operation ' . $trimmedType. ' (' . $operator->type . ')');
+ }
+ }
+
+ /**
+ * @param string $propertyName
+ * @return string
+ */
+ private function mapPropertyNameToCollumn($propertyName) {
+ switch ($propertyName) {
+ case '{DAV:}displayname':
+ return 'name';
+ case '{DAV:}getcontenttype':
+ return 'mimetype';
+ case '{DAV:}getlastmodifed':
+ return 'mtime';
+ case FilesPlugin::SIZE_PROPERTYNAME:
+ return 'size';
+ default:
+ throw new \InvalidArgumentException('Unsupported property for search or order: ' . $propertyName);
+ }
+ }
+
+ private function castValue($propertyName, $value) {
+ $allProps = $this->getPropertyDefinitionsForScope('', '');
+ foreach ($allProps as $prop) {
+ if ($prop->name === $propertyName) {
+ $dataType = $prop->dataType;
+ switch ($dataType) {
+ case SearchPropertyDefinition::DATATYPE_BOOLEAN:
+ return $value === 'yes';
+ case SearchPropertyDefinition::DATATYPE_DECIMAL:
+ case SearchPropertyDefinition::DATATYPE_INTEGER:
+ case SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER:
+ return 0 + $value;
+ default:
+ return $value;
+ }
+ }
+ }
+ return $value;
+ }
+}
diff --git a/apps/dav/lib/Server.php b/apps/dav/lib/Server.php
index 79c4301a8d8..031bc1d3d81 100644
--- a/apps/dav/lib/Server.php
+++ b/apps/dav/lib/Server.php
@@ -51,6 +51,7 @@ use OCP\SabrePluginEvent;
use Sabre\CardDAV\VCFExportPlugin;
use Sabre\DAV\Auth\Plugin;
use OCA\DAV\Connector\Sabre\TagsPlugin;
+use SearchDAV\DAV\SearchPlugin;
class Server {
@@ -155,6 +156,7 @@ class Server {
if($request->isUserAgent([
'/WebDAVFS/',
'/Microsoft Office OneNote 2013/',
+ '/^Microsoft-WebDAV/',// Microsoft-WebDAV-MiniRedir/6.1.7601
])) {
$this->server->addPlugin(new FakeLockerPlugin());
}
@@ -222,6 +224,13 @@ class Server {
\OC::$server->getGroupManager(),
$userFolder
));
+ $this->server->addPlugin(new SearchPlugin(new \OCA\DAV\Files\FileSearchBackend(
+ $this->server->tree,
+ $user,
+ \OC::$server->getRootFolder(),
+ \OC::$server->getShareManager(),
+ $view
+ )));
}
}
});
diff --git a/apps/dav/tests/unit/Files/FileSearchBackendTest.php b/apps/dav/tests/unit/Files/FileSearchBackendTest.php
new file mode 100644
index 00000000000..24b9a9c51e6
--- /dev/null
+++ b/apps/dav/tests/unit/Files/FileSearchBackendTest.php
@@ -0,0 +1,299 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\DAV\Tests\Files;
+
+use OC\Files\Search\SearchComparison;
+use OC\Files\Search\SearchQuery;
+use OC\Files\View;
+use OCA\DAV\Connector\Sabre\Directory;
+use OCA\DAV\Connector\Sabre\File;
+use OCA\DAV\Connector\Sabre\FilesPlugin;
+use OCA\DAV\Files\FileSearchBackend;
+use OCP\Files\FileInfo;
+use OCP\Files\Folder;
+use OCP\Files\IRootFolder;
+use OCP\Files\Search\ISearchComparison;
+use OCP\IUser;
+use OCP\Share\IManager;
+use Sabre\DAV\Tree;
+use SearchDAV\XML\BasicSearch;
+use SearchDAV\XML\Literal;
+use SearchDAV\XML\Operator;
+use SearchDAV\XML\Scope;
+use Test\TestCase;
+
+class FileSearchBackendTest extends TestCase {
+ /** @var Tree|\PHPUnit_Framework_MockObject_MockObject */
+ private $tree;
+
+ /** @var IUser */
+ private $user;
+
+ /** @var IRootFolder|\PHPUnit_Framework_MockObject_MockObject */
+ private $rootFolder;
+
+ /** @var IManager|\PHPUnit_Framework_MockObject_MockObject */
+ private $shareManager;
+
+ /** @var View|\PHPUnit_Framework_MockObject_MockObject */
+ private $view;
+
+ /** @var Folder|\PHPUnit_Framework_MockObject_MockObject */
+ private $searchFolder;
+
+ /** @var FileSearchBackend */
+ private $search;
+
+ /** @var Directory|\PHPUnit_Framework_MockObject_MockObject */
+ private $davFolder;
+
+ protected function setUp() {
+ parent::setUp();
+
+ $this->user = $this->createMock(IUser::class);
+ $this->user->expects($this->any())
+ ->method('getUID')
+ ->willReturn('test');
+
+ $this->tree = $this->getMockBuilder(Tree::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->view = $this->getMockBuilder(View::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->view->expects($this->any())
+ ->method('getRelativePath')
+ ->willReturnArgument(0);
+
+ $this->rootFolder = $this->createMock(IRootFolder::class);
+
+ $this->shareManager = $this->createMock(IManager::class);
+
+ $this->searchFolder = $this->createMock(Folder::class);
+
+ $fileInfo = $this->createMock(FileInfo::class);
+
+ $this->davFolder = $this->createMock(Directory::class);
+
+ $this->davFolder->expects($this->any())
+ ->method('getFileInfo')
+ ->willReturn($fileInfo);
+
+ $this->rootFolder->expects($this->any())
+ ->method('get')
+ ->willReturn($this->searchFolder);
+
+ $this->search = new FileSearchBackend($this->tree, $this->user, $this->rootFolder, $this->shareManager, $this->view);
+ }
+
+ public function testSearchFilename() {
+ $this->tree->expects($this->any())
+ ->method('getNodeForPath')
+ ->willReturn($this->davFolder);
+
+ $this->searchFolder->expects($this->once())
+ ->method('search')
+ ->with(new SearchQuery(
+ new SearchComparison(
+ ISearchComparison::COMPARE_EQUAL,
+ 'name',
+ 'foo'
+ ),
+ 0,
+ 0,
+ []
+ ))
+ ->will($this->returnValue([
+ new \OC\Files\Node\Folder($this->rootFolder, $this->view, '/test/path')
+ ]));
+
+ $query = $this->getBasicQuery(Operator::OPERATION_EQUAL, '{DAV:}displayname', 'foo');
+ $result = $this->search->search($query);
+
+ $this->assertCount(1, $result);
+ $this->assertEquals('/files/test/test/path', $result[0]->href);
+ }
+
+ public function testSearchMimetype() {
+ $this->tree->expects($this->any())
+ ->method('getNodeForPath')
+ ->willReturn($this->davFolder);
+
+ $this->searchFolder->expects($this->once())
+ ->method('search')
+ ->with(new SearchQuery(
+ new SearchComparison(
+ ISearchComparison::COMPARE_EQUAL,
+ 'mimetype',
+ 'foo'
+ ),
+ 0,
+ 0,
+ []
+ ))
+ ->will($this->returnValue([
+ new \OC\Files\Node\Folder($this->rootFolder, $this->view, '/test/path')
+ ]));
+
+ $query = $this->getBasicQuery(Operator::OPERATION_EQUAL, '{DAV:}getcontenttype', 'foo');
+ $result = $this->search->search($query);
+
+ $this->assertCount(1, $result);
+ $this->assertEquals('/files/test/test/path', $result[0]->href);
+ }
+
+ public function testSearchSize() {
+ $this->tree->expects($this->any())
+ ->method('getNodeForPath')
+ ->willReturn($this->davFolder);
+
+ $this->searchFolder->expects($this->once())
+ ->method('search')
+ ->with(new SearchQuery(
+ new SearchComparison(
+ ISearchComparison::COMPARE_GREATER_THAN,
+ 'size',
+ 10
+ ),
+ 0,
+ 0,
+ []
+ ))
+ ->will($this->returnValue([
+ new \OC\Files\Node\Folder($this->rootFolder, $this->view, '/test/path')
+ ]));
+
+ $query = $this->getBasicQuery(Operator::OPERATION_GREATER_THAN, FilesPlugin::SIZE_PROPERTYNAME, 10);
+ $result = $this->search->search($query);
+
+ $this->assertCount(1, $result);
+ $this->assertEquals('/files/test/test/path', $result[0]->href);
+ }
+
+ public function testSearchMtime() {
+ $this->tree->expects($this->any())
+ ->method('getNodeForPath')
+ ->willReturn($this->davFolder);
+
+ $this->searchFolder->expects($this->once())
+ ->method('search')
+ ->with(new SearchQuery(
+ new SearchComparison(
+ ISearchComparison::COMPARE_GREATER_THAN,
+ 'mtime',
+ 10
+ ),
+ 0,
+ 0,
+ []
+ ))
+ ->will($this->returnValue([
+ new \OC\Files\Node\Folder($this->rootFolder, $this->view, '/test/path')
+ ]));
+
+ $query = $this->getBasicQuery(Operator::OPERATION_GREATER_THAN, '{DAV:}getlastmodifed', 10);
+ $result = $this->search->search($query);
+
+ $this->assertCount(1, $result);
+ $this->assertEquals('/files/test/test/path', $result[0]->href);
+ }
+
+ public function testSearchIsCollection() {
+ $this->tree->expects($this->any())
+ ->method('getNodeForPath')
+ ->willReturn($this->davFolder);
+
+ $this->searchFolder->expects($this->once())
+ ->method('search')
+ ->with(new SearchQuery(
+ new SearchComparison(
+ ISearchComparison::COMPARE_EQUAL,
+ 'mimetype',
+ FileInfo::MIMETYPE_FOLDER
+ ),
+ 0,
+ 0,
+ []
+ ))
+ ->will($this->returnValue([
+ new \OC\Files\Node\Folder($this->rootFolder, $this->view, '/test/path')
+ ]));
+
+ $query = $this->getBasicQuery(Operator::OPERATION_IS_COLLECTION, 'yes');
+ $result = $this->search->search($query);
+
+ $this->assertCount(1, $result);
+ $this->assertEquals('/files/test/test/path', $result[0]->href);
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testSearchInvalidProp() {
+ $this->tree->expects($this->any())
+ ->method('getNodeForPath')
+ ->willReturn($this->davFolder);
+
+ $this->searchFolder->expects($this->never())
+ ->method('search');
+
+ $query = $this->getBasicQuery(Operator::OPERATION_EQUAL, '{DAV:}getetag', 'foo');
+ $this->search->search($query);
+ }
+
+ private function getBasicQuery($type, $property, $value = null) {
+ $query = new BasicSearch();
+ $scope = new Scope('/', 'infinite');
+ $scope->path = '/';
+ $query->from = [$scope];
+ $query->orderBy = [];
+ $query->select = [];
+ if (is_null($value)) {
+ $query->where = new Operator(
+ $type,
+ [new Literal($property)]
+ );
+ } else {
+ $query->where = new Operator(
+ $type,
+ [$property, new Literal($value)]
+ );
+ }
+ return $query;
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testSearchNonFolder() {
+ $davNode = $this->createMock(File::class);
+
+ $this->tree->expects($this->any())
+ ->method('getNodeForPath')
+ ->willReturn($davNode);
+
+ $query = $this->getBasicQuery(Operator::OPERATION_EQUAL, '{DAV:}displayname', 'foo');
+ $this->search->search($query);
+ }
+}
diff --git a/apps/federatedfilesharing/tests/TestCase.php b/apps/federatedfilesharing/tests/TestCase.php
index 7ccf76bbbc6..b31772e4e9e 100644
--- a/apps/federatedfilesharing/tests/TestCase.php
+++ b/apps/federatedfilesharing/tests/TestCase.php
@@ -42,7 +42,7 @@ abstract class TestCase extends \Test\TestCase {
// reset backend
\OC_User::clearBackends();
- \OC_Group::clearBackends();
+ \OC::$server->getGroupManager()->clearBackends();
// create users
$backend = new \Test\Util\User\Dummy();
@@ -76,8 +76,8 @@ abstract class TestCase extends \Test\TestCase {
// reset backend
\OC_User::clearBackends();
\OC_User::useBackend('database');
- \OC_Group::clearBackends();
- \OC_Group::useBackend(new Database());
+ \OC::$server->getGroupManager()->clearBackends();
+ \OC::$server->getGroupManager()->addBackend(new Database());
parent::tearDownAfterClass();
}
@@ -94,9 +94,15 @@ abstract class TestCase extends \Test\TestCase {
}
if ($create) {
- \OC::$server->getUserManager()->createUser($user, $password);
- \OC_Group::createGroup('group');
- \OC_Group::addToGroup($user, 'group');
+ $userManager = \OC::$server->getUserManager();
+ $groupManager = \OC::$server->getGroupManager();
+
+ $userObject = $userManager->createUser($user, $password);
+ $group = $groupManager->createGroup('group');
+
+ if ($group and $userObject) {
+ $group->addUser($userObject);
+ }
}
self::resetStorage();
diff --git a/apps/federation/appinfo/routes.php b/apps/federation/appinfo/routes.php
index b9515812a01..4c742dd705c 100644
--- a/apps/federation/appinfo/routes.php
+++ b/apps/federation/appinfo/routes.php
@@ -43,6 +43,7 @@ $application->registerRoutes(
],
],
'ocs' => [
+ // old endpoints, only used by Nextcloud and ownCloud
[
'name' => 'OCSAuthAPI#getSharedSecret',
'url' => '/api/v1/shared-secret',
@@ -53,6 +54,19 @@ $application->registerRoutes(
'url' => '/api/v1/request-shared-secret',
'verb' => 'POST',
],
+ // new endpoints, published as public api
+ [
+ 'name' => 'OCSAuthAPI#getSharedSecret',
+ 'root' => '/cloud',
+ 'url' => '/shared-secret',
+ 'verb' => 'GET',
+ ],
+ [
+ 'name' => 'OCSAuthAPI#requestSharedSecret',
+ 'root' => '/cloud',
+ 'url' => '/shared-secret',
+ 'verb' => 'POST',
+ ],
],
]
);
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index c93abd5244d..6f9fd9aafea 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -222,7 +222,7 @@ OC.FileUpload.prototype = {
if (file.lastModified) {
// preserve timestamp
- this.data.headers['X-OC-Mtime'] = file.lastModified / 1000;
+ this.data.headers['X-OC-Mtime'] = (file.lastModified / 1000).toFixed(0);
}
var userName = this.uploader.filesClient.getUserName();
diff --git a/apps/files/l10n/ca.js b/apps/files/l10n/ca.js
index f43200a5a05..7ab199c4c42 100644
--- a/apps/files/l10n/ca.js
+++ b/apps/files/l10n/ca.js
@@ -47,6 +47,7 @@ OC.L10N.register(
"_%n folder_::_%n folders_" : ["%n carpeta","%n carpetes"],
"_%n file_::_%n files_" : ["%n fitxer","%n fitxers"],
"{dirs} and {files}" : "{dirs} i {files}",
+ "_including %n hidden_::_including %n hidden_" : ["incloent %n ocult","incloent %n ocults"],
"You don’t have permission to upload or create files here" : "No teniu permisos per a pujar o crear els fitxers aquí",
"_Uploading %n file_::_Uploading %n files_" : ["Pujant %n fitxer","Pujant %n fitxers"],
"New" : "Nou",
@@ -59,6 +60,7 @@ OC.L10N.register(
"_matches '{filter}'_::_match '{filter}'_" : ["coincidències '{filter}'","coincidència '{filter}'"],
"View in folder" : "Veure a la carpeta",
"Path" : "Ruta",
+ "_%n byte_::_%n bytes_" : ["%n byte","%n bytes"],
"Favorited" : "Agregat a favorits",
"Favorite" : "Preferits",
"Copy local link" : "C",
@@ -76,6 +78,7 @@ OC.L10N.register(
"Restored by {user}" : "Restaurat per {user}",
"Renamed by {user}" : "Reanomenat per {user}",
"Moved by {user}" : "Mogut per {user}",
+ "You created {file}" : "Has creat {file}",
"You deleted {file}" : "Heu esborrat {file}",
"You renamed {oldfile} to {newfile}" : "Heu reanomenat {oldfile} a {newfile}",
"{user} renamed {oldfile} to {newfile}" : "{user} ha reanomenat {oldfile} a {newfile}",
diff --git a/apps/files/l10n/ca.json b/apps/files/l10n/ca.json
index 0f52e17bdbb..40d96e8afda 100644
--- a/apps/files/l10n/ca.json
+++ b/apps/files/l10n/ca.json
@@ -45,6 +45,7 @@
"_%n folder_::_%n folders_" : ["%n carpeta","%n carpetes"],
"_%n file_::_%n files_" : ["%n fitxer","%n fitxers"],
"{dirs} and {files}" : "{dirs} i {files}",
+ "_including %n hidden_::_including %n hidden_" : ["incloent %n ocult","incloent %n ocults"],
"You don’t have permission to upload or create files here" : "No teniu permisos per a pujar o crear els fitxers aquí",
"_Uploading %n file_::_Uploading %n files_" : ["Pujant %n fitxer","Pujant %n fitxers"],
"New" : "Nou",
@@ -57,6 +58,7 @@
"_matches '{filter}'_::_match '{filter}'_" : ["coincidències '{filter}'","coincidència '{filter}'"],
"View in folder" : "Veure a la carpeta",
"Path" : "Ruta",
+ "_%n byte_::_%n bytes_" : ["%n byte","%n bytes"],
"Favorited" : "Agregat a favorits",
"Favorite" : "Preferits",
"Copy local link" : "C",
@@ -74,6 +76,7 @@
"Restored by {user}" : "Restaurat per {user}",
"Renamed by {user}" : "Reanomenat per {user}",
"Moved by {user}" : "Mogut per {user}",
+ "You created {file}" : "Has creat {file}",
"You deleted {file}" : "Heu esborrat {file}",
"You renamed {oldfile} to {newfile}" : "Heu reanomenat {oldfile} a {newfile}",
"{user} renamed {oldfile} to {newfile}" : "{user} ha reanomenat {oldfile} a {newfile}",
diff --git a/apps/files/l10n/ja.js b/apps/files/l10n/ja.js
index 58585944f9c..f01be7e1b85 100644
--- a/apps/files/l10n/ja.js
+++ b/apps/files/l10n/ja.js
@@ -174,6 +174,9 @@ OC.L10N.register(
"%2$s restored %1$s" : "%2$s は、 %1$s を復元しました",
"Changed by %2$s" : "%2$s により更新",
"Deleted by %2$s" : "%2$s により削除",
- "Restored by %2$s" : "%2$s により復元"
+ "Restored by %2$s" : "%2$s により復元",
+ "_{hours}:{minutes}:{seconds} hour left_::_{hours}:{minutes}:{seconds} hours left_" : ["残り {hours}:{minutes}:{seconds} 時間"],
+ "_{minutes}:{seconds} minute left_::_{minutes}:{seconds} minutes left_" : ["残り {minutes}:{seconds} 分"],
+ "_{seconds} second left_::_{seconds} seconds left_" : ["残り {seconds} 秒"]
},
"nplurals=1; plural=0;");
diff --git a/apps/files/l10n/ja.json b/apps/files/l10n/ja.json
index 12cf9d4907c..7a69ccf1b7e 100644
--- a/apps/files/l10n/ja.json
+++ b/apps/files/l10n/ja.json
@@ -172,6 +172,9 @@
"%2$s restored %1$s" : "%2$s は、 %1$s を復元しました",
"Changed by %2$s" : "%2$s により更新",
"Deleted by %2$s" : "%2$s により削除",
- "Restored by %2$s" : "%2$s により復元"
+ "Restored by %2$s" : "%2$s により復元",
+ "_{hours}:{minutes}:{seconds} hour left_::_{hours}:{minutes}:{seconds} hours left_" : ["残り {hours}:{minutes}:{seconds} 時間"],
+ "_{minutes}:{seconds} minute left_::_{minutes}:{seconds} minutes left_" : ["残り {minutes}:{seconds} 分"],
+ "_{seconds} second left_::_{seconds} seconds left_" : ["残り {seconds} 秒"]
},"pluralForm" :"nplurals=1; plural=0;"
} \ No newline at end of file
diff --git a/apps/files/l10n/tr.js b/apps/files/l10n/tr.js
index e46a11abb6c..71250b967e1 100644
--- a/apps/files/l10n/tr.js
+++ b/apps/files/l10n/tr.js
@@ -85,6 +85,7 @@ OC.L10N.register(
"{user} created {file}" : "{user} tarafından {file} oluşturuldu",
"You changed {file}" : "Siz {file} dosyasını değiştirdiniz",
"You deleted {file}" : "Siz {file} dosyasını sildiniz",
+ "{user} deleted {file}" : "{user} tarafından {file} silindi",
"A new file or folder has been <strong>created</strong>" : "Yeni bir dosya veya klasör <strong>oluşturuldu</strong>",
"Limit notifications about creation and changes to your <strong>favorite files</strong> <em>(Stream only)</em>" : "<strong>Sık kullanılan dosyalarınızın</strong> oluşturulma ve değiştirilme hakkındaki bildirimlerini sınırla <em>(Sadece akışta)</em>",
"Upload (max. %s)" : "Yükle (azami: %s)",
diff --git a/apps/files/l10n/tr.json b/apps/files/l10n/tr.json
index d5b70fa9b58..beaa034e6bc 100644
--- a/apps/files/l10n/tr.json
+++ b/apps/files/l10n/tr.json
@@ -83,6 +83,7 @@
"{user} created {file}" : "{user} tarafından {file} oluşturuldu",
"You changed {file}" : "Siz {file} dosyasını değiştirdiniz",
"You deleted {file}" : "Siz {file} dosyasını sildiniz",
+ "{user} deleted {file}" : "{user} tarafından {file} silindi",
"A new file or folder has been <strong>created</strong>" : "Yeni bir dosya veya klasör <strong>oluşturuldu</strong>",
"Limit notifications about creation and changes to your <strong>favorite files</strong> <em>(Stream only)</em>" : "<strong>Sık kullanılan dosyalarınızın</strong> oluşturulma ve değiştirilme hakkındaki bildirimlerini sınırla <em>(Sadece akışta)</em>",
"Upload (max. %s)" : "Yükle (azami: %s)",
diff --git a/apps/files_sharing/tests/TestCase.php b/apps/files_sharing/tests/TestCase.php
index a9163a086bf..3b1ccb71a94 100644
--- a/apps/files_sharing/tests/TestCase.php
+++ b/apps/files_sharing/tests/TestCase.php
@@ -75,7 +75,7 @@ abstract class TestCase extends \Test\TestCase {
// reset backend
\OC_User::clearBackends();
- \OC_Group::clearBackends();
+ \OC::$server->getGroupManager()->clearBackends();
// clear share hooks
\OC_Hook::clear('OCP\\Share');
@@ -103,7 +103,7 @@ abstract class TestCase extends \Test\TestCase {
$groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER3, 'group2');
$groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER4, 'group3');
$groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_GROUP1);
- \OC_Group::useBackend($groupBackend);
+ \OC::$server->getGroupManager()->addBackend($groupBackend);
}
protected function setUp() {
@@ -136,7 +136,10 @@ abstract class TestCase extends \Test\TestCase {
if ($user !== null) { $user->delete(); }
// delete group
- \OC_Group::deleteGroup(self::TEST_FILES_SHARING_API_GROUP1);
+ $group = \OC::$server->getGroupManager()->get(self::TEST_FILES_SHARING_API_GROUP1);
+ if ($group) {
+ $group->delete();
+ }
\OC_Util::tearDownFS();
\OC_User::setUserId('');
@@ -145,8 +148,8 @@ abstract class TestCase extends \Test\TestCase {
// reset backend
\OC_User::clearBackends();
\OC_User::useBackend('database');
- \OC_Group::clearBackends();
- \OC_Group::useBackend(new \OC\Group\Database());
+ \OC::$server->getGroupManager()->clearBackends();
+ \OC::$server->getGroupManager()->addBackend(new \OC\Group\Database());
parent::tearDownAfterClass();
}
@@ -163,9 +166,15 @@ abstract class TestCase extends \Test\TestCase {
}
if ($create) {
- \OC::$server->getUserManager()->createUser($user, $password);
- \OC_Group::createGroup('group');
- \OC_Group::addToGroup($user, 'group');
+ $userManager = \OC::$server->getUserManager();
+ $groupManager = \OC::$server->getGroupManager();
+
+ $userObject = $userManager->createUser($user, $password);
+ $group = $groupManager->createGroup('group');
+
+ if ($group and $userObject) {
+ $group->addUser($userObject);
+ }
}
self::resetStorage();
diff --git a/apps/systemtags/l10n/fr.js b/apps/systemtags/l10n/fr.js
index c8ae9d40962..cb20b2ecbc1 100644
--- a/apps/systemtags/l10n/fr.js
+++ b/apps/systemtags/l10n/fr.js
@@ -6,9 +6,9 @@ OC.L10N.register(
"Create" : "Créer",
"Select tag…" : "Sélectionner une étiquette…",
"Tagged files" : "Fichiers étiquetés",
- "Select tags to filter by" : "Sélectionner les étiquettes par lesquelles filtrer",
+ "Select tags to filter by" : "Sélectionner les étiquettes à filtrer",
"No tags found" : "Aucune étiquette trouvée",
- "Please select tags to filter by" : "Veuillez sélectionner les étiquettes par lesquelles filtrer",
+ "Please select tags to filter by" : "Veuillez sélectionner les étiquettes à filtrer",
"No files found for the selected tags" : "Aucun fichier pour les étiquettes sélectionnées",
"Added system tag %1$s" : "Étiquette collaborative %1$s ajoutée",
"Added system tag {systemtag}" : "Étiquette collaborative {systemtag} ajoutée",
diff --git a/apps/systemtags/l10n/fr.json b/apps/systemtags/l10n/fr.json
index 6bf4ef57225..8d7ffb1ae30 100644
--- a/apps/systemtags/l10n/fr.json
+++ b/apps/systemtags/l10n/fr.json
@@ -4,9 +4,9 @@
"Create" : "Créer",
"Select tag…" : "Sélectionner une étiquette…",
"Tagged files" : "Fichiers étiquetés",
- "Select tags to filter by" : "Sélectionner les étiquettes par lesquelles filtrer",
+ "Select tags to filter by" : "Sélectionner les étiquettes à filtrer",
"No tags found" : "Aucune étiquette trouvée",
- "Please select tags to filter by" : "Veuillez sélectionner les étiquettes par lesquelles filtrer",
+ "Please select tags to filter by" : "Veuillez sélectionner les étiquettes à filtrer",
"No files found for the selected tags" : "Aucun fichier pour les étiquettes sélectionnées",
"Added system tag %1$s" : "Étiquette collaborative %1$s ajoutée",
"Added system tag {systemtag}" : "Étiquette collaborative {systemtag} ajoutée",
diff --git a/apps/theming/l10n/hu.js b/apps/theming/l10n/hu.js
new file mode 100644
index 00000000000..a0549dfd06b
--- /dev/null
+++ b/apps/theming/l10n/hu.js
@@ -0,0 +1,27 @@
+OC.L10N.register(
+ "theming",
+ {
+ "Admin" : "Adminisztrátor",
+ "a safe home for all your data" : "biztonságos hely az adataid számára",
+ "The given name is too long" : "A bevitt név túl hosszú",
+ "The given web address is too long" : "A bevitt webcím túl hosszú",
+ "The given slogan is too long" : "A bevitt szlogen túl hosszú",
+ "The given color is invalid" : "A bevitt szín érvénytelen",
+ "Saved" : "Mentve!",
+ "No file uploaded" : "Nincs fájl feltöltve",
+ "Unsupported image type" : "Nem támogatott képtípus",
+ "You are already using a custom theme" : "Már egyedi témát használ",
+ "Theming" : "Témázás",
+ "Name" : "Név",
+ "reset to default" : "Visszaállítás alapértelmezettre",
+ "Web address" : "Webcím",
+ "Web address https://…" : "Webcím https://...",
+ "Slogan" : "Szlogen",
+ "Color" : "Szín",
+ "Logo" : "Logó",
+ "Upload new logo" : "Új logó feltöltése",
+ "Login image" : "Bejelentkező kép",
+ "Upload new login background" : "Új bejelentkező kép feltöltése",
+ "Log in image" : "Bejelentkező kép"
+},
+"nplurals=2; plural=(n != 1);");
diff --git a/apps/theming/l10n/hu.json b/apps/theming/l10n/hu.json
new file mode 100644
index 00000000000..6023637c81d
--- /dev/null
+++ b/apps/theming/l10n/hu.json
@@ -0,0 +1,25 @@
+{ "translations": {
+ "Admin" : "Adminisztrátor",
+ "a safe home for all your data" : "biztonságos hely az adataid számára",
+ "The given name is too long" : "A bevitt név túl hosszú",
+ "The given web address is too long" : "A bevitt webcím túl hosszú",
+ "The given slogan is too long" : "A bevitt szlogen túl hosszú",
+ "The given color is invalid" : "A bevitt szín érvénytelen",
+ "Saved" : "Mentve!",
+ "No file uploaded" : "Nincs fájl feltöltve",
+ "Unsupported image type" : "Nem támogatott képtípus",
+ "You are already using a custom theme" : "Már egyedi témát használ",
+ "Theming" : "Témázás",
+ "Name" : "Név",
+ "reset to default" : "Visszaállítás alapértelmezettre",
+ "Web address" : "Webcím",
+ "Web address https://…" : "Webcím https://...",
+ "Slogan" : "Szlogen",
+ "Color" : "Szín",
+ "Logo" : "Logó",
+ "Upload new logo" : "Új logó feltöltése",
+ "Login image" : "Bejelentkező kép",
+ "Upload new login background" : "Új bejelentkező kép feltöltése",
+ "Log in image" : "Bejelentkező kép"
+},"pluralForm" :"nplurals=2; plural=(n != 1);"
+} \ No newline at end of file
diff --git a/apps/theming/l10n/pt_BR.js b/apps/theming/l10n/pt_BR.js
index 35bafd769a3..7a2e6d9986b 100644
--- a/apps/theming/l10n/pt_BR.js
+++ b/apps/theming/l10n/pt_BR.js
@@ -1,7 +1,7 @@
OC.L10N.register(
"theming",
{
- "Admin" : "Admin",
+ "Admin" : "Administrador",
"a safe home for all your data" : "um lugar seguro para todos os seus dados",
"The given name is too long" : "O nome é demasiado longo",
"The given web address is too long" : "O endereço da Web fornecido é muito longo",
@@ -11,7 +11,7 @@ OC.L10N.register(
"No file uploaded" : "Nenhum arquivo enviado",
"Unsupported image type" : "Tipo de imagem não suportado",
"You are already using a custom theme" : "Você já está usando um tema personalizado",
- "Theming" : "Dando formato",
+ "Theming" : "Personalizando",
"Name" : "Nome",
"reset to default" : "restaurar ao padrão",
"Web address" : "Endereço da Web",
@@ -21,7 +21,7 @@ OC.L10N.register(
"Logo" : "Logo",
"Upload new logo" : "Enviar novo logotipo",
"Login image" : "Imagem de login",
- "Upload new login background" : "Enviar novo login em background",
- "Log in image" : "Log em imagem"
+ "Upload new login background" : "Enviar novo fundo para o login",
+ "Log in image" : "Imagem do login"
},
"nplurals=2; plural=(n > 1);");
diff --git a/apps/theming/l10n/pt_BR.json b/apps/theming/l10n/pt_BR.json
index d27c222635f..9396173e985 100644
--- a/apps/theming/l10n/pt_BR.json
+++ b/apps/theming/l10n/pt_BR.json
@@ -1,5 +1,5 @@
{ "translations": {
- "Admin" : "Admin",
+ "Admin" : "Administrador",
"a safe home for all your data" : "um lugar seguro para todos os seus dados",
"The given name is too long" : "O nome é demasiado longo",
"The given web address is too long" : "O endereço da Web fornecido é muito longo",
@@ -9,7 +9,7 @@
"No file uploaded" : "Nenhum arquivo enviado",
"Unsupported image type" : "Tipo de imagem não suportado",
"You are already using a custom theme" : "Você já está usando um tema personalizado",
- "Theming" : "Dando formato",
+ "Theming" : "Personalizando",
"Name" : "Nome",
"reset to default" : "restaurar ao padrão",
"Web address" : "Endereço da Web",
@@ -19,7 +19,7 @@
"Logo" : "Logo",
"Upload new logo" : "Enviar novo logotipo",
"Login image" : "Imagem de login",
- "Upload new login background" : "Enviar novo login em background",
- "Log in image" : "Log em imagem"
+ "Upload new login background" : "Enviar novo fundo para o login",
+ "Log in image" : "Imagem do login"
},"pluralForm" :"nplurals=2; plural=(n > 1);"
} \ No newline at end of file
diff --git a/apps/twofactor_backupcodes/l10n/tr.js b/apps/twofactor_backupcodes/l10n/tr.js
index a5c93acebfd..ff68c827c78 100644
--- a/apps/twofactor_backupcodes/l10n/tr.js
+++ b/apps/twofactor_backupcodes/l10n/tr.js
@@ -10,9 +10,12 @@ OC.L10N.register(
"If you regenerate backup codes, you automatically invalidate old codes." : "Yedek kodlarını yeniden oluşturursanız, eski kodlar geçersiz olur.",
"An error occurred while generating your backup codes" : "Yedek kodlar oluşturulurken bir sorun çıktı",
"Nextcloud backup codes" : "Nextcloud yedek kodları",
- "Two-factor authentication" : "Iki faktörlü kimlik doğrulama",
- "Backup code" : "Yedek kodu",
- "Use backup code" : "Yedek kodunu kullan",
+ "Two-factor authentication" : "Iki aşamalı kimlik doğrulama",
+ "You successfully logged in using two-factor authentication (%1$s)" : "İki aşamalı kimlik doğrulama ile oturum açtınız (%1$s)",
+ "A login attempt using two-factor authentication failed (%1$s)" : "İki aşamalı kimlik doğrulama ile oturum açma girişimi reddedildi (%1$s)",
+ "You created two-factor backup codes for your account" : "İki aşamalı kimlik doğrulama için yedek kodlarınızı oluşturdunuz",
+ "Backup code" : "Yedek kod",
+ "Use backup code" : "Yedek kodu kullan",
"Second-factor backup codes" : "İki aşamalı yedek kodları"
},
"nplurals=2; plural=(n > 1);");
diff --git a/apps/twofactor_backupcodes/l10n/tr.json b/apps/twofactor_backupcodes/l10n/tr.json
index 44c86cd60cc..fb392c867ff 100644
--- a/apps/twofactor_backupcodes/l10n/tr.json
+++ b/apps/twofactor_backupcodes/l10n/tr.json
@@ -8,9 +8,12 @@
"If you regenerate backup codes, you automatically invalidate old codes." : "Yedek kodlarını yeniden oluşturursanız, eski kodlar geçersiz olur.",
"An error occurred while generating your backup codes" : "Yedek kodlar oluşturulurken bir sorun çıktı",
"Nextcloud backup codes" : "Nextcloud yedek kodları",
- "Two-factor authentication" : "Iki faktörlü kimlik doğrulama",
- "Backup code" : "Yedek kodu",
- "Use backup code" : "Yedek kodunu kullan",
+ "Two-factor authentication" : "Iki aşamalı kimlik doğrulama",
+ "You successfully logged in using two-factor authentication (%1$s)" : "İki aşamalı kimlik doğrulama ile oturum açtınız (%1$s)",
+ "A login attempt using two-factor authentication failed (%1$s)" : "İki aşamalı kimlik doğrulama ile oturum açma girişimi reddedildi (%1$s)",
+ "You created two-factor backup codes for your account" : "İki aşamalı kimlik doğrulama için yedek kodlarınızı oluşturdunuz",
+ "Backup code" : "Yedek kod",
+ "Use backup code" : "Yedek kodu kullan",
"Second-factor backup codes" : "İki aşamalı yedek kodları"
},"pluralForm" :"nplurals=2; plural=(n > 1);"
} \ No newline at end of file
diff --git a/apps/updatenotification/l10n/bg.js b/apps/updatenotification/l10n/bg.js
new file mode 100644
index 00000000000..784b2bb2f36
--- /dev/null
+++ b/apps/updatenotification/l10n/bg.js
@@ -0,0 +1,24 @@
+OC.L10N.register(
+ "updatenotification",
+ {
+ "Update notifications" : "Известия за обновления",
+ "Could not start updater, please try the manual update" : "Актуализиращата програма не беше стартирана. Моля, опитайте ръчно обновление",
+ "{version} is available. Get more information on how to update." : "{version} е налична. Намерете повече информация за това как да актуализирате.",
+ "Channel updated" : "Канала е променен",
+ "Update to %1$s is available." : "Обновление към %1$s е налично.",
+ "Update for %1$s to version %2$s is available." : "Обновление за %1$s към версия %2$s е налично.",
+ "Update for {app} to version %s is available." : "Обновление за {app} до версия %s е налично.",
+ "A new version is available: %s" : "Налична е нова версия: %s",
+ "Open updater" : "Отвори актуализиращата програма",
+ "Download now" : "Изтегляне сега",
+ "Your version is up to date." : "Вие разполагате с последна версия",
+ "Checked on %s" : "Проверено за %s",
+ "Update channel:" : "Канал за обновяване:",
+ "You can always update to a newer version / experimental channel. But you can never downgrade to a more stable channel." : "Винаги може да оновите до по-нова версия / експирементален канал. Но неможете вече да върнете до по-стабилен канал..",
+ "Notify members of the following groups about available updates:" : "Известие до потребители от следните групи относно налични обновления:",
+ "Only notification for app updates are available." : "Налични са само уведомления за актуализации на приложенията.",
+ "The selected update channel makes dedicated notifications for the server obsolete." : "Избрания канал за обновления прави уведомленията за този сървър остарели.",
+ "The selected update channel does not support updates of the server." : "Избрания канал за обновления не поддържа сървърни актуализации.",
+ "You are running PHP %s. To allow you to upgrade to Nextcloud 11 and higher you need to run at least PHP 5.6. Once you upgraded your PHP version you will be able to receive update notifications for these newer versions." : "Вие използвате PHP %s. Актуализиране към Nextcloud 11 и по-висока версия изисква като минимум PHP 5.6. Само след като обновите версията на PHP ще бъдете в състояние да получавате известия за актуализации за тези нови версии."
+},
+"nplurals=2; plural=(n != 1);");
diff --git a/apps/updatenotification/l10n/bg.json b/apps/updatenotification/l10n/bg.json
new file mode 100644
index 00000000000..912ee8460b4
--- /dev/null
+++ b/apps/updatenotification/l10n/bg.json
@@ -0,0 +1,22 @@
+{ "translations": {
+ "Update notifications" : "Известия за обновления",
+ "Could not start updater, please try the manual update" : "Актуализиращата програма не беше стартирана. Моля, опитайте ръчно обновление",
+ "{version} is available. Get more information on how to update." : "{version} е налична. Намерете повече информация за това как да актуализирате.",
+ "Channel updated" : "Канала е променен",
+ "Update to %1$s is available." : "Обновление към %1$s е налично.",
+ "Update for %1$s to version %2$s is available." : "Обновление за %1$s към версия %2$s е налично.",
+ "Update for {app} to version %s is available." : "Обновление за {app} до версия %s е налично.",
+ "A new version is available: %s" : "Налична е нова версия: %s",
+ "Open updater" : "Отвори актуализиращата програма",
+ "Download now" : "Изтегляне сега",
+ "Your version is up to date." : "Вие разполагате с последна версия",
+ "Checked on %s" : "Проверено за %s",
+ "Update channel:" : "Канал за обновяване:",
+ "You can always update to a newer version / experimental channel. But you can never downgrade to a more stable channel." : "Винаги може да оновите до по-нова версия / експирементален канал. Но неможете вече да върнете до по-стабилен канал..",
+ "Notify members of the following groups about available updates:" : "Известие до потребители от следните групи относно налични обновления:",
+ "Only notification for app updates are available." : "Налични са само уведомления за актуализации на приложенията.",
+ "The selected update channel makes dedicated notifications for the server obsolete." : "Избрания канал за обновления прави уведомленията за този сървър остарели.",
+ "The selected update channel does not support updates of the server." : "Избрания канал за обновления не поддържа сървърни актуализации.",
+ "You are running PHP %s. To allow you to upgrade to Nextcloud 11 and higher you need to run at least PHP 5.6. Once you upgraded your PHP version you will be able to receive update notifications for these newer versions." : "Вие използвате PHP %s. Актуализиране към Nextcloud 11 и по-висока версия изисква като минимум PHP 5.6. Само след като обновите версията на PHP ще бъдете в състояние да получавате известия за актуализации за тези нови версии."
+},"pluralForm" :"nplurals=2; plural=(n != 1);"
+} \ No newline at end of file
diff --git a/apps/updatenotification/l10n/tr.js b/apps/updatenotification/l10n/tr.js
index b5160c7b6b3..21e5fde7504 100644
--- a/apps/updatenotification/l10n/tr.js
+++ b/apps/updatenotification/l10n/tr.js
@@ -18,6 +18,7 @@ OC.L10N.register(
"Notify members of the following groups about available updates:" : "Yayınlanan güncellemeler şu grupların üyelerine bildirilsin:",
"Only notification for app updates are available." : "Yalnız uygulama güncellemeleri kullanılabilir.",
"The selected update channel makes dedicated notifications for the server obsolete." : "Seçilmiş güncelleme kanalı kullanımdan kalkmış sunucu bildirimleri için kullanılıyor.",
- "The selected update channel does not support updates of the server." : "Seçilmiş güncelleme kanalı sunucunun güncellemelerini desteklemiyor."
+ "The selected update channel does not support updates of the server." : "Seçilmiş güncelleme kanalı sunucunun güncellemelerini desteklemiyor.",
+ "You are running PHP %s. To allow you to upgrade to Nextcloud 11 and higher you need to run at least PHP 5.6. Once you upgraded your PHP version you will be able to receive update notifications for these newer versions." : "PHP %s sürümünü kullanıyorsanız. Nextcloud 11 ve üzerindeki sürümleri kullanabilmek için PHP sürümünüz en az 5.6 olmalıdır. PHP sürümünüzü yükselttikten sonra yeni sürümler ile ilgili güncelleme bildirimlerini görebilirsiniz."
},
"nplurals=2; plural=(n > 1);");
diff --git a/apps/updatenotification/l10n/tr.json b/apps/updatenotification/l10n/tr.json
index 7eba40df793..d5536cf6da2 100644
--- a/apps/updatenotification/l10n/tr.json
+++ b/apps/updatenotification/l10n/tr.json
@@ -16,6 +16,7 @@
"Notify members of the following groups about available updates:" : "Yayınlanan güncellemeler şu grupların üyelerine bildirilsin:",
"Only notification for app updates are available." : "Yalnız uygulama güncellemeleri kullanılabilir.",
"The selected update channel makes dedicated notifications for the server obsolete." : "Seçilmiş güncelleme kanalı kullanımdan kalkmış sunucu bildirimleri için kullanılıyor.",
- "The selected update channel does not support updates of the server." : "Seçilmiş güncelleme kanalı sunucunun güncellemelerini desteklemiyor."
+ "The selected update channel does not support updates of the server." : "Seçilmiş güncelleme kanalı sunucunun güncellemelerini desteklemiyor.",
+ "You are running PHP %s. To allow you to upgrade to Nextcloud 11 and higher you need to run at least PHP 5.6. Once you upgraded your PHP version you will be able to receive update notifications for these newer versions." : "PHP %s sürümünü kullanıyorsanız. Nextcloud 11 ve üzerindeki sürümleri kullanabilmek için PHP sürümünüz en az 5.6 olmalıdır. PHP sürümünüzü yükselttikten sonra yeni sürümler ile ilgili güncelleme bildirimlerini görebilirsiniz."
},"pluralForm" :"nplurals=2; plural=(n > 1);"
} \ No newline at end of file
diff --git a/apps/user_ldap/appinfo/app.php b/apps/user_ldap/appinfo/app.php
index 995b1226649..6f930ea39f0 100644
--- a/apps/user_ldap/appinfo/app.php
+++ b/apps/user_ldap/appinfo/app.php
@@ -58,7 +58,7 @@ if(count($configPrefixes) === 1) {
if(count($configPrefixes) > 0) {
// register user backend
OC_User::useBackend($userBackend);
- OC_Group::useBackend($groupBackend);
+ \OC::$server->getGroupManager()->addBackend($groupBackend);
}
\OCP\Util::connectHook(
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index cc0446ae523..ff95d96ebdb 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -570,7 +570,7 @@ class Access extends LDAPUtility implements IUserTools {
$originalTTL = $this->connection->ldapCacheTTL;
$this->connection->setConfiguration(array('ldapCacheTTL' => 0));
if(($isUser && !\OCP\User::userExists($intName))
- || (!$isUser && !\OC_Group::groupExists($intName))) {
+ || (!$isUser && !\OC::$server->getGroupManager()->groupExists($intName))) {
if($mapper->map($fdn, $intName, $uuid)) {
$this->connection->setConfiguration(array('ldapCacheTTL' => $originalTTL));
return $intName;
@@ -737,7 +737,7 @@ class Access extends LDAPUtility implements IUserTools {
// Check to be really sure it is unique
// while loop is just a precaution. If a name is not generated within
// 20 attempts, something else is very wrong. Avoids infinite loop.
- if(!\OC_Group::groupExists($altName)) {
+ if(!\OC::$server->getGroupManager()->groupExists($altName)) {
return $altName;
}
$altName = $name . '_' . ($lastNo + $attempts);
diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php
index 606eff4e7a7..f1a23f9a6c8 100644
--- a/apps/user_ldap/tests/User_LDAPTest.php
+++ b/apps/user_ldap/tests/User_LDAPTest.php
@@ -64,7 +64,7 @@ class User_LDAPTest extends TestCase {
parent::setUp();
\OC_User::clearBackends();
- \OC_Group::clearBackends();
+ \OC::$server->getGroupManager()->clearBackends();
}
/**
diff --git a/apps/workflowengine/l10n/bg.js b/apps/workflowengine/l10n/bg.js
index ec24d4f01ae..abd148bd827 100644
--- a/apps/workflowengine/l10n/bg.js
+++ b/apps/workflowengine/l10n/bg.js
@@ -13,6 +13,7 @@ OC.L10N.register(
"less" : "по-малко",
"less or equals" : "по-малко или равно",
"greater or equals" : "по-голямо или равно",
+ "greater" : "по-голям",
"File system tag" : "Таг на файлова система",
"is tagged with" : "е тагнат с",
"is not tagged with" : "не е тагнат с",
diff --git a/apps/workflowengine/l10n/bg.json b/apps/workflowengine/l10n/bg.json
index 492410c9bf4..155250ecb34 100644
--- a/apps/workflowengine/l10n/bg.json
+++ b/apps/workflowengine/l10n/bg.json
@@ -11,6 +11,7 @@
"less" : "по-малко",
"less or equals" : "по-малко или равно",
"greater or equals" : "по-голямо или равно",
+ "greater" : "по-голям",
"File system tag" : "Таг на файлова система",
"is tagged with" : "е тагнат с",
"is not tagged with" : "не е тагнат с",
diff --git a/apps/workflowengine/l10n/tr.js b/apps/workflowengine/l10n/tr.js
new file mode 100644
index 00000000000..d07c5471fe7
--- /dev/null
+++ b/apps/workflowengine/l10n/tr.js
@@ -0,0 +1,71 @@
+OC.L10N.register(
+ "workflowengine",
+ {
+ "Successfully saved" : "Kaydedildi",
+ "Saving failed:" : "Kaydedilemedi:",
+ "File mime type" : "Dosya MIME türü",
+ "is" : "şu olan",
+ "is not" : "şu olmayan",
+ "matches" : "şuna uyan",
+ "does not match" : "şuna uymayan",
+ "Example: {placeholder}" : "Örnek: {placeholder}",
+ "File size (upload)" : "Dosya boyutu (yükleme)",
+ "less" : "şundan küçük",
+ "less or equals" : "şundan küçük ya da eşit",
+ "greater or equals" : "şundan büyük ya da eşit",
+ "greater" : "şundan büyük",
+ "File system tag" : "Dosya sistemi etiketi",
+ "is tagged with" : "şununla etiketlenmiş",
+ "is not tagged with" : "şununla etiketlenmemiş",
+ "Select tag…" : "Etiketi seçin...",
+ "Request remote address" : "Uzak adres isteği",
+ "matches IPv4" : "şu IPv4 adresine uyan",
+ "does not match IPv4" : "şu IPv4 adresine uymayan",
+ "matches IPv6" : "şu IPv6 adresine uyan",
+ "does not match IPv6" : "şu IPv6 adresine uymayan",
+ "Request time" : "İstek zamanı",
+ "between" : "şunların arasında olan",
+ "not between" : "şunların arasında olmayan",
+ "Start" : "Başlangıç",
+ "End" : "Bitiş",
+ "Select timezone…" : "Saat dilimini seçin...",
+ "Request URL" : "İstek Adresi",
+ "Predefined URLs" : "Hazır Adresler",
+ "Files WebDAV" : "Dosya WebDAV",
+ "Request user agent" : "Kullanıcı yazılımı istensin",
+ "Sync clients" : "İstemciler eşitlensin",
+ "Android client" : "Android istemcisi",
+ "iOS client" : "iOS istemcisi",
+ "Desktop client" : "Masaüstü istemcisi",
+ "User group membership" : "Kullanıcı grubu üyeliği",
+ "is member of" : "şunun üyesi olan",
+ "is not member of" : "şunun üyesi olmayan",
+ "The given operator is invalid" : "Belirtilen işlem geçersiz",
+ "The given regular expression is invalid" : "Belirtilen kurallı ifade geçersiz",
+ "The given file size is invalid" : "Belirtilen dosya boyutu geçersiz",
+ "The given tag id is invalid" : "Belirtilen etiket kodu geçersiz",
+ "The given IP range is invalid" : "Belirtilen IP adresi aralığı geçersiz",
+ "The given IP range is not valid for IPv4" : "Belirtilen IP adresi aralığı IPv4 için geçersiz",
+ "The given IP range is not valid for IPv6" : "Belirtilen IP adresi aralığı IPv6 için geçersiz",
+ "The given time span is invalid" : "Belirtilen zaman aralığı geçersiz",
+ "The given start time is invalid" : "Belirtilen başlangıç zamanı geçersiz",
+ "The given end time is invalid" : "Belirtilen bitiş zamanı geçersiz",
+ "The given group does not exist" : "Belirtilen grup bulunamadı",
+ "Check %s is invalid or does not exist" : "%s denetimi geçersiz ya da bulunamadı",
+ "Operation #%s does not exist" : "#%s işlemi bulunamadı",
+ "Operation %s does not exist" : "%s işlemi bulunamadı",
+ "Operation %s is invalid" : "%s işlemi geçersiz",
+ "Check %s does not exist" : "%s denetimi bulunamadı",
+ "Check %s is invalid" : "%s denetimi geçersiz",
+ "Check #%s does not exist" : "#%s denetimi bulunamadı",
+ "Workflow" : "İş akışı",
+ "Open documentation" : "Belgeleri aç",
+ "Add rule group" : "Kural grubu ekle",
+ "Short rule description" : "Kısa kural açıklaması",
+ "Add rule" : "Kural ekle",
+ "Reset" : "Sıfırla",
+ "Save" : "Kaydet",
+ "Saving…" : "Kaydediliyor...",
+ "Loading…" : "Yükleniyor..."
+},
+"nplurals=2; plural=(n > 1);");
diff --git a/apps/workflowengine/l10n/tr.json b/apps/workflowengine/l10n/tr.json
new file mode 100644
index 00000000000..8996dffcb95
--- /dev/null
+++ b/apps/workflowengine/l10n/tr.json
@@ -0,0 +1,69 @@
+{ "translations": {
+ "Successfully saved" : "Kaydedildi",
+ "Saving failed:" : "Kaydedilemedi:",
+ "File mime type" : "Dosya MIME türü",
+ "is" : "şu olan",
+ "is not" : "şu olmayan",
+ "matches" : "şuna uyan",
+ "does not match" : "şuna uymayan",
+ "Example: {placeholder}" : "Örnek: {placeholder}",
+ "File size (upload)" : "Dosya boyutu (yükleme)",
+ "less" : "şundan küçük",
+ "less or equals" : "şundan küçük ya da eşit",
+ "greater or equals" : "şundan büyük ya da eşit",
+ "greater" : "şundan büyük",
+ "File system tag" : "Dosya sistemi etiketi",
+ "is tagged with" : "şununla etiketlenmiş",
+ "is not tagged with" : "şununla etiketlenmemiş",
+ "Select tag…" : "Etiketi seçin...",
+ "Request remote address" : "Uzak adres isteği",
+ "matches IPv4" : "şu IPv4 adresine uyan",
+ "does not match IPv4" : "şu IPv4 adresine uymayan",
+ "matches IPv6" : "şu IPv6 adresine uyan",
+ "does not match IPv6" : "şu IPv6 adresine uymayan",
+ "Request time" : "İstek zamanı",
+ "between" : "şunların arasında olan",
+ "not between" : "şunların arasında olmayan",
+ "Start" : "Başlangıç",
+ "End" : "Bitiş",
+ "Select timezone…" : "Saat dilimini seçin...",
+ "Request URL" : "İstek Adresi",
+ "Predefined URLs" : "Hazır Adresler",
+ "Files WebDAV" : "Dosya WebDAV",
+ "Request user agent" : "Kullanıcı yazılımı istensin",
+ "Sync clients" : "İstemciler eşitlensin",
+ "Android client" : "Android istemcisi",
+ "iOS client" : "iOS istemcisi",
+ "Desktop client" : "Masaüstü istemcisi",
+ "User group membership" : "Kullanıcı grubu üyeliği",
+ "is member of" : "şunun üyesi olan",
+ "is not member of" : "şunun üyesi olmayan",
+ "The given operator is invalid" : "Belirtilen işlem geçersiz",
+ "The given regular expression is invalid" : "Belirtilen kurallı ifade geçersiz",
+ "The given file size is invalid" : "Belirtilen dosya boyutu geçersiz",
+ "The given tag id is invalid" : "Belirtilen etiket kodu geçersiz",
+ "The given IP range is invalid" : "Belirtilen IP adresi aralığı geçersiz",
+ "The given IP range is not valid for IPv4" : "Belirtilen IP adresi aralığı IPv4 için geçersiz",
+ "The given IP range is not valid for IPv6" : "Belirtilen IP adresi aralığı IPv6 için geçersiz",
+ "The given time span is invalid" : "Belirtilen zaman aralığı geçersiz",
+ "The given start time is invalid" : "Belirtilen başlangıç zamanı geçersiz",
+ "The given end time is invalid" : "Belirtilen bitiş zamanı geçersiz",
+ "The given group does not exist" : "Belirtilen grup bulunamadı",
+ "Check %s is invalid or does not exist" : "%s denetimi geçersiz ya da bulunamadı",
+ "Operation #%s does not exist" : "#%s işlemi bulunamadı",
+ "Operation %s does not exist" : "%s işlemi bulunamadı",
+ "Operation %s is invalid" : "%s işlemi geçersiz",
+ "Check %s does not exist" : "%s denetimi bulunamadı",
+ "Check %s is invalid" : "%s denetimi geçersiz",
+ "Check #%s does not exist" : "#%s denetimi bulunamadı",
+ "Workflow" : "İş akışı",
+ "Open documentation" : "Belgeleri aç",
+ "Add rule group" : "Kural grubu ekle",
+ "Short rule description" : "Kısa kural açıklaması",
+ "Add rule" : "Kural ekle",
+ "Reset" : "Sıfırla",
+ "Save" : "Kaydet",
+ "Saving…" : "Kaydediliyor...",
+ "Loading…" : "Yükleniyor..."
+},"pluralForm" :"nplurals=2; plural=(n > 1);"
+} \ No newline at end of file
diff --git a/apps/workflowengine/lib/AppInfo/Application.php b/apps/workflowengine/lib/AppInfo/Application.php
index e968b40612f..28e32092419 100644
--- a/apps/workflowengine/lib/AppInfo/Application.php
+++ b/apps/workflowengine/lib/AppInfo/Application.php
@@ -48,6 +48,8 @@ class Application extends \OCP\AppFramework\App {
]);
script('core', [
+ 'files/fileinfo',
+ 'files/client',
'oc-backbone-webdav',
'systemtags/systemtags',
'systemtags/systemtagmodel',
diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php
index 4a985840e60..8608fffd4e2 100644
--- a/apps/workflowengine/lib/Check/FileMimeType.php
+++ b/apps/workflowengine/lib/Check/FileMimeType.php
@@ -76,13 +76,22 @@ class FileMimeType extends AbstractStringCheck {
return $this->mimeType[$this->storage->getId()][$this->path];
}
- $this->mimeType[$this->storage->getId()][$this->path] = '';
if ($this->isWebDAVRequest()) {
if ($this->request->getMethod() === 'PUT') {
$path = $this->request->getPathInfo();
$this->mimeType[$this->storage->getId()][$this->path] = $this->mimeTypeDetector->detectPath($path);
return $this->mimeType[$this->storage->getId()][$this->path];
}
+ } else if ($this->isPublicWebDAVRequest()) {
+ if ($this->request->getMethod() === 'PUT') {
+ $path = $this->request->getPathInfo();
+ if (strpos($path, '/webdav/') === 0) {
+ $path = substr($path, strlen('/webdav'));
+ }
+ $path = $this->path . $path;
+ $this->mimeType[$this->storage->getId()][$path] = $this->mimeTypeDetector->detectPath($path);
+ return $this->mimeType[$this->storage->getId()][$path];
+ }
}
if (in_array($this->request->getMethod(), ['POST', 'PUT'])) {
@@ -159,4 +168,14 @@ class FileMimeType extends AbstractStringCheck {
strpos($this->request->getPathInfo(), '/dav/files/') === 0
);
}
+
+ /**
+ * @return bool
+ */
+ protected function isPublicWebDAVRequest() {
+ return substr($this->request->getScriptName(), 0 - strlen('/public.php')) === '/public.php' && (
+ $this->request->getPathInfo() === '/webdav' ||
+ strpos($this->request->getPathInfo(), '/webdav/') === 0
+ );
+ }
}