Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/admin_audit/composer/composer/autoload_classmap.php2
-rw-r--r--apps/admin_audit/composer/composer/autoload_static.php2
-rw-r--r--apps/admin_audit/lib/Actions/Action.php6
-rw-r--r--apps/admin_audit/lib/AppInfo/Application.php51
-rw-r--r--apps/admin_audit/lib/AuditLogger.php88
-rw-r--r--apps/admin_audit/lib/IAuditLogger.php32
-rw-r--r--apps/admin_audit/tests/Actions/SecurityTest.php2
-rw-r--r--apps/dav/l10n/cs.js1
-rw-r--r--apps/dav/l10n/cs.json1
-rw-r--r--apps/dav/l10n/pl.js1
-rw-r--r--apps/dav/l10n/pl.json1
-rw-r--r--apps/dav/l10n/tr.js2
-rw-r--r--apps/dav/l10n/tr.json2
-rw-r--r--apps/dav/l10n/zh_TW.js1
-rw-r--r--apps/dav/l10n/zh_TW.json1
-rw-r--r--apps/dav/lib/Connector/Sabre/Directory.php3
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php71
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php21
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php8
-rw-r--r--apps/federatedfilesharing/lib/Controller/RequestHandlerController.php18
-rw-r--r--apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php10
-rw-r--r--apps/files_trashbin/l10n/tr.js1
-rw-r--r--apps/files_trashbin/l10n/tr.json1
-rw-r--r--apps/settings/l10n/tr.js4
-rw-r--r--apps/settings/l10n/tr.json4
-rw-r--r--apps/settings/lib/Controller/AuthSettingsController.php8
-rw-r--r--apps/user_ldap/css/settings.css14
-rw-r--r--apps/user_ldap/lib/Access.php68
-rw-r--r--apps/user_ldap/lib/Connection.php38
-rw-r--r--apps/user_ldap/lib/Group_LDAP.php2
-rw-r--r--apps/user_ldap/lib/ILDAPWrapper.php6
-rw-r--r--apps/user_ldap/lib/LDAP.php88
-rw-r--r--apps/user_ldap/lib/Mapping/AbstractMapping.php6
-rw-r--r--apps/user_ldap/lib/Migration/Version1130Date20211102154716.php4
-rw-r--r--apps/user_ldap/lib/User/User.php7
-rw-r--r--apps/user_ldap/tests/AccessTest.php6
-rw-r--r--apps/user_ldap/tests/Group_LDAPTest.php34
-rw-r--r--apps/user_ldap/tests/User/UserTest.php8
-rw-r--r--apps/user_ldap/tests/User_LDAPTest.php16
-rw-r--r--apps/user_ldap/tests/WizardTest.php2
-rw-r--r--apps/workflowengine/lib/Manager.php2
-rw-r--r--apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php2
-rw-r--r--core/Controller/ClientFlowLoginController.php17
-rw-r--r--core/l10n/cs.js4
-rw-r--r--core/l10n/cs.json4
-rw-r--r--core/l10n/hu.js5
-rw-r--r--core/l10n/hu.json5
-rw-r--r--core/l10n/pl.js5
-rw-r--r--core/l10n/pl.json5
-rw-r--r--core/l10n/tr.js5
-rw-r--r--core/l10n/tr.json5
-rw-r--r--core/l10n/zh_CN.js8
-rw-r--r--core/l10n/zh_CN.json8
-rw-r--r--core/l10n/zh_TW.js5
-rw-r--r--core/l10n/zh_TW.json5
-rw-r--r--core/templates/loginflow/authpicker.php5
-rw-r--r--core/templates/loginflow/grant.php15
-rw-r--r--lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php3
-rw-r--r--lib/private/Authentication/Token/IProvider.php2
-rw-r--r--lib/private/Authentication/Token/Manager.php6
-rw-r--r--lib/private/Authentication/Token/PublicKeyTokenProvider.php4
-rw-r--r--lib/private/Collaboration/Collaborators/LookupPlugin.php1
-rw-r--r--lib/private/Console/TimestampFormatter.php5
-rw-r--r--lib/private/Files/Cache/Storage.php1
-rw-r--r--lib/private/Files/ObjectStore/S3.php1
-rw-r--r--lib/private/Files/ObjectStore/S3ConnectionTrait.php13
-rw-r--r--lib/private/Files/View.php6
-rw-r--r--lib/private/Preview/Bundled.php2
-rw-r--r--lib/private/Security/CertificateManager.php18
-rw-r--r--lib/private/Share20/DefaultShareProvider.php15
-rw-r--r--lib/private/legacy/OC_Helper.php4
-rw-r--r--tests/Core/Controller/ClientFlowLoginControllerTest.php2
-rw-r--r--tests/lib/Authentication/Token/ManagerTest.php31
-rw-r--r--tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php83
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/ManagerTest.php48
-rw-r--r--tests/lib/Collaboration/Collaborators/LookupPluginTest.php12
76 files changed, 652 insertions, 351 deletions
diff --git a/apps/admin_audit/composer/composer/autoload_classmap.php b/apps/admin_audit/composer/composer/autoload_classmap.php
index 2373bb90797..fc4be52ebbb 100644
--- a/apps/admin_audit/composer/composer/autoload_classmap.php
+++ b/apps/admin_audit/composer/composer/autoload_classmap.php
@@ -19,6 +19,8 @@ return array(
'OCA\\AdminAudit\\Actions\\UserManagement' => $baseDir . '/../lib/Actions/UserManagement.php',
'OCA\\AdminAudit\\Actions\\Versions' => $baseDir . '/../lib/Actions/Versions.php',
'OCA\\AdminAudit\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
+ 'OCA\\AdminAudit\\AuditLogger' => $baseDir . '/../lib/AuditLogger.php',
'OCA\\AdminAudit\\BackgroundJobs\\Rotate' => $baseDir . '/../lib/BackgroundJobs/Rotate.php',
+ 'OCA\\AdminAudit\\IAuditLogger' => $baseDir . '/../lib/IAuditLogger.php',
'OCA\\AdminAudit\\Listener\\CriticalActionPerformedEventListener' => $baseDir . '/../lib/Listener/CriticalActionPerformedEventListener.php',
);
diff --git a/apps/admin_audit/composer/composer/autoload_static.php b/apps/admin_audit/composer/composer/autoload_static.php
index 829bc2ab049..38518c8a9ba 100644
--- a/apps/admin_audit/composer/composer/autoload_static.php
+++ b/apps/admin_audit/composer/composer/autoload_static.php
@@ -34,7 +34,9 @@ class ComposerStaticInitAdminAudit
'OCA\\AdminAudit\\Actions\\UserManagement' => __DIR__ . '/..' . '/../lib/Actions/UserManagement.php',
'OCA\\AdminAudit\\Actions\\Versions' => __DIR__ . '/..' . '/../lib/Actions/Versions.php',
'OCA\\AdminAudit\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
+ 'OCA\\AdminAudit\\AuditLogger' => __DIR__ . '/..' . '/../lib/AuditLogger.php',
'OCA\\AdminAudit\\BackgroundJobs\\Rotate' => __DIR__ . '/..' . '/../lib/BackgroundJobs/Rotate.php',
+ 'OCA\\AdminAudit\\IAuditLogger' => __DIR__ . '/..' . '/../lib/IAuditLogger.php',
'OCA\\AdminAudit\\Listener\\CriticalActionPerformedEventListener' => __DIR__ . '/..' . '/../lib/Listener/CriticalActionPerformedEventListener.php',
);
diff --git a/apps/admin_audit/lib/Actions/Action.php b/apps/admin_audit/lib/Actions/Action.php
index 17be0fb8197..0eaf06b8c0f 100644
--- a/apps/admin_audit/lib/Actions/Action.php
+++ b/apps/admin_audit/lib/Actions/Action.php
@@ -28,13 +28,13 @@ declare(strict_types=1);
*/
namespace OCA\AdminAudit\Actions;
-use Psr\Log\LoggerInterface;
+use OCA\AdminAudit\IAuditLogger;
class Action {
- /** @var LoggerInterface */
+ /** @var IAuditLogger */
private $logger;
- public function __construct(LoggerInterface $logger) {
+ public function __construct(IAuditLogger $logger) {
$this->logger = $logger;
}
diff --git a/apps/admin_audit/lib/AppInfo/Application.php b/apps/admin_audit/lib/AppInfo/Application.php
index 594e1c7f2c4..1160d151710 100644
--- a/apps/admin_audit/lib/AppInfo/Application.php
+++ b/apps/admin_audit/lib/AppInfo/Application.php
@@ -48,6 +48,8 @@ use OCA\AdminAudit\Actions\Sharing;
use OCA\AdminAudit\Actions\Trashbin;
use OCA\AdminAudit\Actions\UserManagement;
use OCA\AdminAudit\Actions\Versions;
+use OCA\AdminAudit\AuditLogger;
+use OCA\AdminAudit\IAuditLogger;
use OCA\AdminAudit\Listener\CriticalActionPerformedEventListener;
use OCP\App\ManagerEvent;
use OCP\AppFramework\App;
@@ -65,6 +67,7 @@ use OCP\Log\Audit\CriticalActionPerformedEvent;
use OCP\Log\ILogFactory;
use OCP\Share;
use OCP\Util;
+use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
@@ -79,14 +82,16 @@ class Application extends App implements IBootstrap {
}
public function register(IRegistrationContext $context): void {
+ $context->registerService(IAuditLogger::class, function (ContainerInterface $c) {
+ return new AuditLogger($c->get(ILogFactory::class), $c->get(Iconfig::class));
+ });
+
$context->registerEventListener(CriticalActionPerformedEvent::class, CriticalActionPerformedEventListener::class);
}
public function boot(IBootContext $context): void {
- /** @var LoggerInterface $logger */
- $logger = $context->injectFn(
- Closure::fromCallable([$this, 'getLogger'])
- );
+ /** @var IAuditLogger $logger */
+ $logger = $context->getAppContainer()->get(IAuditLogger::class);
/*
* TODO: once the hooks are migrated to lazy events, this should be done
@@ -95,26 +100,10 @@ class Application extends App implements IBootstrap {
$this->registerHooks($logger, $context->getServerContainer());
}
- private function getLogger(IConfig $config,
- ILogFactory $logFactory): LoggerInterface {
- $auditType = $config->getSystemValueString('log_type_audit', 'file');
- $defaultTag = $config->getSystemValueString('syslog_tag', 'Nextcloud');
- $auditTag = $config->getSystemValueString('syslog_tag_audit', $defaultTag);
- $logFile = $config->getSystemValueString('logfile_audit', '');
-
- if ($auditType === 'file' && !$logFile) {
- $default = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/audit.log';
- // Legacy way was appconfig, now it's paralleled with the normal log config
- $logFile = $config->getAppValue('admin_audit', 'logfile', $default);
- }
-
- return $logFactory->getCustomPsrLogger($logFile, $auditType, $auditTag);
- }
-
/**
* Register hooks in order to log them
*/
- private function registerHooks(LoggerInterface $logger,
+ private function registerHooks(IAuditLogger $logger,
IServerContainer $serverContainer): void {
$this->userManagementHooks($logger, $serverContainer->get(IUserSession::class));
$this->groupHooks($logger, $serverContainer->get(IGroupManager::class));
@@ -134,7 +123,7 @@ class Application extends App implements IBootstrap {
$this->securityHooks($logger, $eventDispatcher);
}
- private function userManagementHooks(LoggerInterface $logger,
+ private function userManagementHooks(IAuditLogger $logger,
IUserSession $userSession): void {
$userActions = new UserManagement($logger);
@@ -148,7 +137,7 @@ class Application extends App implements IBootstrap {
$userSession->listen('\OC\User', 'postUnassignedUserId', [$userActions, 'unassign']);
}
- private function groupHooks(LoggerInterface $logger,
+ private function groupHooks(IAuditLogger $logger,
IGroupManager $groupManager): void {
$groupActions = new GroupManagement($logger);
@@ -159,7 +148,7 @@ class Application extends App implements IBootstrap {
$groupManager->listen('\OC\Group', 'postCreate', [$groupActions, 'createGroup']);
}
- private function sharingHooks(LoggerInterface $logger): void {
+ private function sharingHooks(IAuditLogger $logger): void {
$shareActions = new Sharing($logger);
Util::connectHook(Share::class, 'post_shared', $shareActions, 'shared');
@@ -171,7 +160,7 @@ class Application extends App implements IBootstrap {
Util::connectHook(Share::class, 'share_link_access', $shareActions, 'shareAccessed');
}
- private function authHooks(LoggerInterface $logger): void {
+ private function authHooks(IAuditLogger $logger): void {
$authActions = new Auth($logger);
Util::connectHook('OC_User', 'pre_login', $authActions, 'loginAttempt');
@@ -179,7 +168,7 @@ class Application extends App implements IBootstrap {
Util::connectHook('OC_User', 'logout', $authActions, 'logout');
}
- private function appHooks(LoggerInterface $logger,
+ private function appHooks(IAuditLogger $logger,
EventDispatcherInterface $eventDispatcher): void {
$eventDispatcher->addListener(ManagerEvent::EVENT_APP_ENABLE, function (ManagerEvent $event) use ($logger) {
$appActions = new AppManagement($logger);
@@ -195,7 +184,7 @@ class Application extends App implements IBootstrap {
});
}
- private function consoleHooks(LoggerInterface $logger,
+ private function consoleHooks(IAuditLogger $logger,
EventDispatcherInterface $eventDispatcher): void {
$eventDispatcher->addListener(ConsoleEvent::EVENT_RUN, function (ConsoleEvent $event) use ($logger) {
$appActions = new Console($logger);
@@ -203,7 +192,7 @@ class Application extends App implements IBootstrap {
});
}
- private function fileHooks(LoggerInterface $logger,
+ private function fileHooks(IAuditLogger $logger,
EventDispatcherInterface $eventDispatcher): void {
$fileActions = new Files($logger);
$eventDispatcher->addListener(
@@ -265,19 +254,19 @@ class Application extends App implements IBootstrap {
);
}
- private function versionsHooks(LoggerInterface $logger): void {
+ private function versionsHooks(IAuditLogger $logger): void {
$versionsActions = new Versions($logger);
Util::connectHook('\OCP\Versions', 'rollback', $versionsActions, 'rollback');
Util::connectHook('\OCP\Versions', 'delete', $versionsActions, 'delete');
}
- private function trashbinHooks(LoggerInterface $logger): void {
+ private function trashbinHooks(IAuditLogger $logger): void {
$trashActions = new Trashbin($logger);
Util::connectHook('\OCP\Trashbin', 'preDelete', $trashActions, 'delete');
Util::connectHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', $trashActions, 'restore');
}
- private function securityHooks(LoggerInterface $logger,
+ private function securityHooks(IAuditLogger $logger,
EventDispatcherInterface $eventDispatcher): void {
$eventDispatcher->addListener(IProvider::EVENT_SUCCESS, function (GenericEvent $event) use ($logger) {
$security = new Security($logger);
diff --git a/apps/admin_audit/lib/AuditLogger.php b/apps/admin_audit/lib/AuditLogger.php
new file mode 100644
index 00000000000..0a7a330a743
--- /dev/null
+++ b/apps/admin_audit/lib/AuditLogger.php
@@ -0,0 +1,88 @@
+<?php
+/**
+ * @copyright Copyright (c) 2022 Carl Schwan <carl@carlschwan.eu>
+ *
+ * @author Carl Schwan <carl@carlschwan.eu>
+ *
+ * @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\AdminAudit;
+
+use OCP\IConfig;
+use OCP\Log\ILogFactory;
+use Psr\Log\LoggerInterface;
+
+/**
+ * Logger that logs in the audit log file instead of the normal log file
+ */
+class AuditLogger implements IAuditLogger {
+
+ /** @var LoggerInterface */
+ private $parentLogger;
+
+ public function __construct(ILogFactory $logFactory, IConfig $config) {
+ $auditType = $config->getSystemValueString('log_type_audit', 'file');
+ $defaultTag = $config->getSystemValueString('syslog_tag', 'Nextcloud');
+ $auditTag = $config->getSystemValueString('syslog_tag_audit', $defaultTag);
+ $logFile = $config->getSystemValueString('logfile_audit', '');
+
+ if ($auditType === 'file' && !$logFile) {
+ $default = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/audit.log';
+ // Legacy way was appconfig, now it's paralleled with the normal log config
+ $logFile = $config->getAppValue('admin_audit', 'logfile', $default);
+ }
+
+ $this->parentLogger = $logFactory->getCustomPsrLogger($logFile, $auditType, $auditTag);
+ }
+
+ public function emergency($message, array $context = array()) {
+ $this->parentLogger->emergency($message, $context);
+ }
+
+ public function alert($message, array $context = array()) {
+ $this->parentLogger->alert($message, $context);
+ }
+
+ public function critical($message, array $context = array()) {
+ $this->parentLogger->critical($message, $context);
+ }
+
+ public function error($message, array $context = array()) {
+ $this->parentLogger->error($message, $context);
+ }
+
+ public function warning($message, array $context = array()) {
+ $this->parentLogger->warning($message, $context);
+ }
+
+ public function notice($message, array $context = array()) {
+ $this->parentLogger->notice($message, $context);
+ }
+
+ public function info($message, array $context = array()) {
+ $this->parentLogger->info($message, $context);
+ }
+
+ public function debug($message, array $context = array()) {
+ $this->parentLogger->debug($message, $context);
+ }
+
+ public function log($level, $message, array $context = array()) {
+ $this->parentLogger->log($level, $message, $context);
+ }
+}
diff --git a/apps/admin_audit/lib/IAuditLogger.php b/apps/admin_audit/lib/IAuditLogger.php
new file mode 100644
index 00000000000..b55d36b942d
--- /dev/null
+++ b/apps/admin_audit/lib/IAuditLogger.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * @copyright Copyright (c) 2022 Carl Schwan <carl@carlschwan.eu>
+ *
+ * @author Carl Schwan <carl@carlschwan.eu>
+ *
+ * @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\AdminAudit;
+
+use Psr\Log\LoggerInterface;
+
+/**
+ * Interface for a logger that logs in the audit log file instead of the normal log file
+ */
+interface IAuditLogger extends LoggerInterface {
+}
diff --git a/apps/admin_audit/tests/Actions/SecurityTest.php b/apps/admin_audit/tests/Actions/SecurityTest.php
index aa9d9713768..604d2276fb2 100644
--- a/apps/admin_audit/tests/Actions/SecurityTest.php
+++ b/apps/admin_audit/tests/Actions/SecurityTest.php
@@ -44,7 +44,7 @@ class SecurityTest extends TestCase {
protected function setUp(): void {
parent::setUp();
- $this->logger = $this->createMock(LoggerInterface::class);
+ $this->logger = $this->createMock(AuditLogger::class);
$this->security = new Security($this->logger);
$this->user = $this->createMock(IUser::class);
diff --git a/apps/dav/l10n/cs.js b/apps/dav/l10n/cs.js
index 5b7ea906260..69d0de5f453 100644
--- a/apps/dav/l10n/cs.js
+++ b/apps/dav/l10n/cs.js
@@ -137,6 +137,7 @@ OC.L10N.register(
"Due on %s by %s" : "Termín do %s od %s",
"Due on %s" : "Termín do %s",
"Migrated calendar (%1$s)" : "Přesunut kalendář (%1$s)",
+ "Calendars including events, details and attendees" : "Kalendáře včetně událostí, podrobností a účastníků",
"Contacts and groups" : "Kontakty a skupiny",
"WebDAV" : "WebDAV",
"WebDAV endpoint" : "WebDAV endpoint",
diff --git a/apps/dav/l10n/cs.json b/apps/dav/l10n/cs.json
index 46d083fa035..c3e555519be 100644
--- a/apps/dav/l10n/cs.json
+++ b/apps/dav/l10n/cs.json
@@ -135,6 +135,7 @@
"Due on %s by %s" : "Termín do %s od %s",
"Due on %s" : "Termín do %s",
"Migrated calendar (%1$s)" : "Přesunut kalendář (%1$s)",
+ "Calendars including events, details and attendees" : "Kalendáře včetně událostí, podrobností a účastníků",
"Contacts and groups" : "Kontakty a skupiny",
"WebDAV" : "WebDAV",
"WebDAV endpoint" : "WebDAV endpoint",
diff --git a/apps/dav/l10n/pl.js b/apps/dav/l10n/pl.js
index 03c14a1b50b..e9fd91268fc 100644
--- a/apps/dav/l10n/pl.js
+++ b/apps/dav/l10n/pl.js
@@ -137,6 +137,7 @@ OC.L10N.register(
"Due on %s by %s" : "Na dzień %s w %s",
"Due on %s" : "Na dzień %s",
"Migrated calendar (%1$s)" : "Przeniesiony kalendarz (%1$s)",
+ "Calendars including events, details and attendees" : "Kalendarze zawierające wydarzenia, szczegóły i uczestników",
"Contacts and groups" : "Kontakty i grupy",
"WebDAV" : "WebDAV",
"WebDAV endpoint" : "Adres WebDAV",
diff --git a/apps/dav/l10n/pl.json b/apps/dav/l10n/pl.json
index 147447993f1..4ea51401e82 100644
--- a/apps/dav/l10n/pl.json
+++ b/apps/dav/l10n/pl.json
@@ -135,6 +135,7 @@
"Due on %s by %s" : "Na dzień %s w %s",
"Due on %s" : "Na dzień %s",
"Migrated calendar (%1$s)" : "Przeniesiony kalendarz (%1$s)",
+ "Calendars including events, details and attendees" : "Kalendarze zawierające wydarzenia, szczegóły i uczestników",
"Contacts and groups" : "Kontakty i grupy",
"WebDAV" : "WebDAV",
"WebDAV endpoint" : "Adres WebDAV",
diff --git a/apps/dav/l10n/tr.js b/apps/dav/l10n/tr.js
index 8f9f15d1de2..aa21694e64e 100644
--- a/apps/dav/l10n/tr.js
+++ b/apps/dav/l10n/tr.js
@@ -137,6 +137,8 @@ OC.L10N.register(
"Due on %s by %s" : "%s tarihine kadar %s tarafından",
"Due on %s" : "%s tarihine kadar",
"Migrated calendar (%1$s)" : "Aktarılmış takvim (%1$s)",
+ "Calendars including events, details and attendees" : "Etkinlikler, bilgiler ve katılımcılar ile takvimler",
+ "Contacts and groups" : "Kişiler ve gruplar",
"WebDAV" : "WebDAV",
"WebDAV endpoint" : "WebDAV bağlantı noktası",
"Availability" : "Kullanılabilirlik",
diff --git a/apps/dav/l10n/tr.json b/apps/dav/l10n/tr.json
index 7b640b0178b..b80217bfa8d 100644
--- a/apps/dav/l10n/tr.json
+++ b/apps/dav/l10n/tr.json
@@ -135,6 +135,8 @@
"Due on %s by %s" : "%s tarihine kadar %s tarafından",
"Due on %s" : "%s tarihine kadar",
"Migrated calendar (%1$s)" : "Aktarılmış takvim (%1$s)",
+ "Calendars including events, details and attendees" : "Etkinlikler, bilgiler ve katılımcılar ile takvimler",
+ "Contacts and groups" : "Kişiler ve gruplar",
"WebDAV" : "WebDAV",
"WebDAV endpoint" : "WebDAV bağlantı noktası",
"Availability" : "Kullanılabilirlik",
diff --git a/apps/dav/l10n/zh_TW.js b/apps/dav/l10n/zh_TW.js
index 621c28b18bb..414eaad4c01 100644
--- a/apps/dav/l10n/zh_TW.js
+++ b/apps/dav/l10n/zh_TW.js
@@ -137,6 +137,7 @@ OC.L10N.register(
"Due on %s by %s" : "到期於 %s 由 %s",
"Due on %s" : "到期於 %s",
"Migrated calendar (%1$s)" : "已導入的行事曆 (%1$s)",
+ "Calendars including events, details and attendees" : "行事曆,包含事件、詳細資訊及參與者",
"Contacts and groups" : "聯絡人與群組",
"WebDAV" : "WebDAV",
"WebDAV endpoint" : "WebDAV 端點",
diff --git a/apps/dav/l10n/zh_TW.json b/apps/dav/l10n/zh_TW.json
index ff5ee940010..29dd4133fc5 100644
--- a/apps/dav/l10n/zh_TW.json
+++ b/apps/dav/l10n/zh_TW.json
@@ -135,6 +135,7 @@
"Due on %s by %s" : "到期於 %s 由 %s",
"Due on %s" : "到期於 %s",
"Migrated calendar (%1$s)" : "已導入的行事曆 (%1$s)",
+ "Calendars including events, details and attendees" : "行事曆,包含事件、詳細資訊及參與者",
"Contacts and groups" : "聯絡人與群組",
"WebDAV" : "WebDAV",
"WebDAV endpoint" : "WebDAV 端點",
diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php
index 3ae4416d363..bd92b3b22a4 100644
--- a/apps/dav/lib/Connector/Sabre/Directory.php
+++ b/apps/dav/lib/Connector/Sabre/Directory.php
@@ -327,8 +327,7 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node implements \Sabre\DAV\ICol
return $this->quotaInfo;
}
try {
- $info = $this->fileView->getFileInfo($this->path, false);
- $storageInfo = \OC_Helper::getStorageInfo($this->info->getPath(), $info);
+ $storageInfo = \OC_Helper::getStorageInfo($this->info->getPath(), $this->info, false);
if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
$free = \OCP\Files\FileInfo::SPACE_UNLIMITED;
} else {
diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php
index 5ff5f831eb5..b324e64918f 100644
--- a/apps/dav/lib/Connector/Sabre/File.php
+++ b/apps/dav/lib/Connector/Sabre/File.php
@@ -43,6 +43,7 @@ use OC\AppFramework\Http\Request;
use OC\Files\Filesystem;
use OC\Files\Stream\HashWrapper;
use OC\Files\View;
+use OCA\DAV\AppInfo\Application;
use OCA\DAV\Connector\Sabre\Exception\EntityTooLarge;
use OCA\DAV\Connector\Sabre\Exception\FileLocked;
use OCA\DAV\Connector\Sabre\Exception\Forbidden as DAVForbiddenException;
@@ -59,7 +60,9 @@ use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
use OCP\Files\Storage;
use OCP\Files\StorageNotAvailableException;
+use OCP\IL10N;
use OCP\ILogger;
+use OCP\L10N\IFactory as IL10NFactory;
use OCP\Lock\ILockingProvider;
use OCP\Lock\LockedException;
use OCP\Share\IManager;
@@ -74,6 +77,9 @@ use Sabre\DAV\IFile;
class File extends Node implements IFile {
protected $request;
+ /** @var IL10N */
+ protected $l10n;
+
/**
* Sets up the node, expects a full path name
*
@@ -85,6 +91,11 @@ class File extends Node implements IFile {
public function __construct(View $view, FileInfo $info, IManager $shareManager = null, Request $request = null) {
parent::__construct($view, $info, $shareManager);
+ // Querying IL10N directly results in a dependency loop
+ /** @var IL10NFactory $l10nFactory */
+ $l10nFactory = \OC::$server->get(IL10NFactory::class);
+ $this->l10n = $l10nFactory->get(Application::APP_ID);
+
if (isset($request)) {
$this->request = $request;
} else {
@@ -127,7 +138,7 @@ class File extends Node implements IFile {
throw new Forbidden();
}
} catch (StorageNotAvailableException $e) {
- throw new ServiceUnavailable("File is not updatable: " . $e->getMessage());
+ throw new ServiceUnavailable($this->l10n->t('File is not updatable: %1$s', [$e->getMessage()]));
}
// verify path of the target
@@ -161,7 +172,7 @@ class File extends Node implements IFile {
$partFilePath = $this->path;
if ($view && !$this->emitPreHooks($exists)) {
- throw new Exception('Could not write to final file, canceled by hook');
+ throw new Exception($this->l10n->t('Could not write to final file, canceled by hook'));
}
}
@@ -220,7 +231,7 @@ class File extends Node implements IFile {
if ($target === false) {
\OC::$server->getLogger()->error('\OC\Files\Filesystem::fopen() failed', ['app' => 'webdav']);
// because we have no clue about the cause we can only throw back a 500/Internal Server Error
- throw new Exception('Could not write file contents');
+ throw new Exception($this->l10n->t('Could not write file contents'));
}
[$count, $result] = \OC_Helper::streamCopy($data, $target);
fclose($target);
@@ -232,7 +243,15 @@ class File extends Node implements IFile {
$expected = $_SERVER['CONTENT_LENGTH'];
}
if ($expected !== "0") {
- throw new Exception('Error while copying file to target location (copied bytes: ' . $count . ', expected filesize: ' . $expected . ' )');
+ throw new Exception(
+ $this->l10n->t(
+ 'Error while copying file to target location (copied: %1$s, expected filesize: %2$s)',
+ [
+ $this->l10n->n('%n byte', '%n bytes', $count),
+ $this->l10n->n('%n byte', '%n bytes', $expected),
+ ],
+ )
+ );
}
}
@@ -242,7 +261,15 @@ class File extends Node implements IFile {
if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['REQUEST_METHOD'] === 'PUT') {
$expected = (int)$_SERVER['CONTENT_LENGTH'];
if ($count !== $expected) {
- throw new BadRequest('Expected filesize of ' . $expected . ' bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) ' . $count . ' bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.');
+ throw new BadRequest(
+ $this->l10n->t(
+ 'Expected filesize of %1$s but read (from Nextcloud client) and wrote (to Nextcloud storage) %2$s. Could either be a network problem on the sending side or a problem writing to the storage on the server side.',
+ [
+ $this->l10n->n('%n byte', '%n bytes', $expected),
+ $this->l10n->n('%n byte', '%n bytes', $count),
+ ],
+ )
+ );
}
}
} catch (\Exception $e) {
@@ -263,7 +290,7 @@ class File extends Node implements IFile {
if ($needsPartFile) {
if ($view && !$this->emitPreHooks($exists)) {
$partStorage->unlink($internalPartPath);
- throw new Exception('Could not rename part file to final file, canceled by hook');
+ throw new Exception($this->l10n->t('Could not rename part file to final file, canceled by hook'));
}
try {
$this->changeLock(ILockingProvider::LOCK_EXCLUSIVE);
@@ -292,7 +319,7 @@ class File extends Node implements IFile {
$fileExists = $storage->file_exists($internalPath);
if ($renameOkay === false || $fileExists === false) {
\OC::$server->getLogger()->error('renaming part file to final file failed $renameOkay: ' . ($renameOkay ? 'true' : 'false') . ', $fileExists: ' . ($fileExists ? 'true' : 'false') . ')', ['app' => 'webdav']);
- throw new Exception('Could not rename part file to final file');
+ throw new Exception($this->l10n->t('Could not rename part file to final file'));
}
} catch (ForbiddenException $ex) {
if (!$ex->getRetry()) {
@@ -350,7 +377,7 @@ class File extends Node implements IFile {
$this->refreshInfo();
}
} catch (StorageNotAvailableException $e) {
- throw new ServiceUnavailable("Failed to check file size: " . $e->getMessage(), 0, $e);
+ throw new ServiceUnavailable($this->l10n->t('Failed to check file size: %1$s', [$e->getMessage()]), 0, $e);
}
return '"' . $this->info->getEtag() . '"';
@@ -435,14 +462,14 @@ class File extends Node implements IFile {
$this->convertToSabreException($e);
}
if ($res === false) {
- throw new ServiceUnavailable("Could not open file");
+ throw new ServiceUnavailable($this->l10n->t('Could not open file'));
}
return $res;
} catch (GenericEncryptionException $e) {
// returning 503 will allow retry of the operation at a later point in time
- throw new ServiceUnavailable("Encryption not ready: " . $e->getMessage());
+ throw new ServiceUnavailable($this->l10n->t('Encryption not ready: %1$s', [$e->getMessage()]));
} catch (StorageNotAvailableException $e) {
- throw new ServiceUnavailable("Failed to open file: " . $e->getMessage());
+ throw new ServiceUnavailable($this->l10n->t('Failed to open file: %1$s', [$e->getMessage()]));
} catch (ForbiddenException $ex) {
throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry());
} catch (LockedException $e) {
@@ -467,7 +494,7 @@ class File extends Node implements IFile {
throw new Forbidden();
}
} catch (StorageNotAvailableException $e) {
- throw new ServiceUnavailable("Failed to unlink: " . $e->getMessage());
+ throw new ServiceUnavailable($this->l10n->t('Failed to unlink: %1$s', [$e->getMessage()]));
} catch (ForbiddenException $ex) {
throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry());
} catch (LockedException $e) {
@@ -521,7 +548,7 @@ class File extends Node implements IFile {
$info = \OC_FileChunking::decodeName($name);
if (empty($info)) {
- throw new NotImplemented('Invalid chunk name');
+ throw new NotImplemented($this->l10n->t('Invalid chunk name'));
}
$chunk_handler = new \OC_FileChunking($info);
@@ -533,7 +560,15 @@ class File extends Node implements IFile {
$expected = (int)$_SERVER['CONTENT_LENGTH'];
if ($bytesWritten !== $expected) {
$chunk_handler->remove($info['index']);
- throw new BadRequest('Expected filesize of ' . $expected . ' bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) ' . $bytesWritten . ' bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.');
+ throw new BadRequest(
+ $this->l10n->t(
+ 'Expected filesize of %1$s but read (from Nextcloud client) and wrote (to Nextcloud storage) %2$s. Could either be a network problem on the sending side or a problem writing to the storage on the server side.',
+ [
+ $this->l10n->n('%n byte', '%n bytes', $expected),
+ $this->l10n->n('%n byte', '%n bytes', $bytesWritten),
+ ],
+ )
+ );
}
}
}
@@ -580,7 +615,7 @@ class File extends Node implements IFile {
$targetStorage->unlink($targetInternalPath);
}
$this->fileView->changeLock($targetPath, ILockingProvider::LOCK_SHARED);
- throw new Exception('Could not rename part file assembled from chunks');
+ throw new Exception($this->l10n->t('Could not rename part file assembled from chunks'));
}
} else {
// assemble directly into the final file
@@ -664,13 +699,13 @@ class File extends Node implements IFile {
}
if ($e instanceof GenericEncryptionException) {
// returning 503 will allow retry of the operation at a later point in time
- throw new ServiceUnavailable('Encryption not ready: ' . $e->getMessage(), 0, $e);
+ throw new ServiceUnavailable($this->l10n->t('Encryption not ready: %1$s', [$e->getMessage()]), 0, $e);
}
if ($e instanceof StorageNotAvailableException) {
- throw new ServiceUnavailable('Failed to write file contents: ' . $e->getMessage(), 0, $e);
+ throw new ServiceUnavailable($this->l10n->t('Failed to write file contents: %1$s', [$e->getMessage()]), 0, $e);
}
if ($e instanceof NotFoundException) {
- throw new NotFound('File not found: ' . $e->getMessage(), 0, $e);
+ throw new NotFound($this->l10n->t('File not found: %1$s', [$e->getMessage()]), 0, $e);
}
throw new \Sabre\DAV\Exception($e->getMessage(), 0, $e);
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
index 156507e4467..0fc7ac4af4e 100644
--- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
@@ -76,6 +76,8 @@ class FilesPlugin extends ServerPlugin {
public const UPLOAD_TIME_PROPERTYNAME = '{http://nextcloud.org/ns}upload_time';
public const CREATION_TIME_PROPERTYNAME = '{http://nextcloud.org/ns}creation_time';
public const SHARE_NOTE = '{http://nextcloud.org/ns}note';
+ public const SUBFOLDER_COUNT_PROPERTYNAME = '{http://nextcloud.org/ns}contained-folder-count';
+ public const SUBFILE_COUNT_PROPERTYNAME = '{http://nextcloud.org/ns}contained-file-count';
/**
* Reference to main server object
@@ -429,7 +431,7 @@ class FilesPlugin extends ServerPlugin {
});
}
- if ($node instanceof \OCA\DAV\Connector\Sabre\Directory) {
+ if ($node instanceof Directory) {
$propFind->handle(self::SIZE_PROPERTYNAME, function () use ($node) {
return $node->getSize();
});
@@ -437,6 +439,23 @@ class FilesPlugin extends ServerPlugin {
$propFind->handle(self::IS_ENCRYPTED_PROPERTYNAME, function () use ($node) {
return $node->getFileInfo()->isEncrypted() ? '1' : '0';
});
+
+ $requestProperties = $propFind->getRequestedProperties();
+ if (in_array(self::SUBFILE_COUNT_PROPERTYNAME, $requestProperties, true)
+ || in_array(self::SUBFOLDER_COUNT_PROPERTYNAME, $requestProperties, true)) {
+ $nbFiles = 0;
+ $nbFolders = 0;
+ foreach ($node->getChildren() as $child) {
+ if ($child instanceof File) {
+ $nbFiles++;
+ } elseif ($child instanceof Directory) {
+ $nbFolders++;
+ }
+ }
+
+ $propFind->handle(self::SUBFILE_COUNT_PROPERTYNAME, $nbFiles);
+ $propFind->handle(self::SUBFOLDER_COUNT_PROPERTYNAME, $nbFolders);
+ }
}
}
diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
index 024a6432d01..c88d2302bec 100644
--- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
@@ -299,10 +299,6 @@ class DirectoryTest extends \Test\TestCase {
->method('getMountPoint')
->willReturn($mountPoint);
- $this->view->expects($this->once())
- ->method('getFileInfo')
- ->willReturn($this->info);
-
$mountPoint->method('getMountPoint')
->willReturn('/user/files/mymountpoint');
@@ -344,10 +340,6 @@ class DirectoryTest extends \Test\TestCase {
$mountPoint->method('getMountPoint')
->willReturn('/user/files/mymountpoint');
- $this->view->expects($this->once())
- ->method('getFileInfo')
- ->willReturn($this->info);
-
$dir = new Directory($this->view, $this->info);
$this->assertEquals([200, 800], $dir->getQuotaInfo()); //200 used, 800 free
}
diff --git a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php
index 99adefde000..bb40a92e816 100644
--- a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php
+++ b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php
@@ -36,6 +36,7 @@ use OCP\AppFramework\OCS\OCSException;
use OCP\AppFramework\OCS\OCSForbiddenException;
use OCP\AppFramework\OCSController;
use OCP\Constants;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\Federation\Exceptions\ProviderCouldNotAddShareException;
use OCP\Federation\Exceptions\ProviderDoesNotExistsException;
use OCP\Federation\ICloudFederationFactory;
@@ -44,6 +45,7 @@ use OCP\Federation\ICloudIdManager;
use OCP\IDBConnection;
use OCP\IRequest;
use OCP\IUserManager;
+use OCP\Log\Audit\CriticalActionPerformedEvent;
use OCP\Share;
use OCP\Share\Exceptions\ShareNotFound;
use Psr\Log\LoggerInterface;
@@ -83,6 +85,9 @@ class RequestHandlerController extends OCSController {
/** @var ICloudFederationProviderManager */
private $cloudFederationProviderManager;
+ /** @var IEventDispatcher */
+ private $eventDispatcher;
+
public function __construct(string $appName,
IRequest $request,
FederatedShareProvider $federatedShareProvider,
@@ -94,7 +99,8 @@ class RequestHandlerController extends OCSController {
ICloudIdManager $cloudIdManager,
LoggerInterface $logger,
ICloudFederationFactory $cloudFederationFactory,
- ICloudFederationProviderManager $cloudFederationProviderManager
+ ICloudFederationProviderManager $cloudFederationProviderManager,
+ IEventDispatcher $eventDispatcher
) {
parent::__construct($appName, $request);
@@ -108,6 +114,7 @@ class RequestHandlerController extends OCSController {
$this->logger = $logger;
$this->cloudFederationFactory = $cloudFederationFactory;
$this->cloudFederationProviderManager = $cloudFederationProviderManager;
+ $this->eventDispatcher = $eventDispatcher;
}
/**
@@ -156,6 +163,11 @@ class RequestHandlerController extends OCSController {
try {
$provider = $this->cloudFederationProviderManager->getCloudFederationProvider('file');
$provider->shareReceived($share);
+ if ($sharedByFederatedId === $ownerFederatedId) {
+ $this->eventDispatcher->dispatchTyped(new CriticalActionPerformedEvent('A new federated share with "%s" was created by "%s" and shared with "%s"', [$name, $ownerFederatedId, $shareWith]));
+ } else {
+ $this->eventDispatcher->dispatchTyped(new CriticalActionPerformedEvent('A new federated share with "%s" was shared by "%s" (resource owner is: "%s") and shared with "%s"', [$name, $sharedByFederatedId, $ownerFederatedId, $shareWith]));
+ }
} catch (ProviderDoesNotExistsException $e) {
throw new OCSException('Server does not support federated cloud sharing', 503);
} catch (ProviderCouldNotAddShareException $e) {
@@ -243,6 +255,7 @@ class RequestHandlerController extends OCSController {
try {
$provider = $this->cloudFederationProviderManager->getCloudFederationProvider('file');
$provider->notificationReceived('SHARE_ACCEPTED', $id, $notification);
+ $this->eventDispatcher->dispatchTyped(new CriticalActionPerformedEvent('Federated share with id "%s" was accepted', [$id]));
} catch (ProviderDoesNotExistsException $e) {
throw new OCSException('Server does not support federated cloud sharing', 503);
} catch (ShareNotFound $e) {
@@ -275,6 +288,7 @@ class RequestHandlerController extends OCSController {
try {
$provider = $this->cloudFederationProviderManager->getCloudFederationProvider('file');
$provider->notificationReceived('SHARE_DECLINED', $id, $notification);
+ $this->eventDispatcher->dispatchTyped(new CriticalActionPerformedEvent('Federated share with id "%s" was declined', [$id]));
} catch (ProviderDoesNotExistsException $e) {
throw new OCSException('Server does not support federated cloud sharing', 503);
} catch (ShareNotFound $e) {
@@ -307,6 +321,7 @@ class RequestHandlerController extends OCSController {
$provider = $this->cloudFederationProviderManager->getCloudFederationProvider('file');
$notification = ['sharedSecret' => $token];
$provider->notificationReceived('SHARE_UNSHARED', $id, $notification);
+ $this->eventDispatcher->dispatchTyped(new CriticalActionPerformedEvent('Federated share with id "%s" was unshared', [$id]));
} catch (\Exception $e) {
$this->logger->debug('processing unshare notification failed: ' . $e->getMessage(), ['exception' => $e]);
}
@@ -381,6 +396,7 @@ class RequestHandlerController extends OCSController {
$ocmPermissions = $this->ncPermissions2ocmPermissions((int)$ncPermissions);
$notification = ['sharedSecret' => $token, 'permission' => $ocmPermissions];
$provider->notificationReceived('RESHARE_CHANGE_PERMISSION', $id, $notification);
+ $this->eventDispatcher->dispatchTyped(new CriticalActionPerformedEvent('Federated share with id "%s" has updated permissions "%s"', [$id, implode(', ', $ocmPermissions)]));
} catch (\Exception $e) {
$this->logger->debug($e->getMessage(), ['exception' => $e]);
throw new OCSBadRequestException();
diff --git a/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php b/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php
index 0cb91fac1ae..77f7fde70fa 100644
--- a/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php
+++ b/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php
@@ -34,6 +34,7 @@ use OCP\Federation\ICloudFederationProvider;
use OCP\Federation\ICloudFederationProviderManager;
use OCP\Federation\ICloudFederationShare;
use OCP\Federation\ICloudIdManager;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\IDBConnection;
use OCP\IRequest;
use OCP\IUserManager;
@@ -100,6 +101,9 @@ class RequestHandlerControllerTest extends \Test\TestCase {
/** @var ICloudFederationShare|\PHPUnit\Framework\MockObject\MockObject */
private $cloudFederationShare;
+ /** @var IEventDispatcher|\PHPUnit\Framework\MockObject\MockObject */
+ private $eventDispatcher;
+
protected function setUp(): void {
$this->share = $this->getMockBuilder(IShare::class)->getMock();
$this->federatedShareProvider = $this->getMockBuilder('OCA\FederatedFileSharing\FederatedShareProvider')
@@ -124,7 +128,8 @@ class RequestHandlerControllerTest extends \Test\TestCase {
$this->cloudFederationProviderManager = $this->createMock(ICloudFederationProviderManager::class);
$this->cloudFederationProvider = $this->createMock(ICloudFederationProvider::class);
$this->cloudFederationShare = $this->createMock(ICloudFederationShare::class);
-
+ $this->eventDispatcher = $this->createMock(IEventDispatcher::class);
+ $this->eventDispatcher->expects($this->any())->method('dispatchTyped');
$this->logger = $this->createMock(LoggerInterface::class);
@@ -140,7 +145,8 @@ class RequestHandlerControllerTest extends \Test\TestCase {
$this->cloudIdManager,
$this->logger,
$this->cloudFederationFactory,
- $this->cloudFederationProviderManager
+ $this->cloudFederationProviderManager,
+ $this->eventDispatcher
);
}
diff --git a/apps/files_trashbin/l10n/tr.js b/apps/files_trashbin/l10n/tr.js
index d2998f20d7b..f876ca47621 100644
--- a/apps/files_trashbin/l10n/tr.js
+++ b/apps/files_trashbin/l10n/tr.js
@@ -3,6 +3,7 @@ OC.L10N.register(
{
"Deleted files" : "Silinmiş dosyalar",
"restored" : "geri yüklendi",
+ "Deleted files and folders in the trash bin" : "Çöp kutusundaki silinmiş dosya ve klasörler",
"This application enables users to restore files that were deleted from the system." : "Bu uygulama kullanıcıların sistem üzerinde sildiği dosyaları geri yükleyebilmesini sağlar.",
"This application enables users to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the users file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent a user from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "Bu uygulama kullanıcıların sistem üzerinde sildiği dosyaları geri yükleyebilmesini sağlar. Web arayüzünde silinmiş dosyaların listesini ve kullanıcı klasörlerine geri yükleme ya da kalıcı olarak silme seçeneklerini görüntüler. Sürümler uygulaması etkinleştirilmiş ise, geri yüklenen dosyaların önceki sürümleri de geri yüklenir. Paylaşım üzerinden silinen dosyalar da aynı şekilde ancak paylaşılmamış olarak geri yüklenebilir. Silinmiş dosyalar varsayılan olarak 30 gün boyunca çöp kutusunda tutulur.\nSilinmiş dosyalar uygulaması kullanıcıların disk alanının dolmasını engellemek için, kullanıcı depolama alanının en çok %50 oranındaki bölümünü kullanır. Silinmiş dosyaların boyutu bu sınırın üzerine çıkarsa, sınır değerine geri dönülene kadar en eski silinmiş dosyalar silinir. Ayrıntılı bilgi almak için Silinmiş Dosyalar uygulamasının belgelerine bakabilirsiniz.",
"Restore" : "Geri yükle",
diff --git a/apps/files_trashbin/l10n/tr.json b/apps/files_trashbin/l10n/tr.json
index 6aa05e1e504..ab3847d0190 100644
--- a/apps/files_trashbin/l10n/tr.json
+++ b/apps/files_trashbin/l10n/tr.json
@@ -1,6 +1,7 @@
{ "translations": {
"Deleted files" : "Silinmiş dosyalar",
"restored" : "geri yüklendi",
+ "Deleted files and folders in the trash bin" : "Çöp kutusundaki silinmiş dosya ve klasörler",
"This application enables users to restore files that were deleted from the system." : "Bu uygulama kullanıcıların sistem üzerinde sildiği dosyaları geri yükleyebilmesini sağlar.",
"This application enables users to restore files that were deleted from the system. It displays a list of deleted files in the web interface, and has options to restore those deleted files back to the users file directories or remove them permanently from the system. Restoring a file also restores related file versions, if the versions application is enabled. When a file is deleted from a share, it can be restored in the same manner, though it is no longer shared. By default, these files remain in the trash bin for 30 days.\nTo prevent a user from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation." : "Bu uygulama kullanıcıların sistem üzerinde sildiği dosyaları geri yükleyebilmesini sağlar. Web arayüzünde silinmiş dosyaların listesini ve kullanıcı klasörlerine geri yükleme ya da kalıcı olarak silme seçeneklerini görüntüler. Sürümler uygulaması etkinleştirilmiş ise, geri yüklenen dosyaların önceki sürümleri de geri yüklenir. Paylaşım üzerinden silinen dosyalar da aynı şekilde ancak paylaşılmamış olarak geri yüklenebilir. Silinmiş dosyalar varsayılan olarak 30 gün boyunca çöp kutusunda tutulur.\nSilinmiş dosyalar uygulaması kullanıcıların disk alanının dolmasını engellemek için, kullanıcı depolama alanının en çok %50 oranındaki bölümünü kullanır. Silinmiş dosyaların boyutu bu sınırın üzerine çıkarsa, sınır değerine geri dönülene kadar en eski silinmiş dosyalar silinir. Ayrıntılı bilgi almak için Silinmiş Dosyalar uygulamasının belgelerine bakabilirsiniz.",
"Restore" : "Geri yükle",
diff --git a/apps/settings/l10n/tr.js b/apps/settings/l10n/tr.js
index e2729142750..d4e49b47044 100644
--- a/apps/settings/l10n/tr.js
+++ b/apps/settings/l10n/tr.js
@@ -141,6 +141,8 @@ OC.L10N.register(
"MariaDB version \"%s\" is used. Nextcloud 21 will no longer support this version and requires MariaDB 10.2 or higher." : "MariaDB \"%s\" sürümü kullanılıyor. Nextcloud 21 sürümünde bu sürüm desteklenmiyor. MariaDB 10.2 ya da üzerindeki bir sürüm kullanılmalıdır.",
"MySQL version \"%s\" is used. Nextcloud 21 will no longer support this version and requires MySQL 8.0 or MariaDB 10.2 or higher." : "MySQL \"%s\" sürümü kullanılıyor. Nextcloud 21 sürümünde bu sürüm desteklenmiyor. MySQL 8 ya da MariaDB 10.2 üzerindeki bir sürüm kullanılmalıdır.",
"PostgreSQL version \"%s\" is used. Nextcloud 21 will no longer support this version and requires PostgreSQL 9.6 or higher." : "PostgreSQL \"%s\" sürümü kullanılıyor. Nextcloud 21 sürümünde bu sürüm desteklenmiyor. PostgreSQL 9.6 ya da üzerindeki bir sürüm kullanılmalıdır.",
+ "Profile information" : "Profil bilgileri",
+ "Profile picture, full name, email, phone number, address, website, Twitter, organisation, role, headline, biography, and whether your profile is enabled" : "Profil görseli, tam ad, e-posta adresi, telefon numarası, adres, web sitesi, Twitter, kuruluş, rol, başlık, özgeçmi ve profilde etkinleştirilmiş diğer bilgiler",
"Nextcloud settings" : "Nextcloud ayarları",
"Administration privileges" : "Yönetim yetkileri",
"Here you can decide which group can access certain sections of the administration settings." : "Hangi yönetici ayarlarına hangi grubun erişebileceğini bu bölümden belirleyebilirsiniz.",
@@ -463,6 +465,8 @@ OC.L10N.register(
"Allow username autocompletion to users within the same groups" : "Aynı gruplardaki kullanıcıların kullanıcı adları otomatik olarak tamamlanabilsin",
"Allow username autocompletion to users based on phone number integration" : "Telefon numarası bütünleştirmesi eşleşmelerine göre kullanıcı adları otomatik olarak tamamlanabilsin",
"If autocompletion \"same group\" and \"phone number integration\" are enabled a match in either is enough to show the user." : "\"Aynı grup\" ve \"telefon numarası bütünleştirmesi\" etkinleştirilmiş ise. Kullanıcının görüntülenmesi için ikisinden birinde eşleşme olması yeterlidir.",
+ "Allow autocompletion when entering the full name or email address (ignoring missing phonebook match and being in the same group)" : "Tam ad ya da e-posta adresi yazılırken otomatik olarak tamamlanabilsin (aynı grupta olma ya da telefon defteri eşleşmesi yok sayılarak)",
+ "Match username when restricting to full match" : "Tam eşleşme kısıtlamasında kullanıcı adı ile eşleşilsin",
"Show disclaimer text on the public link upload page (only shown when the file list is hidden)" : "Herkese açık bağlantı yükleme sayfasındaki sorumluluk reddi bildirim metni (yalnız dosya listesi gizli iken görüntülenir)",
"This text will be shown on the public link upload page when the file list is hidden." : "Dosya listesi gizli iken herkese açık bağlantı yükleme sayfasında görüntülenecek sorumluluk reddi bildirimi metni.",
"Default share permissions" : "Varsayılan paylaşım izinleri",
diff --git a/apps/settings/l10n/tr.json b/apps/settings/l10n/tr.json
index 5505c89eb9b..8ab388a0520 100644
--- a/apps/settings/l10n/tr.json
+++ b/apps/settings/l10n/tr.json
@@ -139,6 +139,8 @@
"MariaDB version \"%s\" is used. Nextcloud 21 will no longer support this version and requires MariaDB 10.2 or higher." : "MariaDB \"%s\" sürümü kullanılıyor. Nextcloud 21 sürümünde bu sürüm desteklenmiyor. MariaDB 10.2 ya da üzerindeki bir sürüm kullanılmalıdır.",
"MySQL version \"%s\" is used. Nextcloud 21 will no longer support this version and requires MySQL 8.0 or MariaDB 10.2 or higher." : "MySQL \"%s\" sürümü kullanılıyor. Nextcloud 21 sürümünde bu sürüm desteklenmiyor. MySQL 8 ya da MariaDB 10.2 üzerindeki bir sürüm kullanılmalıdır.",
"PostgreSQL version \"%s\" is used. Nextcloud 21 will no longer support this version and requires PostgreSQL 9.6 or higher." : "PostgreSQL \"%s\" sürümü kullanılıyor. Nextcloud 21 sürümünde bu sürüm desteklenmiyor. PostgreSQL 9.6 ya da üzerindeki bir sürüm kullanılmalıdır.",
+ "Profile information" : "Profil bilgileri",
+ "Profile picture, full name, email, phone number, address, website, Twitter, organisation, role, headline, biography, and whether your profile is enabled" : "Profil görseli, tam ad, e-posta adresi, telefon numarası, adres, web sitesi, Twitter, kuruluş, rol, başlık, özgeçmi ve profilde etkinleştirilmiş diğer bilgiler",
"Nextcloud settings" : "Nextcloud ayarları",
"Administration privileges" : "Yönetim yetkileri",
"Here you can decide which group can access certain sections of the administration settings." : "Hangi yönetici ayarlarına hangi grubun erişebileceğini bu bölümden belirleyebilirsiniz.",
@@ -461,6 +463,8 @@
"Allow username autocompletion to users within the same groups" : "Aynı gruplardaki kullanıcıların kullanıcı adları otomatik olarak tamamlanabilsin",
"Allow username autocompletion to users based on phone number integration" : "Telefon numarası bütünleştirmesi eşleşmelerine göre kullanıcı adları otomatik olarak tamamlanabilsin",
"If autocompletion \"same group\" and \"phone number integration\" are enabled a match in either is enough to show the user." : "\"Aynı grup\" ve \"telefon numarası bütünleştirmesi\" etkinleştirilmiş ise. Kullanıcının görüntülenmesi için ikisinden birinde eşleşme olması yeterlidir.",
+ "Allow autocompletion when entering the full name or email address (ignoring missing phonebook match and being in the same group)" : "Tam ad ya da e-posta adresi yazılırken otomatik olarak tamamlanabilsin (aynı grupta olma ya da telefon defteri eşleşmesi yok sayılarak)",
+ "Match username when restricting to full match" : "Tam eşleşme kısıtlamasında kullanıcı adı ile eşleşilsin",
"Show disclaimer text on the public link upload page (only shown when the file list is hidden)" : "Herkese açık bağlantı yükleme sayfasındaki sorumluluk reddi bildirim metni (yalnız dosya listesi gizli iken görüntülenir)",
"This text will be shown on the public link upload page when the file list is hidden." : "Dosya listesi gizli iken herkese açık bağlantı yükleme sayfasında görüntülenecek sorumluluk reddi bildirimi metni.",
"Default share permissions" : "Varsayılan paylaşım izinleri",
diff --git a/apps/settings/lib/Controller/AuthSettingsController.php b/apps/settings/lib/Controller/AuthSettingsController.php
index 3255fcce56e..38db7be1e91 100644
--- a/apps/settings/lib/Controller/AuthSettingsController.php
+++ b/apps/settings/lib/Controller/AuthSettingsController.php
@@ -145,6 +145,10 @@ class AuthSettingsController extends Controller {
return $this->getServiceNotAvailableResponse();
}
+ if (mb_strlen($name) > 128) {
+ $name = mb_substr($name, 0, 120) . '…';
+ }
+
$token = $this->generateRandomDeviceToken();
$deviceToken = $this->tokenProvider->generateToken($token, $this->uid, $loginName, $password, $name, IToken::PERMANENT_TOKEN);
$tokenData = $deviceToken->jsonSerialize();
@@ -241,6 +245,10 @@ class AuthSettingsController extends Controller {
$this->publishActivity($scope['filesystem'] ? Provider::APP_TOKEN_FILESYSTEM_GRANTED : Provider::APP_TOKEN_FILESYSTEM_REVOKED, $token->getId(), ['name' => $currentName]);
}
+ if (mb_strlen($name) > 128) {
+ $name = mb_substr($name, 0, 120) . '…';
+ }
+
if ($token instanceof INamedToken && $name !== $currentName) {
$token->setName($name);
$this->publishActivity(Provider::APP_TOKEN_RENAMED, $token->getId(), ['name' => $currentName, 'newName' => $name]);
diff --git a/apps/user_ldap/css/settings.css b/apps/user_ldap/css/settings.css
index f99310118a9..e89dfd80c8a 100644
--- a/apps/user_ldap/css/settings.css
+++ b/apps/user_ldap/css/settings.css
@@ -211,23 +211,9 @@ select[multiple=multiple] + button {
}
#ldapSettings {
- background-color: white;
padding: 0;
}
-#ldapSettings > fieldset {
- background-color: white;
-}
-
-#ldapSettings ul.ui-tabs-nav .ui-tabs-active,
-#ldapSettings ul.ui-tabs-nav .ui-tabs-active > a {
- background-color: white;
-}
-
-#ldapSettings div.ui-accordion-content {
- background: white;
-}
-
ul.ui-multiselect-checkboxes label {
display: flex;
align-items: center;
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index 96fa4c2cce1..0fea6ace996 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -218,7 +218,7 @@ class Access extends LDAPUtility {
$values = [];
$isRangeRequest = false;
do {
- $result = $this->executeRead($cr, $dn, $attrToRead, $filter, $maxResults);
+ $result = $this->executeRead($dn, $attrToRead, $filter, $maxResults);
if (is_bool($result)) {
// when an exists request was run and it was successful, an empty
// array must be returned
@@ -260,17 +260,12 @@ class Access extends LDAPUtility {
/**
* Runs an read operation against LDAP
*
- * @param resource $cr the LDAP connection
- * @param string $dn
- * @param string $attribute
- * @param string $filter
- * @param int $maxResults
* @return array|bool false if there was any error, true if an exists check
* was performed and the requested DN found, array with the
* returned data on a successful usual operation
* @throws ServerNotAvailableException
*/
- public function executeRead($cr, $dn, $attribute, $filter, $maxResults) {
+ public function executeRead(string $dn, string $attribute, string $filter, int $maxResults) {
try {
$this->initPagedSearch($filter, $dn, [$attribute], $maxResults, 0);
} catch (NoMoreResults $e) {
@@ -280,7 +275,7 @@ class Access extends LDAPUtility {
return false;
}
$dn = $this->helper->DNasBaseParameter($dn);
- $rr = @$this->invokeLDAPMethod('read', $cr, $dn, $filter, [$attribute]);
+ $rr = @$this->invokeLDAPMethod('read', $dn, $filter, [$attribute]);
if (!$this->ldap->isResource($rr)) {
if ($attribute !== '') {
//do not throw this message on userExists check, irritates
@@ -289,18 +284,18 @@ class Access extends LDAPUtility {
//in case an error occurs , e.g. object does not exist
return false;
}
- if ($attribute === '' && ($filter === 'objectclass=*' || $this->invokeLDAPMethod('countEntries', $cr, $rr) === 1)) {
+ if ($attribute === '' && ($filter === 'objectclass=*' || $this->invokeLDAPMethod('countEntries', $rr) === 1)) {
$this->logger->debug('readAttribute: ' . $dn . ' found', ['app' => 'user_ldap']);
return true;
}
- $er = $this->invokeLDAPMethod('firstEntry', $cr, $rr);
+ $er = $this->invokeLDAPMethod('firstEntry', $rr);
if (!$this->ldap->isResource($er)) {
//did not match the filter, return false
return false;
}
//LDAP attributes are not case sensitive
$result = \OCP\Util::mb_array_change_key_case(
- $this->invokeLDAPMethod('getAttributes', $cr, $er), MB_CASE_LOWER, 'UTF-8');
+ $this->invokeLDAPMethod('getAttributes', $er), MB_CASE_LOWER, 'UTF-8');
return $result;
}
@@ -381,10 +376,10 @@ class Access extends LDAPUtility {
}
try {
// try PASSWD extended operation first
- return @$this->invokeLDAPMethod('exopPasswd', $cr, $userDN, '', $password) ||
- @$this->invokeLDAPMethod('modReplace', $cr, $userDN, $password);
+ return @$this->invokeLDAPMethod('exopPasswd', $userDN, '', $password) ||
+ @$this->invokeLDAPMethod('modReplace', $userDN, $password);
} catch (ConstraintViolationException $e) {
- throw new HintException('Password change rejected.', \OC::$server->getL10N('user_ldap')->t('Password change rejected. Hint: ') . $e->getMessage(), $e->getCode());
+ throw new HintException('Password change rejected.', \OC::$server->getL10N('user_ldap')->t('Password change rejected. Hint: ') . $e->getMessage(), (int)$e->getCode());
}
}
@@ -1092,26 +1087,23 @@ class Access extends LDAPUtility {
*/
/**
+ * @param mixed[] $arguments
* @return mixed
* @throws \OC\ServerNotAvailableException
*/
- private function invokeLDAPMethod() {
- $arguments = func_get_args();
- $command = array_shift($arguments);
- $cr = array_shift($arguments);
+ private function invokeLDAPMethod(string $command, ...$arguments) {
+ if ($command == 'controlPagedResultResponse') {
+ // php no longer supports call-time pass-by-reference
+ // thus cannot support controlPagedResultResponse as the third argument
+ // is a reference
+ throw new \InvalidArgumentException('Invoker does not support controlPagedResultResponse, call LDAP Wrapper directly instead.');
+ }
if (!method_exists($this->ldap, $command)) {
return null;
}
- array_unshift($arguments, $cr);
- // php no longer supports call-time pass-by-reference
- // thus cannot support controlPagedResultResponse as the third argument
- // is a reference
+ array_unshift($arguments, $this->connection->getConnectionResource());
$doMethod = function () use ($command, &$arguments) {
- if ($command == 'controlPagedResultResponse') {
- throw new \InvalidArgumentException('Invoker does not support controlPagedResultResponse, call LDAP Wrapper directly instead.');
- } else {
- return call_user_func_array([$this->ldap, $command], $arguments);
- }
+ return call_user_func_array([$this->ldap, $command], $arguments);
};
try {
$ret = $doMethod();
@@ -1172,8 +1164,7 @@ class Access extends LDAPUtility {
return false;
}
- $sr = $this->invokeLDAPMethod('search', $cr, $base, $filter, $attr);
- // cannot use $cr anymore, might have changed in the previous call!
+ $sr = $this->invokeLDAPMethod('search', $base, $filter, $attr);
$error = $this->ldap->errno($this->connection->getConnectionResource());
if (!$this->ldap->isResource($sr) || $error !== 0) {
$this->logger->error('Attempt for Paging? ' . print_r($pagedSearchOK, true), ['app' => 'user_ldap']);
@@ -1308,7 +1299,7 @@ class Access extends LDAPUtility {
* @throws ServerNotAvailableException
*/
private function countEntriesInSearchResults($sr): int {
- return (int)$this->invokeLDAPMethod('countEntries', $this->connection->getConnectionResource(), $sr);
+ return (int)$this->invokeLDAPMethod('countEntries', $sr);
}
/**
@@ -1349,7 +1340,6 @@ class Access extends LDAPUtility {
return [];
}
[$sr, $pagedSearchOK] = $search;
- $cr = $this->connection->getConnectionResource();
if ($skipHandling) {
//i.e. result do not need to be fetched, we just need the cookie
@@ -1359,7 +1349,7 @@ class Access extends LDAPUtility {
return [];
}
- $findings = array_merge($findings, $this->invokeLDAPMethod('getEntries', $cr, $sr));
+ $findings = array_merge($findings, $this->invokeLDAPMethod('getEntries', $sr));
$iFoundItems = max($iFoundItems, $findings['count']);
unset($findings['count']);
@@ -1536,7 +1526,7 @@ class Access extends LDAPUtility {
* @param string $search the search term
* @return string the final filter part to use in LDAP searches
*/
- public function getFilterPartForUserSearch($search) {
+ public function getFilterPartForUserSearch($search): string {
return $this->getFilterPartForSearch($search,
$this->connection->ldapAttributesForUserSearch,
$this->connection->ldapUserDisplayName);
@@ -1548,7 +1538,7 @@ class Access extends LDAPUtility {
* @param string $search the search term
* @return string the final filter part to use in LDAP searches
*/
- public function getFilterPartForGroupSearch($search) {
+ public function getFilterPartForGroupSearch($search): string {
return $this->getFilterPartForSearch($search,
$this->connection->ldapAttributesForGroupSearch,
$this->connection->ldapGroupDisplayName);
@@ -1642,10 +1632,8 @@ class Access extends LDAPUtility {
/**
* returns the filter used for counting users
- *
- * @return string
*/
- public function getFilterForUserCount() {
+ public function getFilterForUserCount(): string {
$filter = $this->combineFilterWithAnd([
$this->connection->ldapUserFilter,
$this->connection->ldapUserDisplayName . '=*'
@@ -1994,8 +1982,7 @@ class Access extends LDAPUtility {
if ($this->lastCookie === '') {
return;
}
- $cr = $this->connection->getConnectionResource();
- $this->invokeLDAPMethod('controlPagedResult', $cr, 0, false);
+ $this->invokeLDAPMethod('controlPagedResult', 0, false);
$this->getPagedSearchResultState();
$this->lastCookie = '';
}
@@ -2082,7 +2069,7 @@ class Access extends LDAPUtility {
$this->abandonPagedSearch();
}
$pagedSearchOK = true === $this->invokeLDAPMethod(
- 'controlPagedResult', $this->connection->getConnectionResource(), $limit, false
+ 'controlPagedResult', $limit, false
);
if ($pagedSearchOK) {
$this->logger->debug('Ready for a paged search', ['app' => 'user_ldap']);
@@ -2102,7 +2089,6 @@ class Access extends LDAPUtility {
// be returned.
$pageSize = (int)$this->connection->ldapPagingSize > 0 ? (int)$this->connection->ldapPagingSize : 500;
$pagedSearchOK = $this->invokeLDAPMethod('controlPagedResult',
- $this->connection->getConnectionResource(),
$pageSize, false);
}
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index 77ae34f9f6c..4abea708a0d 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -75,10 +75,25 @@ use Psr\Log\LoggerInterface;
*/
class Connection extends LDAPUtility {
private $ldapConnectionRes = null;
+
+ /**
+ * @var string
+ */
private $configPrefix;
+
+ /**
+ * @var ?string
+ */
private $configID;
+
+ /**
+ * @var bool
+ */
private $configured = false;
- //whether connection should be kept on __destruct
+
+ /**
+ * @var bool whether connection should be kept on __destruct
+ */
private $dontDestruct = false;
/**
@@ -91,16 +106,27 @@ class Connection extends LDAPUtility {
*/
public $hasGidNumber = true;
- //cache handler
- protected $cache;
+ /**
+ * @var \OCP\ICache|null
+ */
+ protected $cache = null;
/** @var Configuration settings handler **/
protected $configuration;
+ /**
+ * @var bool
+ */
protected $doNotValidate = false;
+ /**
+ * @var bool
+ */
protected $ignoreValidation = false;
+ /**
+ * @var array{dn?: mixed, hash?: string, result?: bool}
+ */
protected $bindResult = [];
/** @var LoggerInterface */
@@ -108,16 +134,14 @@ class Connection extends LDAPUtility {
/**
* Constructor
- * @param ILDAPWrapper $ldap
* @param string $configPrefix a string with the prefix for the configkey column (appconfig table)
* @param string|null $configID a string with the value for the appid column (appconfig table) or null for on-the-fly connections
*/
- public function __construct(ILDAPWrapper $ldap, $configPrefix = '', $configID = 'user_ldap') {
+ public function __construct(ILDAPWrapper $ldap, string $configPrefix = '', ?string $configID = 'user_ldap') {
parent::__construct($ldap);
$this->configPrefix = $configPrefix;
$this->configID = $configID;
- $this->configuration = new Configuration($configPrefix,
- !is_null($configID));
+ $this->configuration = new Configuration($configPrefix, !is_null($configID));
$memcache = \OC::$server->getMemCacheFactory();
if ($memcache->isAvailable()) {
$this->cache = $memcache->createDistributed();
diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php
index 29ef8958293..45478c00973 100644
--- a/apps/user_ldap/lib/Group_LDAP.php
+++ b/apps/user_ldap/lib/Group_LDAP.php
@@ -1349,7 +1349,7 @@ class Group_LDAP extends BackendUtility implements GroupInterface, IGroupLDAP, I
$this->access->groupname2dn($gid),
$this->access->connection->ldapGroupDisplayName);
- if ($displayName && (count($displayName) > 0)) {
+ if (($displayName !== false) && (count($displayName) > 0)) {
$displayName = $displayName[0];
$this->access->connection->writeToCache($cacheKey, $displayName);
return $displayName;
diff --git a/apps/user_ldap/lib/ILDAPWrapper.php b/apps/user_ldap/lib/ILDAPWrapper.php
index c82df09d234..4695cfd1985 100644
--- a/apps/user_ldap/lib/ILDAPWrapper.php
+++ b/apps/user_ldap/lib/ILDAPWrapper.php
@@ -147,7 +147,7 @@ interface ILDAPWrapper {
/**
* Read an entry
* @param resource $link LDAP link resource
- * @param array $baseDN The DN of the entry to read from
+ * @param string $baseDN The DN of the entry to read from
* @param string $filter An LDAP filter
* @param array $attr array of the attributes to read
* @return resource an LDAP search result resource
@@ -178,8 +178,8 @@ interface ILDAPWrapper {
/**
* Sets the value of the specified option to be $value
* @param resource $link LDAP link resource
- * @param string $option a defined LDAP Server option
- * @param int $value the new value for the option
+ * @param int $option a defined LDAP Server option
+ * @param mixed $value the new value for the option
* @return bool true on success, false otherwise
*/
public function setOption($link, $option, $value);
diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php
index 7210977e0e4..f86df840863 100644
--- a/apps/user_ldap/lib/LDAP.php
+++ b/apps/user_ldap/lib/LDAP.php
@@ -49,19 +49,14 @@ class LDAP implements ILDAPWrapper {
}
/**
- * @param resource $link
- * @param string $dn
- * @param string $password
- * @return bool|mixed
+ * {@inheritDoc}
*/
public function bind($link, $dn, $password) {
return $this->invokeLDAPMethod('bind', $link, $dn, $password);
}
/**
- * @param string $host
- * @param string $port
- * @return mixed
+ * {@inheritDoc}
*/
public function connect($host, $port) {
if (strpos($host, '://') === false) {
@@ -74,6 +69,9 @@ class LDAP implements ILDAPWrapper {
return $this->invokeLDAPMethod('connect', $host);
}
+ /**
+ * {@inheritDoc}
+ */
public function controlPagedResultResponse($link, $result, &$cookie): bool {
$this->preFunctionCall(
$this->pagedResultsAdapter->getResponseCallFunc(),
@@ -91,10 +89,7 @@ class LDAP implements ILDAPWrapper {
}
/**
- * @param LDAP $link
- * @param int $pageSize
- * @param bool $isCritical
- * @return mixed|true
+ * {@inheritDoc}
*/
public function controlPagedResult($link, $pageSize, $isCritical) {
$fn = $this->pagedResultsAdapter->getRequestCallFunc();
@@ -114,25 +109,21 @@ class LDAP implements ILDAPWrapper {
}
/**
- * @param LDAP $link
- * @param LDAP $result
- * @return mixed
+ * {@inheritDoc}
*/
public function countEntries($link, $result) {
return $this->invokeLDAPMethod('count_entries', $link, $result);
}
/**
- * @param LDAP $link
- * @return integer
+ * {@inheritDoc}
*/
public function errno($link) {
return $this->invokeLDAPMethod('errno', $link);
}
/**
- * @param LDAP $link
- * @return string
+ * {@inheritDoc}
*/
public function error($link) {
return $this->invokeLDAPMethod('error', $link);
@@ -150,56 +141,42 @@ class LDAP implements ILDAPWrapper {
}
/**
- * @param LDAP $link
- * @param LDAP $result
- * @return mixed
+ * {@inheritDoc}
*/
public function firstEntry($link, $result) {
return $this->invokeLDAPMethod('first_entry', $link, $result);
}
/**
- * @param LDAP $link
- * @param LDAP $result
- * @return array|mixed
+ * {@inheritDoc}
*/
public function getAttributes($link, $result) {
return $this->invokeLDAPMethod('get_attributes', $link, $result);
}
/**
- * @param LDAP $link
- * @param LDAP $result
- * @return mixed|string
+ * {@inheritDoc}
*/
public function getDN($link, $result) {
return $this->invokeLDAPMethod('get_dn', $link, $result);
}
/**
- * @param LDAP $link
- * @param LDAP $result
- * @return array|mixed
+ * {@inheritDoc}
*/
public function getEntries($link, $result) {
return $this->invokeLDAPMethod('get_entries', $link, $result);
}
/**
- * @param LDAP $link
- * @param resource $result
- * @return mixed
+ * {@inheritDoc}
*/
public function nextEntry($link, $result) {
return $this->invokeLDAPMethod('next_entry', $link, $result);
}
/**
- * @param LDAP $link
- * @param string $baseDN
- * @param string $filter
- * @param array $attr
- * @return mixed
+ * {@inheritDoc}
*/
public function read($link, $baseDN, $filter, $attr) {
$this->pagedResultsAdapter->setReadArgs($link, $baseDN, $filter, $attr);
@@ -207,14 +184,7 @@ class LDAP implements ILDAPWrapper {
}
/**
- * @param LDAP $link
- * @param string[] $baseDN
- * @param string $filter
- * @param array $attr
- * @param int $attrsOnly
- * @param int $limit
- * @return mixed
- * @throws \Exception
+ * {@inheritDoc}
*/
public function search($link, $baseDN, $filter, $attr, $attrsOnly = 0, $limit = 0) {
$oldHandler = set_error_handler(function ($no, $message, $file, $line) use (&$oldHandler) {
@@ -237,47 +207,35 @@ class LDAP implements ILDAPWrapper {
}
/**
- * @param LDAP $link
- * @param string $userDN
- * @param string $password
- * @return bool
+ * {@inheritDoc}
*/
public function modReplace($link, $userDN, $password) {
return $this->invokeLDAPMethod('mod_replace', $link, $userDN, ['userPassword' => $password]);
}
/**
- * @param LDAP $link
- * @param string $userDN
- * @param string $oldPassword
- * @param string $password
- * @return bool
+ * {@inheritDoc}
*/
public function exopPasswd($link, $userDN, $oldPassword, $password) {
return $this->invokeLDAPMethod('exop_passwd', $link, $userDN, $oldPassword, $password);
}
/**
- * @param LDAP $link
- * @param string $option
- * @param int $value
- * @return bool|mixed
+ * {@inheritDoc}
*/
public function setOption($link, $option, $value) {
return $this->invokeLDAPMethod('set_option', $link, $option, $value);
}
/**
- * @param LDAP $link
- * @return mixed|true
+ * {@inheritDoc}
*/
public function startTls($link) {
return $this->invokeLDAPMethod('start_tls', $link);
}
/**
- * @param resource $link
- * @return bool|mixed
+ * {@inheritDoc}
*/
public function unbind($link) {
return $this->invokeLDAPMethod('unbind', $link);
@@ -292,9 +250,7 @@ class LDAP implements ILDAPWrapper {
}
/**
- * Checks whether the submitted parameter is a resource
- * @param Resource $resource the resource variable to check
- * @return bool true if it is a resource, false otherwise
+ * {@inheritDoc}
*/
public function isResource($resource) {
return is_resource($resource);
diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php
index 16973f76ff4..1a747cc8bfd 100644
--- a/apps/user_ldap/lib/Mapping/AbstractMapping.php
+++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php
@@ -438,14 +438,14 @@ abstract class AbstractMapping {
$picker = $this->dbc->getQueryBuilder();
$picker->select('owncloud_name')
->from($this->getTableName());
- $cursor = $picker->execute();
+ $cursor = $picker->executeQuery();
$result = true;
- while ($id = $cursor->fetchOne()) {
+ while (($id = $cursor->fetchOne()) !== false) {
$preCallback($id);
if ($isUnmapped = $this->unmap($id)) {
$postCallback($id);
}
- $result &= $isUnmapped;
+ $result = $result && $isUnmapped;
}
$cursor->closeCursor();
return $result;
diff --git a/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php b/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php
index 9e9554000d8..024c5801582 100644
--- a/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php
+++ b/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php
@@ -259,7 +259,7 @@ class Version1130Date20211102154716 extends SimpleMigrationStep {
$result = $select->executeQuery();
$idList = [];
- while ($id = $result->fetchOne()) {
+ while (($id = $result->fetchOne()) !== false) {
$idList[] = $id;
}
$result->closeCursor();
@@ -278,7 +278,7 @@ class Version1130Date20211102154716 extends SimpleMigrationStep {
->having($select->expr()->gt($select->func()->count('owncloud_name'), $select->createNamedParameter(1)));
$result = $select->executeQuery();
- while ($uuid = $result->fetchOne()) {
+ while (($uuid = $result->fetchOne()) !== false) {
yield $uuid;
}
$result->closeCursor();
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index b09fbd18327..2c81c87fd47 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -274,8 +274,8 @@ class User {
/**
* returns the home directory of the user if specified by LDAP settings
- * @param string $valueFromLDAP
- * @return bool|string
+ * @param ?string $valueFromLDAP
+ * @return false|string
* @throws \Exception
*/
public function getHomePath($valueFromLDAP = null) {
@@ -286,8 +286,7 @@ class User {
&& strpos($this->access->connection->homeFolderNamingRule, 'attr:') === 0
&& $this->access->connection->homeFolderNamingRule !== 'attr:') {
$attr = substr($this->access->connection->homeFolderNamingRule, strlen('attr:'));
- $homedir = $this->access->readAttribute(
- $this->access->username2dn($this->getUsername()), $attr);
+ $homedir = $this->access->readAttribute($this->access->username2dn($this->getUsername()), $attr);
if ($homedir && isset($homedir[0])) {
$path = $homedir[0];
}
diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php
index 4547e7e824e..402e7d1e8e4 100644
--- a/apps/user_ldap/tests/AccessTest.php
+++ b/apps/user_ldap/tests/AccessTest.php
@@ -113,7 +113,7 @@ class AccessTest extends TestCase {
private function getConnectorAndLdapMock() {
$lw = $this->createMock(ILDAPWrapper::class);
$connector = $this->getMockBuilder(Connection::class)
- ->setConstructorArgs([$lw, null, null])
+ ->setConstructorArgs([$lw, '', null])
->getMock();
$um = $this->getMockBuilder(Manager::class)
->setConstructorArgs([
@@ -495,7 +495,7 @@ class AccessTest extends TestCase {
->willReturn(true);
$connection = $this->createMock(LDAP::class);
$this->connection
- ->expects($this->once())
+ ->expects($this->any())
->method('getConnectionResource')
->willReturn($connection);
$this->ldap
@@ -519,7 +519,7 @@ class AccessTest extends TestCase {
->willReturn(true);
$connection = $this->createMock(LDAP::class);
$this->connection
- ->expects($this->once())
+ ->expects($this->any())
->method('getConnectionResource')
->willReturn($connection);
$this->ldap
diff --git a/apps/user_ldap/tests/Group_LDAPTest.php b/apps/user_ldap/tests/Group_LDAPTest.php
index cb637dcc108..f8327c0776c 100644
--- a/apps/user_ldap/tests/Group_LDAPTest.php
+++ b/apps/user_ldap/tests/Group_LDAPTest.php
@@ -104,14 +104,12 @@ class Group_LDAPTest extends TestCase {
$lw = $this->createMock(ILDAPWrapper::class);
$connector = $this->getMockBuilder(Connection::class)
->setMethods($conMethods)
- ->setConstructorArgs([$lw, null, null])
+ ->setConstructorArgs([$lw, '', null])
->getMock();
$access = $this->createMock(Access::class);
- $access->expects($this->any())
- ->method('getConnection')
- ->willReturn($connector);
+ $access->connection = $connector;
$access->userManager = $this->createMock(Manager::class);
@@ -133,6 +131,8 @@ class Group_LDAPTest extends TestCase {
->willReturnCallback(function ($name) {
if ($name === 'ldapDynamicGroupMemberURL') {
return '';
+ } elseif ($name === 'ldapBaseGroups') {
+ return [];
}
return 1;
});
@@ -953,6 +953,8 @@ class Group_LDAPTest extends TestCase {
return 'member';
case 'ldapGroupFilter':
return $groupFilter;
+ case 'ldapBaseGroups':
+ return [];
}
return 1;
});
@@ -1321,16 +1323,16 @@ class Group_LDAPTest extends TestCase {
});
$access->connection = $this->createMock(Connection::class);
- if (count($groupsInfo) > 1) {
- $access->connection->expects($this->any())
- ->method('__get')
- ->willReturnCallback(function ($name) {
- if ($name === 'ldapNestedGroups') {
- return 1;
- }
- return null;
- });
- }
+ $access->connection->expects($this->any())
+ ->method('__get')
+ ->willReturnCallback(function ($name) {
+ if ($name === 'ldapNestedGroups') {
+ return 1;
+ } elseif ($name === 'ldapGroupMemberAssocAttr') {
+ return 'attr';
+ }
+ return null;
+ });
/** @var GroupPluginManager $pluginManager */
$pluginManager = $this->createMock(GroupPluginManager::class);
@@ -1373,6 +1375,10 @@ class Group_LDAPTest extends TestCase {
return null;
});
+ $access->expects($this->any())
+ ->method('groupname2dn')
+ ->willReturn('fakedn');
+
/** @var GroupPluginManager $pluginManager */
$pluginManager = $this->createMock(GroupPluginManager::class);
diff --git a/apps/user_ldap/tests/User/UserTest.php b/apps/user_ldap/tests/User/UserTest.php
index b1b2d9ac391..eb5abdb5c8e 100644
--- a/apps/user_ldap/tests/User/UserTest.php
+++ b/apps/user_ldap/tests/User/UserTest.php
@@ -1016,6 +1016,10 @@ class UserTest extends \Test\TestCase {
->method('readAttribute')
->willReturn(false);
+ $this->access->expects($this->once())
+ ->method('username2dn')
+ ->willReturn($this->dn);
+
// asks for "enforce_home_folder_naming_rule"
$this->config->expects($this->once())
->method('getAppValue')
@@ -1038,6 +1042,10 @@ class UserTest extends \Test\TestCase {
->method('readAttribute')
->willReturn(false);
+ $this->access->expects($this->once())
+ ->method('username2dn')
+ ->willReturn($this->dn);
+
// asks for "enforce_home_folder_naming_rule"
$this->config->expects($this->once())
->method('getAppValue')
diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php
index 78767ff6760..24ebb97b790 100644
--- a/apps/user_ldap/tests/User_LDAPTest.php
+++ b/apps/user_ldap/tests/User_LDAPTest.php
@@ -815,13 +815,15 @@ class User_LDAPTest extends TestCase {
private function prepareAccessForGetDisplayName() {
$this->connection->expects($this->any())
- ->method('__get')
- ->willReturnCallback(function ($name) {
- if ($name === 'ldapUserDisplayName') {
- return 'displayname';
- }
- return null;
- });
+ ->method('__get')
+ ->willReturnCallback(function ($name) {
+ if ($name === 'ldapUserDisplayName') {
+ return 'displayname';
+ } elseif ($name === 'ldapUserDisplayName2') {
+ return 'displayname2';
+ }
+ return null;
+ });
$this->access->expects($this->any())
->method('readAttribute')
diff --git a/apps/user_ldap/tests/WizardTest.php b/apps/user_ldap/tests/WizardTest.php
index ae25aad44ab..5382a0c7f6f 100644
--- a/apps/user_ldap/tests/WizardTest.php
+++ b/apps/user_ldap/tests/WizardTest.php
@@ -72,7 +72,7 @@ class WizardTest extends TestCase {
/** @var Configuration|\PHPUnit\Framework\MockObject\MockObject $conf */
$conf = $this->getMockBuilder(Configuration::class)
->setMethods($confMethods)
- ->setConstructorArgs([$lw, null, null])
+ ->setConstructorArgs(['', true])
->getMock();
/** @var Access|\PHPUnit\Framework\MockObject\MockObject $access */
diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php
index 178bc87365b..34dbf507b91 100644
--- a/apps/workflowengine/lib/Manager.php
+++ b/apps/workflowengine/lib/Manager.php
@@ -351,7 +351,7 @@ class Manager implements IManager {
$result = $qb->execute();
$this->operationsByScope[$scopeContext->getHash()] = [];
- while ($opId = $result->fetchOne()) {
+ while (($opId = $result->fetchOne()) !== false) {
$this->operationsByScope[$scopeContext->getHash()][] = (int)$opId;
}
$result->closeCursor();
diff --git a/apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php b/apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php
index 019d3ae6bcc..974793e99b2 100644
--- a/apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php
+++ b/apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php
@@ -57,7 +57,7 @@ class PopulateNewlyIntroducedDatabaseFields implements IRepairStep {
$qb = $this->dbc->getQueryBuilder();
$insertQuery = $qb->insert('flow_operations_scope');
- while ($id = $ids->fetchOne()) {
+ while (($id = $ids->fetchOne()) !== false) {
$insertQuery->values(['operation_id' => $qb->createNamedParameter($id), 'type' => IManager::SCOPE_ADMIN]);
$insertQuery->execute();
}
diff --git a/core/Controller/ClientFlowLoginController.php b/core/Controller/ClientFlowLoginController.php
index 2ba26deb0e7..d67a065a14e 100644
--- a/core/Controller/ClientFlowLoginController.php
+++ b/core/Controller/ClientFlowLoginController.php
@@ -162,12 +162,8 @@ class ClientFlowLoginController extends Controller {
* @PublicPage
* @NoCSRFRequired
* @UseSession
- *
- * @param string $clientIdentifier
- *
- * @return StandaloneTemplateResponse
*/
- public function showAuthPickerPage($clientIdentifier = '') {
+ public function showAuthPickerPage(string $clientIdentifier = '', int $direct = 0): StandaloneTemplateResponse {
$clientName = $this->getClientName();
$client = null;
if ($clientIdentifier !== '') {
@@ -218,6 +214,7 @@ class ClientFlowLoginController extends Controller {
'stateToken' => $stateToken,
'serverHost' => $this->getServerPath(),
'oauthState' => $this->session->get('oauth.state'),
+ 'direct' => $direct,
],
'guest'
);
@@ -231,13 +228,10 @@ class ClientFlowLoginController extends Controller {
* @NoCSRFRequired
* @NoSameSiteCookieRequired
* @UseSession
- *
- * @param string $stateToken
- * @param string $clientIdentifier
- * @return StandaloneTemplateResponse
*/
- public function grantPage($stateToken = '',
- $clientIdentifier = '') {
+ public function grantPage(string $stateToken = '',
+ string $clientIdentifier = '',
+ int $direct = 0): StandaloneTemplateResponse {
if (!$this->isValidToken($stateToken)) {
return $this->stateTokenForbiddenResponse();
}
@@ -267,6 +261,7 @@ class ClientFlowLoginController extends Controller {
'stateToken' => $stateToken,
'serverHost' => $this->getServerPath(),
'oauthState' => $this->session->get('oauth.state'),
+ 'direct' => $direct,
],
'guest'
);
diff --git a/core/l10n/cs.js b/core/l10n/cs.js
index 6bd9dc6cd96..988af71ccd0 100644
--- a/core/l10n/cs.js
+++ b/core/l10n/cs.js
@@ -350,6 +350,10 @@ OC.L10N.register(
"You can close this window." : "Toto okno je možné zavřít.",
"This share is password-protected" : "Toto sdílení je chráněno heslem",
"The password is wrong. Try again." : "Chybné heslo. Zkuste to znovu.",
+ "Email address" : "E-mailová adresa",
+ "Password sent!" : "Heslo zasláno!",
+ "You are not authorized to request a password for this share" : "Nejste oprávněni vyžádat si heslo pro toto sdílení",
+ "Request password" : "Vyžádat si heslo",
"Go to %s" : "Jít na %s",
"Two-factor authentication" : "Dvoufaktorové přihlášení",
"Enhanced security is enabled for your account. Choose a second factor for authentication:" : "Bylo zapnuto vylepšené zabezpečení pro tento účet. Zvolte druhý faktor pro ověřování:",
diff --git a/core/l10n/cs.json b/core/l10n/cs.json
index d4767f03030..8370a426710 100644
--- a/core/l10n/cs.json
+++ b/core/l10n/cs.json
@@ -348,6 +348,10 @@
"You can close this window." : "Toto okno je možné zavřít.",
"This share is password-protected" : "Toto sdílení je chráněno heslem",
"The password is wrong. Try again." : "Chybné heslo. Zkuste to znovu.",
+ "Email address" : "E-mailová adresa",
+ "Password sent!" : "Heslo zasláno!",
+ "You are not authorized to request a password for this share" : "Nejste oprávněni vyžádat si heslo pro toto sdílení",
+ "Request password" : "Vyžádat si heslo",
"Go to %s" : "Jít na %s",
"Two-factor authentication" : "Dvoufaktorové přihlášení",
"Enhanced security is enabled for your account. Choose a second factor for authentication:" : "Bylo zapnuto vylepšené zabezpečení pro tento účet. Zvolte druhý faktor pro ověřování:",
diff --git a/core/l10n/hu.js b/core/l10n/hu.js
index 0fd53c331b3..535885772db 100644
--- a/core/l10n/hu.js
+++ b/core/l10n/hu.js
@@ -350,6 +350,11 @@ OC.L10N.register(
"You can close this window." : "Bezárhatja ezt az ablakot.",
"This share is password-protected" : "Ez a megosztás jelszóval védett",
"The password is wrong. Try again." : "A megadott jelszó hibás. Próbálja újra.",
+ "Please type in your email address to request a temporary password" : "Írja be az e-mail-címét, hogy ideiglenes jelszót kérjen",
+ "Email address" : "E-mail-cím",
+ "Password sent!" : "Jelszó elküldve.",
+ "You are not authorized to request a password for this share" : "Nincs jogosultsága, hogy jelszót kérjen ehhez a megosztáshoz",
+ "Request password" : "Jelszó kérése",
"Go to %s" : "Ugrás ide: %s",
"Two-factor authentication" : "Kétfaktoros hitelesítés",
"Enhanced security is enabled for your account. Choose a second factor for authentication:" : "A fokozott biztonság engedélyezett a fiókja számára. Válasszon egy második faktort a hitelesítéshez.",
diff --git a/core/l10n/hu.json b/core/l10n/hu.json
index 077262166ed..9d2a213d28e 100644
--- a/core/l10n/hu.json
+++ b/core/l10n/hu.json
@@ -348,6 +348,11 @@
"You can close this window." : "Bezárhatja ezt az ablakot.",
"This share is password-protected" : "Ez a megosztás jelszóval védett",
"The password is wrong. Try again." : "A megadott jelszó hibás. Próbálja újra.",
+ "Please type in your email address to request a temporary password" : "Írja be az e-mail-címét, hogy ideiglenes jelszót kérjen",
+ "Email address" : "E-mail-cím",
+ "Password sent!" : "Jelszó elküldve.",
+ "You are not authorized to request a password for this share" : "Nincs jogosultsága, hogy jelszót kérjen ehhez a megosztáshoz",
+ "Request password" : "Jelszó kérése",
"Go to %s" : "Ugrás ide: %s",
"Two-factor authentication" : "Kétfaktoros hitelesítés",
"Enhanced security is enabled for your account. Choose a second factor for authentication:" : "A fokozott biztonság engedélyezett a fiókja számára. Válasszon egy második faktort a hitelesítéshez.",
diff --git a/core/l10n/pl.js b/core/l10n/pl.js
index 9cec8fcb8c8..b4be46eb0f2 100644
--- a/core/l10n/pl.js
+++ b/core/l10n/pl.js
@@ -350,6 +350,11 @@ OC.L10N.register(
"You can close this window." : "Możesz zamknąć to okno.",
"This share is password-protected" : "Udostępnienie jest zabezpieczone hasłem",
"The password is wrong. Try again." : "Hasło jest nieprawidłowe. Spróbuj ponownie.",
+ "Please type in your email address to request a temporary password" : "Wpisz swój adres e-mail, aby poprosić o tymczasowe hasło",
+ "Email address" : "Adres e-mail",
+ "Password sent!" : "Hasło wysłane!",
+ "You are not authorized to request a password for this share" : "Nie masz uprawnień do żądania hasła dla tego udostępnienia",
+ "Request password" : "Żądanie hasła",
"Go to %s" : "Przejdź do %s",
"Two-factor authentication" : "Uwierzytelnianie dwuskładnikowe",
"Enhanced security is enabled for your account. Choose a second factor for authentication:" : "Dodatkowe zabezpieczenia są włączone dla Twojego konta. Wybierz drugą metodę uwierzytelniania:",
diff --git a/core/l10n/pl.json b/core/l10n/pl.json
index b0f75e0c05f..2b1a0b8b536 100644
--- a/core/l10n/pl.json
+++ b/core/l10n/pl.json
@@ -348,6 +348,11 @@
"You can close this window." : "Możesz zamknąć to okno.",
"This share is password-protected" : "Udostępnienie jest zabezpieczone hasłem",
"The password is wrong. Try again." : "Hasło jest nieprawidłowe. Spróbuj ponownie.",
+ "Please type in your email address to request a temporary password" : "Wpisz swój adres e-mail, aby poprosić o tymczasowe hasło",
+ "Email address" : "Adres e-mail",
+ "Password sent!" : "Hasło wysłane!",
+ "You are not authorized to request a password for this share" : "Nie masz uprawnień do żądania hasła dla tego udostępnienia",
+ "Request password" : "Żądanie hasła",
"Go to %s" : "Przejdź do %s",
"Two-factor authentication" : "Uwierzytelnianie dwuskładnikowe",
"Enhanced security is enabled for your account. Choose a second factor for authentication:" : "Dodatkowe zabezpieczenia są włączone dla Twojego konta. Wybierz drugą metodę uwierzytelniania:",
diff --git a/core/l10n/tr.js b/core/l10n/tr.js
index 8749f9bcb58..05bfc7887c3 100644
--- a/core/l10n/tr.js
+++ b/core/l10n/tr.js
@@ -350,6 +350,11 @@ OC.L10N.register(
"You can close this window." : "Bu pencereyi kapatabilirsiniz.",
"This share is password-protected" : "Bu paylaşım parola korumalı",
"The password is wrong. Try again." : "Parola yanlış. Yeniden deneyin.",
+ "Please type in your email address to request a temporary password" : "Lütfen geçici parola isteğinde bulunmak için e-posta adresinizi yazın",
+ "Email address" : "E-posta adresi",
+ "Password sent!" : "Parola gönderildi!",
+ "You are not authorized to request a password for this share" : "Bu paylaşım için parola isteğinde bulunma izniniz yok",
+ "Request password" : "Parola iste",
"Go to %s" : "%s bölümüne git",
"Two-factor authentication" : "İki aşamalı kimlik doğrulama",
"Enhanced security is enabled for your account. Choose a second factor for authentication:" : "Hesabınız için gelişmiş güvenlik etkinleştirildi. Kimlik doğrulaması için bir ikinci aşama seçin:",
diff --git a/core/l10n/tr.json b/core/l10n/tr.json
index 12864d50d46..580f67a1775 100644
--- a/core/l10n/tr.json
+++ b/core/l10n/tr.json
@@ -348,6 +348,11 @@
"You can close this window." : "Bu pencereyi kapatabilirsiniz.",
"This share is password-protected" : "Bu paylaşım parola korumalı",
"The password is wrong. Try again." : "Parola yanlış. Yeniden deneyin.",
+ "Please type in your email address to request a temporary password" : "Lütfen geçici parola isteğinde bulunmak için e-posta adresinizi yazın",
+ "Email address" : "E-posta adresi",
+ "Password sent!" : "Parola gönderildi!",
+ "You are not authorized to request a password for this share" : "Bu paylaşım için parola isteğinde bulunma izniniz yok",
+ "Request password" : "Parola iste",
"Go to %s" : "%s bölümüne git",
"Two-factor authentication" : "İki aşamalı kimlik doğrulama",
"Enhanced security is enabled for your account. Choose a second factor for authentication:" : "Hesabınız için gelişmiş güvenlik etkinleştirildi. Kimlik doğrulaması için bir ikinci aşama seçin:",
diff --git a/core/l10n/zh_CN.js b/core/l10n/zh_CN.js
index d372f24a39b..7ae95259504 100644
--- a/core/l10n/zh_CN.js
+++ b/core/l10n/zh_CN.js
@@ -42,10 +42,10 @@ OC.L10N.register(
"Enter your subscription key to increase the user limit. For more information about Nextcloud Enterprise see our website." : "输入订阅密钥以增加用户限制。欲了解更多关于Nextcloud企业版的信息,请访问我们的网站。",
"Preparing update" : "正在准备更新",
"[%d / %d]: %s" : "[%d / %d]:%s",
- "Repair step:" : "修复错误:",
- "Repair info:" : "修复信息:",
- "Repair warning:" : "修复警告:",
- "Repair error:" : "修复错误:",
+ "Repair step:" : "修复日志 步骤:",
+ "Repair info:" : "修复 信息:",
+ "Repair warning:" : "修复 警告:",
+ "Repair error:" : "修复 错误:",
"Please use the command line updater because automatic updating is disabled in the config.php." : "由于自动更新在 config.php 中已禁用,请使用命令行更新。",
"[%d / %d]: Checking table %s" : "[%d / %d]:检查数据表 %s",
"Turned on maintenance mode" : "启用维护模式",
diff --git a/core/l10n/zh_CN.json b/core/l10n/zh_CN.json
index ce98ba77cfe..583e3281760 100644
--- a/core/l10n/zh_CN.json
+++ b/core/l10n/zh_CN.json
@@ -40,10 +40,10 @@
"Enter your subscription key to increase the user limit. For more information about Nextcloud Enterprise see our website." : "输入订阅密钥以增加用户限制。欲了解更多关于Nextcloud企业版的信息,请访问我们的网站。",
"Preparing update" : "正在准备更新",
"[%d / %d]: %s" : "[%d / %d]:%s",
- "Repair step:" : "修复错误:",
- "Repair info:" : "修复信息:",
- "Repair warning:" : "修复警告:",
- "Repair error:" : "修复错误:",
+ "Repair step:" : "修复日志 步骤:",
+ "Repair info:" : "修复 信息:",
+ "Repair warning:" : "修复 警告:",
+ "Repair error:" : "修复 错误:",
"Please use the command line updater because automatic updating is disabled in the config.php." : "由于自动更新在 config.php 中已禁用,请使用命令行更新。",
"[%d / %d]: Checking table %s" : "[%d / %d]:检查数据表 %s",
"Turned on maintenance mode" : "启用维护模式",
diff --git a/core/l10n/zh_TW.js b/core/l10n/zh_TW.js
index ba496bd0a0b..3ec54f66d81 100644
--- a/core/l10n/zh_TW.js
+++ b/core/l10n/zh_TW.js
@@ -350,6 +350,11 @@ OC.L10N.register(
"You can close this window." : "可以關閉此視窗",
"This share is password-protected" : "此分享受密碼保護",
"The password is wrong. Try again." : "密碼錯誤,請重試",
+ "Please type in your email address to request a temporary password" : "請輸入您的電子郵件地址以申請臨時密碼",
+ "Email address" : "電子郵件地址",
+ "Password sent!" : "密碼已傳送!",
+ "You are not authorized to request a password for this share" : "您無權為此分享請求密碼",
+ "Request password" : "請求密碼",
"Go to %s" : "前往 %s",
"Two-factor authentication" : "雙因素驗證",
"Enhanced security is enabled for your account. Choose a second factor for authentication:" : "您的帳號已啟用進階安全機制,請選擇一個雙因素驗證方法:",
diff --git a/core/l10n/zh_TW.json b/core/l10n/zh_TW.json
index b4efa671575..350b4043fc1 100644
--- a/core/l10n/zh_TW.json
+++ b/core/l10n/zh_TW.json
@@ -348,6 +348,11 @@
"You can close this window." : "可以關閉此視窗",
"This share is password-protected" : "此分享受密碼保護",
"The password is wrong. Try again." : "密碼錯誤,請重試",
+ "Please type in your email address to request a temporary password" : "請輸入您的電子郵件地址以申請臨時密碼",
+ "Email address" : "電子郵件地址",
+ "Password sent!" : "密碼已傳送!",
+ "You are not authorized to request a password for this share" : "您無權為此分享請求密碼",
+ "Request password" : "請求密碼",
"Go to %s" : "前往 %s",
"Two-factor authentication" : "雙因素驗證",
"Enhanced security is enabled for your account. Choose a second factor for authentication:" : "您的帳號已啟用進階安全機制,請選擇一個雙因素驗證方法:",
diff --git a/core/templates/loginflow/authpicker.php b/core/templates/loginflow/authpicker.php
index 02b4b9cc003..4c4c8fd6d53 100644
--- a/core/templates/loginflow/authpicker.php
+++ b/core/templates/loginflow/authpicker.php
@@ -46,7 +46,7 @@ $urlGenerator = $_['urlGenerator'];
<br/>
<p id="redirect-link">
- <a href="<?php p($urlGenerator->linkToRoute('core.ClientFlowLogin.grantPage', ['stateToken' => $_['stateToken'], 'clientIdentifier' => $_['clientIdentifier'], 'oauthState' => $_['oauthState']])) ?>">
+ <a href="<?php p($urlGenerator->linkToRoute('core.ClientFlowLogin.grantPage', ['stateToken' => $_['stateToken'], 'clientIdentifier' => $_['clientIdentifier'], 'oauthState' => $_['oauthState'], 'direct' => $_['direct']])) ?>">
<input type="submit" class="login primary icon-confirm-white" value="<?php p($l->t('Log in')) ?>">
</a>
</p>
@@ -62,6 +62,9 @@ $urlGenerator = $_['urlGenerator'];
</p>
<input type="hidden" name="stateToken" value="<?php p($_['stateToken']) ?>" />
<input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>">
+ <?php if ($_['direct'] !== 0) { ?>
+ <input type="hidden" name="direct" value="<?php p($_['direct']) ?>">
+ <?php } ?>
<input id="submit-app-token-login" type="submit" class="login primary icon-confirm-white" value="<?php p($l->t('Grant access')) ?>">
</form>
</div>
diff --git a/core/templates/loginflow/grant.php b/core/templates/loginflow/grant.php
index 0f1b9235a89..c537c47ea64 100644
--- a/core/templates/loginflow/grant.php
+++ b/core/templates/loginflow/grant.php
@@ -39,14 +39,17 @@ $urlGenerator = $_['urlGenerator'];
<br/>
<p id="redirect-link">
- <form method="POST" action="<?php p($urlGenerator->linkToRouteAbsolute('core.ClientFlowLogin.generateAppPassword')) ?>">
- <input type="hidden" name="clientIdentifier" value="<?php p($_['clientIdentifier']) ?>" />
- <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
- <input type="hidden" name="stateToken" value="<?php p($_['stateToken']) ?>" />
- <input type="hidden" name="oauthState" value="<?php p($_['oauthState']) ?>" />
+ <form method="POST" action="<?php p($urlGenerator->linkToRouteAbsolute('core.ClientFlowLogin.generateAppPassword')) ?>">
+ <input type="hidden" name="clientIdentifier" value="<?php p($_['clientIdentifier']) ?>" />
+ <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
+ <input type="hidden" name="stateToken" value="<?php p($_['stateToken']) ?>" />
+ <input type="hidden" name="oauthState" value="<?php p($_['oauthState']) ?>" />
+ <?php if (p($_['direct'])) { ?>
+ <input type="hidden" name="direct" value="1" />
+ <?php } ?>
<div id="submit-wrapper">
<input type="submit" class="login primary icon-confirm-white" title="" value="<?php p($l->t('Grant access')); ?>" />
- </div>
+ </div>
</form>
</p>
</div>
diff --git a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
index 3fdbe8de1e1..b98d4a99fb5 100644
--- a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
+++ b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
@@ -223,6 +223,9 @@ class SecurityMiddleware extends Middleware {
if (isset($this->request->server['REQUEST_URI'])) {
$params['redirect_url'] = $this->request->server['REQUEST_URI'];
}
+ if ($this->request->getParam('direct')) {
+ $params['direct'] = 1;
+ }
$url = $this->urlGenerator->linkToRoute('core.login.showLoginForm', $params);
$response = new RedirectResponse($url);
} else {
diff --git a/lib/private/Authentication/Token/IProvider.php b/lib/private/Authentication/Token/IProvider.php
index b37fc2c8cf4..a39cf95f141 100644
--- a/lib/private/Authentication/Token/IProvider.php
+++ b/lib/private/Authentication/Token/IProvider.php
@@ -44,7 +44,7 @@ interface IProvider {
* @param string $uid
* @param string $loginName
* @param string|null $password
- * @param string $name
+ * @param string $name Name will be trimmed to 120 chars when longer
* @param int $type token type
* @param int $remember whether the session token should be used for remember-me
* @return IToken
diff --git a/lib/private/Authentication/Token/Manager.php b/lib/private/Authentication/Token/Manager.php
index b718ce73ea4..cadc5f408e4 100644
--- a/lib/private/Authentication/Token/Manager.php
+++ b/lib/private/Authentication/Token/Manager.php
@@ -53,7 +53,7 @@ class Manager implements IProvider {
* @param string $uid
* @param string $loginName
* @param string|null $password
- * @param string $name
+ * @param string $name Name will be trimmed to 120 chars when longer
* @param int $type token type
* @param int $remember whether the session token should be used for remember-me
* @return IToken
@@ -65,6 +65,10 @@ class Manager implements IProvider {
string $name,
int $type = IToken::TEMPORARY_TOKEN,
int $remember = IToken::DO_NOT_REMEMBER): IToken {
+ if (mb_strlen($name) > 128) {
+ $name = mb_substr($name, 0, 120) . '…';
+ }
+
try {
return $this->publicKeyTokenProvider->generateToken(
$token,
diff --git a/lib/private/Authentication/Token/PublicKeyTokenProvider.php b/lib/private/Authentication/Token/PublicKeyTokenProvider.php
index 00139b14166..ebda3bac499 100644
--- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php
+++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php
@@ -84,6 +84,10 @@ class PublicKeyTokenProvider implements IProvider {
string $name,
int $type = IToken::TEMPORARY_TOKEN,
int $remember = IToken::DO_NOT_REMEMBER): IToken {
+ if (mb_strlen($name) > 128) {
+ throw new InvalidTokenException('The given name is too long');
+ }
+
$dbToken = $this->newToken($token, $uid, $loginName, $password, $name, $type, $remember);
$this->mapper->insert($dbToken);
diff --git a/lib/private/Collaboration/Collaborators/LookupPlugin.php b/lib/private/Collaboration/Collaborators/LookupPlugin.php
index 079fd4d2575..72cbfd4de4b 100644
--- a/lib/private/Collaboration/Collaborators/LookupPlugin.php
+++ b/lib/private/Collaboration/Collaborators/LookupPlugin.php
@@ -110,6 +110,7 @@ class LookupPlugin implements ISearchPlugin {
'label' => $label,
'value' => [
'shareType' => IShare::TYPE_REMOTE,
+ 'globalScale' => $isGlobalScaleEnabled,
'shareWith' => $lookup['federationId'],
],
'extra' => $lookup,
diff --git a/lib/private/Console/TimestampFormatter.php b/lib/private/Console/TimestampFormatter.php
index 59e480b39e8..c25ed578805 100644
--- a/lib/private/Console/TimestampFormatter.php
+++ b/lib/private/Console/TimestampFormatter.php
@@ -99,6 +99,11 @@ class TimestampFormatter implements OutputFormatterInterface {
* log timezone and dateformat, e.g. "2015-06-23T17:24:37+02:00"
*/
public function format($message) {
+ if (!$this->formatter->isDecorated()) {
+ // Don't add anything to the output when we shouldn't
+ return $this->formatter->format($message);
+ }
+
$timeZone = $this->config->getSystemValue('logtimezone', 'UTC');
$timeZone = $timeZone !== null ? new \DateTimeZone($timeZone) : null;
diff --git a/lib/private/Files/Cache/Storage.php b/lib/private/Files/Cache/Storage.php
index 33785607ef7..626bfeeb53d 100644
--- a/lib/private/Files/Cache/Storage.php
+++ b/lib/private/Files/Cache/Storage.php
@@ -237,6 +237,7 @@ class Storage {
->from('mounts')
->where($query->expr()->eq('mount_id', $query->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)));
$storageIds = $query->executeQuery()->fetchAll(\PDO::FETCH_COLUMN);
+ $storageIds = array_unique($storageIds);
$query = $db->getQueryBuilder();
$query->delete('filecache')
diff --git a/lib/private/Files/ObjectStore/S3.php b/lib/private/Files/ObjectStore/S3.php
index 074f3a1df91..6492145fb63 100644
--- a/lib/private/Files/ObjectStore/S3.php
+++ b/lib/private/Files/ObjectStore/S3.php
@@ -30,6 +30,7 @@ class S3 implements IObjectStore {
use S3ObjectTrait;
public function __construct($parameters) {
+ $parameters['primary_storage'] = true;
$this->parseParams($parameters);
}
diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
index 47c20d96d53..888497d03bb 100644
--- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php
+++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
@@ -39,6 +39,7 @@ use Aws\S3\Exception\S3Exception;
use Aws\S3\S3Client;
use GuzzleHttp\Promise;
use GuzzleHttp\Promise\RejectedPromise;
+use OCP\ICertificateManager;
use OCP\ILogger;
trait S3ConnectionTrait {
@@ -121,6 +122,15 @@ trait S3ConnectionTrait {
)
);
+ // since we store the certificate bundles on the primary storage, we can't get the bundle while setting up the primary storage
+ if (!isset($this->params['primary_storage'])) {
+ /** @var ICertificateManager $certManager */
+ $certManager = \OC::$server->get(ICertificateManager::class);
+ $certPath = $certManager->getAbsoluteBundlePath();
+ } else {
+ $certPath = \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
+ }
+
$options = [
'version' => isset($this->params['version']) ? $this->params['version'] : 'latest',
'credentials' => $provider,
@@ -130,9 +140,10 @@ trait S3ConnectionTrait {
'signature_provider' => \Aws\or_chain([self::class, 'legacySignatureProvider'], ClientResolver::_default_signature_provider()),
'csm' => false,
'use_arn_region' => false,
+ 'http' => ['verify' => $certPath],
];
if ($this->getProxy()) {
- $options['http'] = [ 'proxy' => $this->getProxy() ];
+ $options['http']['proxy'] = $this->getProxy();
}
if (isset($this->params['legacy_auth']) && $this->params['legacy_auth']) {
$options['signature_version'] = 'v2';
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index 4e3966b711c..141918918e6 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1179,7 +1179,7 @@ class View {
throw $e;
}
- if ($result && in_array('delete', $hooks) and $result) {
+ if ($result && in_array('delete', $hooks)) {
$this->removeUpdate($storage, $internalPath);
}
if ($result && in_array('write', $hooks, true) && $operation !== 'fopen' && $operation !== 'touch') {
@@ -1453,7 +1453,7 @@ class View {
$data = $this->getCacheEntry($storage, $internalPath, $directory);
- if (!$data instanceof ICacheEntry || !isset($data['fileid']) || !($data->getPermissions() && Constants::PERMISSION_READ)) {
+ if (!$data instanceof ICacheEntry || !isset($data['fileid']) || !($data->getPermissions() & Constants::PERMISSION_READ)) {
return [];
}
@@ -1507,7 +1507,7 @@ class View {
$rootEntry = $subCache->get('');
}
- if ($rootEntry && ($rootEntry->getPermissions() && Constants::PERMISSION_READ)) {
+ if ($rootEntry && ($rootEntry->getPermissions() & Constants::PERMISSION_READ)) {
$relativePath = trim(substr($mountPoint, $dirLength), '/');
if ($pos = strpos($relativePath, '/')) {
//mountpoint inside subfolder add size to the correct folder
diff --git a/lib/private/Preview/Bundled.php b/lib/private/Preview/Bundled.php
index f026d3259f5..6b5a8aa2d12 100644
--- a/lib/private/Preview/Bundled.php
+++ b/lib/private/Preview/Bundled.php
@@ -46,7 +46,7 @@ abstract class Bundled extends ProviderV2 {
$image->fixOrientation();
return $image;
- } catch (\Exception $e) {
+ } catch (\Throwable $e) {
return null;
}
}
diff --git a/lib/private/Security/CertificateManager.php b/lib/private/Security/CertificateManager.php
index 0c6791163c2..6f3b01e23b9 100644
--- a/lib/private/Security/CertificateManager.php
+++ b/lib/private/Security/CertificateManager.php
@@ -240,15 +240,19 @@ class CertificateManager implements ICertificateManager {
* @return string
*/
public function getAbsoluteBundlePath(): string {
- if (!$this->hasCertificates()) {
- return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
- }
+ try {
+ if (!$this->hasCertificates()) {
+ return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
+ }
- if ($this->needsRebundling()) {
- $this->createCertificateBundle();
- }
+ if ($this->needsRebundling()) {
+ $this->createCertificateBundle();
+ }
- return $this->view->getLocalFile($this->getCertificateBundle());
+ return $this->view->getLocalFile($this->getCertificateBundle());
+ } catch (\Exception $e) {
+ return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
+ }
}
/**
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php
index cfc4079e117..110b81be930 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -666,8 +666,21 @@ class DefaultShareProvider implements IShareProvider {
);
}
+ // todo? maybe get these from the oc_mounts table
+ $childMountNodes = array_filter($node->getDirectoryListing(), function (Node $node) {
+ return $node->getInternalPath() === '';
+ });
+ $childMountRootIds = array_map(function (Node $node) {
+ return $node->getId();
+ }, $childMountNodes);
+
$qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
- $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())));
+ $qb->andWhere(
+ $qb->expr()->orX(
+ $qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())),
+ $qb->expr()->in('f.fileid', $qb->createNamedParameter($childMountRootIds, IQueryBuilder::PARAM_INT_ARRAY))
+ )
+ );
$qb->orderBy('id');
diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php
index efb9252e346..547ffef8607 100644
--- a/lib/private/legacy/OC_Helper.php
+++ b/lib/private/legacy/OC_Helper.php
@@ -485,7 +485,7 @@ class OC_Helper {
* @return array
* @throws \OCP\Files\NotFoundException
*/
- public static function getStorageInfo($path, $rootInfo = null) {
+ public static function getStorageInfo($path, $rootInfo = null, $includeMountPoints = true) {
// return storage info without adding mount points
$includeExtStorage = \OC::$server->getSystemConfig()->getValue('quota_include_external_storage', false);
@@ -495,7 +495,7 @@ class OC_Helper {
if (!$rootInfo instanceof \OCP\Files\FileInfo) {
throw new \OCP\Files\NotFoundException();
}
- $used = $rootInfo->getSize();
+ $used = $rootInfo->getSize($includeMountPoints);
if ($used < 0) {
$used = 0;
}
diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php
index 51a17743c93..c60c89407bd 100644
--- a/tests/Core/Controller/ClientFlowLoginControllerTest.php
+++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php
@@ -183,6 +183,7 @@ class ClientFlowLoginControllerTest extends TestCase {
'stateToken' => 'StateToken',
'serverHost' => 'https://example.com',
'oauthState' => 'OauthStateToken',
+ 'direct' => 0,
],
'guest'
);
@@ -246,6 +247,7 @@ class ClientFlowLoginControllerTest extends TestCase {
'stateToken' => 'StateToken',
'serverHost' => 'https://example.com',
'oauthState' => 'OauthStateToken',
+ 'direct' => 0,
],
'guest'
);
diff --git a/tests/lib/Authentication/Token/ManagerTest.php b/tests/lib/Authentication/Token/ManagerTest.php
index fb92b3e5018..ee2b3cdc768 100644
--- a/tests/lib/Authentication/Token/ManagerTest.php
+++ b/tests/lib/Authentication/Token/ManagerTest.php
@@ -127,6 +127,37 @@ class ManagerTest extends TestCase {
$this->assertSame($token, $actual);
}
+ public function testGenerateTokenTooLongName() {
+ $token = $this->createMock(IToken::class);
+ $token->method('getName')
+ ->willReturn(str_repeat('a', 120) . '…');
+
+
+ $this->publicKeyTokenProvider->expects($this->once())
+ ->method('generateToken')
+ ->with(
+ 'token',
+ 'uid',
+ 'loginName',
+ 'password',
+ str_repeat('a', 120) . '…',
+ IToken::TEMPORARY_TOKEN,
+ IToken::REMEMBER
+ )->willReturn($token);
+
+ $actual = $this->manager->generateToken(
+ 'token',
+ 'uid',
+ 'loginName',
+ 'password',
+ str_repeat('a', 200),
+ IToken::TEMPORARY_TOKEN,
+ IToken::REMEMBER
+ );
+
+ $this->assertSame(121, mb_strlen($actual->getName()));
+ }
+
public function tokenData(): array {
return [
[new DefaultToken()],
diff --git a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
index 486660f17c6..767e7897c58 100644
--- a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
+++ b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
@@ -82,10 +82,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$uid = 'user';
$user = 'User';
$password = 'passme';
- $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
+ $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
$type = IToken::PERMANENT_TOKEN;
$actual = $this->tokenProvider->generateToken($token, $uid, $user, $password, $name, $type, IToken::DO_NOT_REMEMBER);
@@ -98,6 +95,22 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->assertSame($password, $this->tokenProvider->getPassword($actual, $token));
}
+ public function testGenerateTokenInvalidName() {
+ $this->expectException(\OC\Authentication\Exceptions\InvalidTokenException::class);
+
+ $token = 'token';
+ $uid = 'user';
+ $user = 'User';
+ $password = 'passme';
+ $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
+ . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
+ . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
+ . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
+ $type = IToken::PERMANENT_TOKEN;
+
+ $actual = $this->tokenProvider->generateToken($token, $uid, $user, $password, $name, $type, IToken::DO_NOT_REMEMBER);
+ }
+
public function testUpdateToken() {
$tk = new PublicKeyToken();
$this->mapper->expects($this->once())
@@ -139,10 +152,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$uid = 'user';
$user = 'User';
$password = 'passme';
- $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
+ $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
$type = IToken::PERMANENT_TOKEN;
$actual = $this->tokenProvider->generateToken($token, $uid, $user, $password, $name, $type, IToken::DO_NOT_REMEMBER);
@@ -169,10 +179,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$uid = 'user';
$user = 'User';
$password = 'passme';
- $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
+ $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
$type = IToken::PERMANENT_TOKEN;
$actual = $this->tokenProvider->generateToken($token, $uid, $user, $password, $name, $type, IToken::DO_NOT_REMEMBER);
@@ -185,10 +192,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$uid = 'user';
$user = 'User';
$password = 'passme';
- $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
+ $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
$type = IToken::PERMANENT_TOKEN;
$actual = $this->tokenProvider->generateToken($token, $uid, $user, $password, $name, $type, IToken::DO_NOT_REMEMBER);
@@ -248,12 +252,12 @@ class PublicKeyTokenProviderTest extends TestCase {
['session_lifetime', $defaultSessionLifetime, 150],
['remember_login_cookie_lifetime', $defaultRememberMeLifetime, 300],
]);
- $this->mapper->expects($this->at(0))
- ->method('invalidateOld')
- ->with($this->time - 150);
- $this->mapper->expects($this->at(1))
+ $this->mapper->expects($this->exactly(2))
->method('invalidateOld')
- ->with($this->time - 300);
+ ->withConsecutive(
+ [$this->time - 150],
+ [$this->time - 300]
+ );
$this->tokenProvider->invalidateOldTokens();
}
@@ -263,21 +267,18 @@ class PublicKeyTokenProviderTest extends TestCase {
$uid = 'user';
$user = 'User';
$password = null;
- $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
+ $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
$type = IToken::PERMANENT_TOKEN;
$oldToken = $this->tokenProvider->generateToken($token, $uid, $user, $password, $name, $type, IToken::DO_NOT_REMEMBER);
$this->mapper
- ->expects($this->at(0))
+ ->expects($this->once())
->method('getToken')
->with(hash('sha512', 'oldId' . '1f4h9s'))
->willReturn($oldToken);
$this->mapper
- ->expects($this->at(1))
+ ->expects($this->once())
->method('insert')
->with($this->callback(function (PublicKeyToken $token) use ($user, $uid, $name) {
return $token->getUID() === $uid &&
@@ -288,7 +289,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$token->getPassword() === null;
}));
$this->mapper
- ->expects($this->at(2))
+ ->expects($this->once())
->method('delete')
->with($this->callback(function ($token) use ($oldToken) {
return $token === $oldToken;
@@ -302,21 +303,18 @@ class PublicKeyTokenProviderTest extends TestCase {
$uid = 'user';
$user = 'User';
$password = 'password';
- $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
+ $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
$type = IToken::PERMANENT_TOKEN;
$oldToken = $this->tokenProvider->generateToken($token, $uid, $user, $password, $name, $type, IToken::DO_NOT_REMEMBER);
$this->mapper
- ->expects($this->at(0))
+ ->expects($this->once())
->method('getToken')
->with(hash('sha512', 'oldId' . '1f4h9s'))
->willReturn($oldToken);
$this->mapper
- ->expects($this->at(1))
+ ->expects($this->once())
->method('insert')
->with($this->callback(function (PublicKeyToken $token) use ($user, $uid, $name) {
return $token->getUID() === $uid &&
@@ -328,7 +326,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->tokenProvider->getPassword($token, 'newId') === 'password';
}));
$this->mapper
- ->expects($this->at(2))
+ ->expects($this->once())
->method('delete')
->with($this->callback(function ($token) use ($oldToken) {
return $token === $oldToken;
@@ -372,10 +370,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$uid = 'user';
$user = 'User';
$password = 'passme';
- $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
+ $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
$type = IToken::PERMANENT_TOKEN;
$actual = $this->tokenProvider->generateToken($token, $uid, $user, $password, $name, $type, IToken::DO_NOT_REMEMBER);
@@ -440,10 +435,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$uid = 'user';
$user = 'User';
$password = 'password';
- $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
+ $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
$type = IToken::PERMANENT_TOKEN;
$actual = $this->tokenProvider->generateToken($token, $uid, $user, $password, $name, $type, IToken::DO_NOT_REMEMBER);
@@ -458,10 +450,7 @@ class PublicKeyTokenProviderTest extends TestCase {
$uid = 'user';
$user = 'User';
$password = null;
- $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12'
- . 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
+ $name = 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
$type = IToken::PERMANENT_TOKEN;
$actual = $this->tokenProvider->generateToken($token, $uid, $user, $password, $name, $type, IToken::DO_NOT_REMEMBER);
diff --git a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
index fc921b8016b..ae6fadc790c 100644
--- a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
+++ b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
@@ -376,13 +376,13 @@ class ManagerTest extends TestCase {
->method('get')
->with('two_factor_remember_login')
->willReturn(false);
- $this->session->expects($this->at(1))
+ $this->session->expects($this->exactly(2))
->method('remove')
- ->with('two_factor_auth_uid');
- $this->session->expects($this->at(2))
- ->method('remove')
- ->with('two_factor_remember_login');
- $this->session->expects($this->at(3))
+ ->withConsecutive(
+ ['two_factor_auth_uid'],
+ ['two_factor_remember_login']
+ );
+ $this->session->expects($this->once())
->method('set')
->with(Manager::SESSION_UID_DONE, 'jos');
$this->session->method('getId')
@@ -494,17 +494,13 @@ class ManagerTest extends TestCase {
public function testNeedsSecondFactor() {
$user = $this->createMock(IUser::class);
- $this->session->expects($this->at(0))
- ->method('exists')
- ->with('app_password')
- ->willReturn(false);
- $this->session->expects($this->at(1))
+ $this->session->expects($this->exactly(3))
->method('exists')
- ->with('two_factor_auth_uid')
- ->willReturn(false);
- $this->session->expects($this->at(2))
- ->method('exists')
- ->with(Manager::SESSION_UID_DONE)
+ ->withConsecutive(
+ ['app_password'],
+ ['two_factor_auth_uid'],
+ [Manager::SESSION_UID_DONE],
+ )
->willReturn(false);
$this->session->method('getId')
@@ -575,12 +571,12 @@ class ManagerTest extends TestCase {
$this->user->method('getUID')
->willReturn('ferdinand');
- $this->session->expects($this->at(0))
- ->method('set')
- ->with('two_factor_auth_uid', 'ferdinand');
- $this->session->expects($this->at(1))
+ $this->session->expects($this->exactly(2))
->method('set')
- ->with('two_factor_remember_login', true);
+ ->withConsecutive(
+ ['two_factor_auth_uid', 'ferdinand'],
+ ['two_factor_remember_login', true]
+ );
$this->session->method('getId')
->willReturn('mysessionid');
@@ -605,12 +601,12 @@ class ManagerTest extends TestCase {
$this->user->method('getUID')
->willReturn('ferdinand');
- $this->session->expects($this->at(0))
- ->method('set')
- ->with('two_factor_auth_uid', 'ferdinand');
- $this->session->expects($this->at(1))
+ $this->session->expects($this->exactly(2))
->method('set')
- ->with('two_factor_remember_login', false);
+ ->withConsecutive(
+ ['two_factor_auth_uid', 'ferdinand'],
+ ['two_factor_remember_login', false]
+ );
$this->session->method('getId')
->willReturn('mysessionid');
diff --git a/tests/lib/Collaboration/Collaborators/LookupPluginTest.php b/tests/lib/Collaboration/Collaborators/LookupPluginTest.php
index 3ec9e6f5efc..1d856252745 100644
--- a/tests/lib/Collaboration/Collaborators/LookupPluginTest.php
+++ b/tests/lib/Collaboration/Collaborators/LookupPluginTest.php
@@ -303,6 +303,7 @@ class LookupPluginTest extends TestCase {
'label' => $fedIDs[0],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
+ 'globalScale' => true,
'shareWith' => $fedIDs[0]
],
'extra' => ['federationId' => $fedIDs[0]],
@@ -311,6 +312,7 @@ class LookupPluginTest extends TestCase {
'label' => $fedIDs[1],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
+ 'globalScale' => true,
'shareWith' => $fedIDs[1]
],
'extra' => ['federationId' => $fedIDs[1]],
@@ -319,6 +321,7 @@ class LookupPluginTest extends TestCase {
'label' => $fedIDs[2],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
+ 'globalScale' => true,
'shareWith' => $fedIDs[2]
],
'extra' => ['federationId' => $fedIDs[2]],
@@ -342,6 +345,7 @@ class LookupPluginTest extends TestCase {
'label' => $fedIDs[0],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
+ 'globalScale' => true,
'shareWith' => $fedIDs[0]
],
'extra' => ['federationId' => $fedIDs[0]],
@@ -350,6 +354,7 @@ class LookupPluginTest extends TestCase {
'label' => $fedIDs[1],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
+ 'globalScale' => true,
'shareWith' => $fedIDs[1]
],
'extra' => ['federationId' => $fedIDs[1]],
@@ -358,6 +363,7 @@ class LookupPluginTest extends TestCase {
'label' => $fedIDs[2],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
+ 'globalScale' => true,
'shareWith' => $fedIDs[2]
],
'extra' => ['federationId' => $fedIDs[2]],
@@ -381,6 +387,7 @@ class LookupPluginTest extends TestCase {
'label' => $fedIDs[0],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
+ 'globalScale' => false,
'shareWith' => $fedIDs[0]
],
'extra' => ['federationId' => $fedIDs[0]],
@@ -389,6 +396,7 @@ class LookupPluginTest extends TestCase {
'label' => $fedIDs[1],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
+ 'globalScale' => false,
'shareWith' => $fedIDs[1]
],
'extra' => ['federationId' => $fedIDs[1]],
@@ -397,6 +405,7 @@ class LookupPluginTest extends TestCase {
'label' => $fedIDs[2],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
+ 'globalScale' => false,
'shareWith' => $fedIDs[2]
],
'extra' => ['federationId' => $fedIDs[2]],
@@ -471,6 +480,7 @@ class LookupPluginTest extends TestCase {
'label' => $fedIDs[0],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
+ 'globalScale' => false,
'shareWith' => $fedIDs[0]
],
'extra' => ['federationId' => $fedIDs[0]],
@@ -479,6 +489,7 @@ class LookupPluginTest extends TestCase {
'label' => $fedIDs[1],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
+ 'globalScale' => false,
'shareWith' => $fedIDs[1]
],
'extra' => ['federationId' => $fedIDs[1]],
@@ -487,6 +498,7 @@ class LookupPluginTest extends TestCase {
'label' => $fedIDs[2],
'value' => [
'shareType' => IShare::TYPE_REMOTE,
+ 'globalScale' => false,
'shareWith' => $fedIDs[2]
],
'extra' => ['federationId' => $fedIDs[2]],