diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/CachingTree.php | 39 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/ObjectTree.php | 6 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/Server.php | 1 | ||||
-rw-r--r-- | apps/dav/lib/Files/FileSearchBackend.php | 15 | ||||
-rw-r--r-- | apps/dav/lib/Server.php | 3 | ||||
-rw-r--r-- | apps/dav/tests/unit/Files/FileSearchBackendTest.php | 6 | ||||
-rw-r--r-- | apps/files/l10n/en_GB.js | 3 | ||||
-rw-r--r-- | apps/files/l10n/en_GB.json | 3 | ||||
-rw-r--r-- | apps/files/l10n/lt_LT.js | 2 | ||||
-rw-r--r-- | apps/files/l10n/lt_LT.json | 2 | ||||
-rw-r--r-- | apps/files_external/tests/Service/StoragesServiceTest.php | 15 | ||||
-rw-r--r-- | apps/sharebymail/lib/ShareByMailProvider.php | 9 | ||||
-rw-r--r-- | apps/theming/css/theming.scss | 14 | ||||
-rw-r--r-- | apps/user_ldap/lib/Wizard.php | 2 |
14 files changed, 86 insertions, 34 deletions
diff --git a/apps/dav/lib/Connector/Sabre/CachingTree.php b/apps/dav/lib/Connector/Sabre/CachingTree.php new file mode 100644 index 00000000000..80c8311fed3 --- /dev/null +++ b/apps/dav/lib/Connector/Sabre/CachingTree.php @@ -0,0 +1,39 @@ +<?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\Connector\Sabre; + +use Sabre\DAV\Tree; + +class CachingTree extends Tree { + /** + * Store a node in the cache + * + * @param Node $node + * @param null|string $path + */ + public function cacheNode(Node $node, $path = null) { + if (is_null($path)) { + $path = $node->getPath(); + } + $this->cache[trim($path, '/')] = $node; + } +} diff --git a/apps/dav/lib/Connector/Sabre/ObjectTree.php b/apps/dav/lib/Connector/Sabre/ObjectTree.php index 3371c655f29..a44b25c24cb 100644 --- a/apps/dav/lib/Connector/Sabre/ObjectTree.php +++ b/apps/dav/lib/Connector/Sabre/ObjectTree.php @@ -39,7 +39,7 @@ use OCP\Files\StorageInvalidException; use OCP\Files\StorageNotAvailableException; use OCP\Lock\LockedException; -class ObjectTree extends \Sabre\DAV\Tree { +class ObjectTree extends CachingTree { /** * @var \OC\Files\View @@ -97,10 +97,6 @@ class ObjectTree extends \Sabre\DAV\Tree { return $path; } - public function cacheNode(Node $node) { - $this->cache[trim($node->getPath(), '/')] = $node; - } - /** * Returns the INode object for the requested path * diff --git a/apps/dav/lib/Connector/Sabre/Server.php b/apps/dav/lib/Connector/Sabre/Server.php index 9915ffdba03..686b0ea7604 100644 --- a/apps/dav/lib/Connector/Sabre/Server.php +++ b/apps/dav/lib/Connector/Sabre/Server.php @@ -33,6 +33,7 @@ namespace OCA\DAV\Connector\Sabre; * @see \Sabre\DAV\Server */ class Server extends \Sabre\DAV\Server { + /** @var CachingTree $tree */ /** * @see \Sabre\DAV\Server diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php index 0d837807fd8..515e7ed0121 100644 --- a/apps/dav/lib/Files/FileSearchBackend.php +++ b/apps/dav/lib/Files/FileSearchBackend.php @@ -26,6 +26,7 @@ use OC\Files\Search\SearchComparison; use OC\Files\Search\SearchOrder; use OC\Files\Search\SearchQuery; use OC\Files\View; +use OCA\DAV\Connector\Sabre\CachingTree; use OCA\DAV\Connector\Sabre\Directory; use OCA\DAV\Connector\Sabre\FilesPlugin; use OCA\DAV\Connector\Sabre\TagsPlugin; @@ -39,7 +40,6 @@ 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; @@ -49,7 +49,7 @@ use SearchDAV\XML\Operator; use SearchDAV\XML\Order; class FileSearchBackend implements ISearchBackend { - /** @var Tree */ + /** @var CachingTree */ private $tree; /** @var IUser */ @@ -67,14 +67,14 @@ class FileSearchBackend implements ISearchBackend { /** * FileSearchBackend constructor. * - * @param Tree $tree + * @param CachingTree $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) { + public function __construct(CachingTree $tree, IUser $user, IRootFolder $rootFolder, IManager $shareManager, View $view) { $this->tree = $tree; $this->user = $user; $this->rootFolder = $rootFolder; @@ -157,10 +157,13 @@ class FileSearchBackend implements ISearchBackend { 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)); + $davNode = new \OCA\DAV\Connector\Sabre\Directory($this->view, $node, $this->tree, $this->shareManager); } else { - return new SearchResult(new \OCA\DAV\Connector\Sabre\File($this->view, $node, $this->shareManager), $this->getHrefForNode($node)); + $davNode = new \OCA\DAV\Connector\Sabre\File($this->view, $node, $this->shareManager); } + $path = $this->getHrefForNode($node); + $this->tree->cacheNode($davNode, $path); + return new SearchResult($davNode, $path); }, $results); } diff --git a/apps/dav/lib/Server.php b/apps/dav/lib/Server.php index 30c0a4afbd7..ac0abc8b4eb 100644 --- a/apps/dav/lib/Server.php +++ b/apps/dav/lib/Server.php @@ -36,6 +36,7 @@ use OCA\DAV\Comments\CommentsPlugin; use OCA\DAV\Connector\Sabre\Auth; use OCA\DAV\Connector\Sabre\BearerAuth; use OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin; +use OCA\DAV\Connector\Sabre\CachingTree; use OCA\DAV\Connector\Sabre\CommentPropertiesPlugin; use OCA\DAV\Connector\Sabre\CopyEtagHeaderPlugin; use OCA\DAV\Connector\Sabre\DavAclPlugin; @@ -77,7 +78,7 @@ class Server { $timezone = new TimeFactory(); $root = new RootCollection(); - $this->server = new \OCA\DAV\Connector\Sabre\Server($root); + $this->server = new \OCA\DAV\Connector\Sabre\Server(new CachingTree($root)); // Add maintenance plugin $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin(\OC::$server->getConfig())); diff --git a/apps/dav/tests/unit/Files/FileSearchBackendTest.php b/apps/dav/tests/unit/Files/FileSearchBackendTest.php index 7de92c59763..28b6f082712 100644 --- a/apps/dav/tests/unit/Files/FileSearchBackendTest.php +++ b/apps/dav/tests/unit/Files/FileSearchBackendTest.php @@ -24,6 +24,7 @@ namespace OCA\DAV\Tests\Files; use OC\Files\Search\SearchComparison; use OC\Files\Search\SearchQuery; use OC\Files\View; +use OCA\DAV\Connector\Sabre\CachingTree; use OCA\DAV\Connector\Sabre\Directory; use OCA\DAV\Connector\Sabre\File; use OCA\DAV\Connector\Sabre\FilesPlugin; @@ -34,7 +35,6 @@ 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; @@ -42,7 +42,7 @@ use SearchDAV\XML\Scope; use Test\TestCase; class FileSearchBackendTest extends TestCase { - /** @var Tree|\PHPUnit_Framework_MockObject_MockObject */ + /** @var CachingTree|\PHPUnit_Framework_MockObject_MockObject */ private $tree; /** @var IUser */ @@ -74,7 +74,7 @@ class FileSearchBackendTest extends TestCase { ->method('getUID') ->willReturn('test'); - $this->tree = $this->getMockBuilder(Tree::class) + $this->tree = $this->getMockBuilder(CachingTree::class) ->disableOriginalConstructor() ->getMock(); diff --git a/apps/files/l10n/en_GB.js b/apps/files/l10n/en_GB.js index 7862757e38c..4736520eb43 100644 --- a/apps/files/l10n/en_GB.js +++ b/apps/files/l10n/en_GB.js @@ -16,6 +16,8 @@ OC.L10N.register( "Not enough free space, you are uploading {size1} but only {size2} is left" : "Not enough free space, you are uploading {size1} but only {size2} is left", "Target folder \"{dir}\" does not exist any more" : "Target folder \"{dir}\" does not exist any more", "Not enough free space" : "Not enough free space", + "Uploading …" : "Uploading …", + "…" : "…", "{loadedSize} of {totalSize} ({bitrate})" : "{loadedSize} of {totalSize} ({bitrate})", "Actions" : "Actions", "Download" : "Download", @@ -117,6 +119,7 @@ OC.L10N.register( "Show hidden files" : "Show hidden files", "WebDAV" : "WebDAV", "Use this address to <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">access your Files via WebDAV</a>" : "Use this address to <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">access your Files via WebDAV</a>", + "Uploading @" : "Uploading @", "No files in here" : "No files in here", "Upload some content or sync with your devices!" : "Upload some content or sync with your devices!", "No entries found in this folder" : "No entries found in this folder", diff --git a/apps/files/l10n/en_GB.json b/apps/files/l10n/en_GB.json index 4c93aa6dace..f346459ac85 100644 --- a/apps/files/l10n/en_GB.json +++ b/apps/files/l10n/en_GB.json @@ -14,6 +14,8 @@ "Not enough free space, you are uploading {size1} but only {size2} is left" : "Not enough free space, you are uploading {size1} but only {size2} is left", "Target folder \"{dir}\" does not exist any more" : "Target folder \"{dir}\" does not exist any more", "Not enough free space" : "Not enough free space", + "Uploading …" : "Uploading …", + "…" : "…", "{loadedSize} of {totalSize} ({bitrate})" : "{loadedSize} of {totalSize} ({bitrate})", "Actions" : "Actions", "Download" : "Download", @@ -115,6 +117,7 @@ "Show hidden files" : "Show hidden files", "WebDAV" : "WebDAV", "Use this address to <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">access your Files via WebDAV</a>" : "Use this address to <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">access your Files via WebDAV</a>", + "Uploading @" : "Uploading @", "No files in here" : "No files in here", "Upload some content or sync with your devices!" : "Upload some content or sync with your devices!", "No entries found in this folder" : "No entries found in this folder", diff --git a/apps/files/l10n/lt_LT.js b/apps/files/l10n/lt_LT.js index 472dcc80b25..1eb213481c1 100644 --- a/apps/files/l10n/lt_LT.js +++ b/apps/files/l10n/lt_LT.js @@ -16,6 +16,8 @@ OC.L10N.register( "Not enough free space, you are uploading {size1} but only {size2} is left" : "Nepakanka laisvos vietos. Jūs bandote įkelti {size1} dydžio bylą, bet liko tik {size2} vietos", "Target folder \"{dir}\" does not exist any more" : "Paskirties aplanko \"{dir}\" daugiau nebėra", "Not enough free space" : "Trūksta laisvos vietos", + "Uploading …" : "Įkeliama ...", + "…" : "...", "{loadedSize} of {totalSize} ({bitrate})" : "{loadedSize} iš {totalSize} ({bitrate})", "Actions" : "Veiksmai", "Download" : "Atsisiųsti", diff --git a/apps/files/l10n/lt_LT.json b/apps/files/l10n/lt_LT.json index bdd60647db0..c3eb472a141 100644 --- a/apps/files/l10n/lt_LT.json +++ b/apps/files/l10n/lt_LT.json @@ -14,6 +14,8 @@ "Not enough free space, you are uploading {size1} but only {size2} is left" : "Nepakanka laisvos vietos. Jūs bandote įkelti {size1} dydžio bylą, bet liko tik {size2} vietos", "Target folder \"{dir}\" does not exist any more" : "Paskirties aplanko \"{dir}\" daugiau nebėra", "Not enough free space" : "Trūksta laisvos vietos", + "Uploading …" : "Įkeliama ...", + "…" : "...", "{loadedSize} of {totalSize} ({bitrate})" : "{loadedSize} iš {totalSize} ({bitrate})", "Actions" : "Veiksmai", "Download" : "Atsisiųsti", diff --git a/apps/files_external/tests/Service/StoragesServiceTest.php b/apps/files_external/tests/Service/StoragesServiceTest.php index 2776f24d5ab..056a03d24c8 100644 --- a/apps/files_external/tests/Service/StoragesServiceTest.php +++ b/apps/files_external/tests/Service/StoragesServiceTest.php @@ -22,10 +22,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ + namespace OCA\Files_External\Tests\Service; use \OC\Files\Filesystem; +use OCA\Files_External\Lib\Auth\InvalidAuth; +use OCA\Files_External\Lib\Backend\InvalidBackend; use OCA\Files_External\NotFoundException; use OCA\Files_External\Lib\StorageConfig; use OCA\Files_External\Service\BackendService; @@ -368,28 +371,24 @@ abstract class StoragesServiceTest extends \Test\TestCase { $this->assertEquals($priority, $storage->getPriority()); } - /** - * @expectedException \InvalidArgumentException - */ public function testCreateStorageInvalidClass() { - $this->service->createStorage( + $storage = $this->service->createStorage( 'mount', 'identifier:\OC\Not\A\Backend', 'identifier:\Auth\Mechanism', [] ); + $this->assertInstanceOf(InvalidBackend::class, $storage->getBackend()); } - /** - * @expectedException \InvalidArgumentException - */ public function testCreateStorageInvalidAuthMechanismClass() { - $this->service->createStorage( + $storage = $this->service->createStorage( 'mount', 'identifier:\OCA\Files_External\Lib\Backend\SMB', 'identifier:\Not\An\Auth\Mechanism', [] ); + $this->assertInstanceOf(InvalidAuth::class, $storage->getAuthMechanism()); } public function testGetStoragesBackendNotVisible() { diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index e5ae64ba120..9a0678f5fe7 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -384,8 +384,7 @@ class ShareByMailProvider implements IShareProvider { $message = $this->mailer->createMessage(); - $emailTemplate = $this->mailer->createEMailTemplate(); - $emailTemplate->setMetaData('sharebymail.RecipientNotification', [ + $emailTemplate = $this->mailer->createEMailTemplate('sharebymail.RecipientNotification', [ 'filename' => $filename, 'link' => $link, 'initiator' => $initiatorDisplayName, @@ -462,8 +461,7 @@ class ShareByMailProvider implements IShareProvider { $message = $this->mailer->createMessage(); - $emailTemplate = $this->mailer->createEMailTemplate(); - $emailTemplate->setMetaData('sharebymail.RecipientPasswordNotification', [ + $emailTemplate = $this->mailer->createEMailTemplate('sharebymail.RecipientPasswordNotification', [ 'filename' => $filename, 'password' => $password, 'initiator' => $initiatorDisplayName, @@ -530,8 +528,7 @@ class ShareByMailProvider implements IShareProvider { $bodyPart = $this->l->t("You just shared »%s« with %s. The share was already send to the recipient. Due to the security policies defined by the administrator of %s each share needs to be protected by password and it is not allowed to send the password directly to the recipient. Therefore you need to forward the password manually to the recipient.", [$filename, $shareWith, $this->defaults->getName()]); $message = $this->mailer->createMessage(); - $emailTemplate = $this->mailer->createEMailTemplate(); - $emailTemplate->setMetaData('sharebymail.OwnerPasswordNotification', [ + $emailTemplate = $this->mailer->createEMailTemplate('sharebymail.OwnerPasswordNotification', [ 'filename' => $filename, 'password' => $password, 'initiator' => $initiatorDisplayName, diff --git a/apps/theming/css/theming.scss b/apps/theming/css/theming.scss index 480872354b5..f36ff69e42b 100644 --- a/apps/theming/css/theming.scss +++ b/apps/theming/css/theming.scss @@ -31,13 +31,18 @@ #body-login { - input { + input, + #alternative-logins li a { border: 1px solid nc-lighten($color-primary-text, 50%); } - input.primary { + input.primary, + #alternative-logins li a { background-color: $color-primary; } - a, label, p { + a, + label, + p, + #alternative-logins legend { color: $color-primary-text !important; } input[type='checkbox'].checkbox--white + label:before { @@ -83,7 +88,8 @@ background-color: $color-primary; } -input.primary { +input.primary, +#alternative-logins li a { background-color: $color-primary-element; border: 1px solid $color-primary-text; color: $color-primary-text; diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php index 9d4da9cbf3f..7376507d134 100644 --- a/apps/user_ldap/lib/Wizard.php +++ b/apps/user_ldap/lib/Wizard.php @@ -419,7 +419,7 @@ class Wizard extends LDAPUtility { * @throws \Exception */ public function fetchGroups($dbKey, $confKey) { - $obclasses = array('posixGroup', 'group', 'zimbraDistributionList', 'groupOfNames'); + $obclasses = array('posixGroup', 'group', 'zimbraDistributionList', 'groupOfNames', 'groupOfUniqueNames'); $filterParts = array(); foreach($obclasses as $obclass) { |