summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/l10n/pt_BR.js2
-rw-r--r--lib/l10n/pt_BR.json2
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php5
-rw-r--r--lib/private/Files/Node/Node.php6
-rw-r--r--lib/private/Files/ObjectStore/SwiftFactory.php6
-rw-r--r--lib/private/legacy/util.php17
6 files changed, 31 insertions, 7 deletions
diff --git a/lib/l10n/pt_BR.js b/lib/l10n/pt_BR.js
index 0f292d3aac8..623ba939dbc 100644
--- a/lib/l10n/pt_BR.js
+++ b/lib/l10n/pt_BR.js
@@ -58,7 +58,7 @@ OC.L10N.register(
"Empty filename is not allowed" : "Nome vazio para arquivo não é permitido.",
"App \"%s\" cannot be installed because appinfo file cannot be read." : "O aplicativo \"%s\" não pode ser instalado pois o arquivo appinfo não pôde ser lido.",
"App \"%s\" cannot be installed because it is not compatible with this version of the server." : "O aplicativo \"%s\" não pode ser instalado pois não é compatível com a versão do servidor.",
- "This is an automatically sent email, please do not reply." : "Este é um e-mail enviado automaticamente. Por favor, não responda.",
+ "This is an automatically sent email, please do not reply." : "Este é um email enviado automaticamente. Por favor, não responda.",
"Help" : "Ajuda",
"Apps" : "Aplicativos",
"Settings" : "Configurações",
diff --git a/lib/l10n/pt_BR.json b/lib/l10n/pt_BR.json
index 62571d500a3..0eaeb8daaf0 100644
--- a/lib/l10n/pt_BR.json
+++ b/lib/l10n/pt_BR.json
@@ -56,7 +56,7 @@
"Empty filename is not allowed" : "Nome vazio para arquivo não é permitido.",
"App \"%s\" cannot be installed because appinfo file cannot be read." : "O aplicativo \"%s\" não pode ser instalado pois o arquivo appinfo não pôde ser lido.",
"App \"%s\" cannot be installed because it is not compatible with this version of the server." : "O aplicativo \"%s\" não pode ser instalado pois não é compatível com a versão do servidor.",
- "This is an automatically sent email, please do not reply." : "Este é um e-mail enviado automaticamente. Por favor, não responda.",
+ "This is an automatically sent email, please do not reply." : "Este é um email enviado automaticamente. Por favor, não responda.",
"Help" : "Ajuda",
"Apps" : "Aplicativos",
"Settings" : "Configurações",
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index 37a34106dbe..c82ac5255dd 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -46,6 +46,7 @@ use OC\AppFramework\Middleware\Security\RateLimitingMiddleware;
use OC\AppFramework\Middleware\Security\SecurityMiddleware;
use OC\AppFramework\Middleware\SessionMiddleware;
use OC\AppFramework\Utility\SimpleContainer;
+use OC\Collaboration\Collaborators\SearchResult;
use OC\Core\Middleware\TwoFactorMiddleware;
use OC\RichObjectStrings\Validator;
use OC\ServerContainer;
@@ -53,6 +54,7 @@ use OCP\AppFramework\Http\IOutput;
use OCP\AppFramework\IAppContainer;
use OCP\AppFramework\QueryException;
use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\Collaboration\Collaborators\ISearchResult;
use OCP\Files\Folder;
use OCP\Files\IAppData;
use OCP\GlobalScale\IConfig;
@@ -62,7 +64,6 @@ use OCP\IRequest;
use OCP\IServerContainer;
use OCP\IUserSession;
use OCP\RichObjectStrings\IValidator;
-use OCP\Util;
use OCP\Encryption\IManager;
use OCA\WorkflowEngine\Manager;
@@ -144,6 +145,8 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return $c;
});
+ $this->registerAlias(ISearchResult::class, SearchResult::class);
+
// commonly used attributes
$this->registerService('UserId', function ($c) {
return $c->query(IUserSession::class)->getSession()->get('user_id');
diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php
index 304b2ccf464..d2232624b9b 100644
--- a/lib/private/Files/Node/Node.php
+++ b/lib/private/Files/Node/Node.php
@@ -265,7 +265,11 @@ class Node implements \OCP\Files\Node {
* @return Node
*/
public function getParent() {
- return $this->root->get(dirname($this->path));
+ $newPath = dirname($this->path);
+ if ($newPath === '' || $newPath === '.' || $newPath === '/') {
+ return $this->root;
+ }
+ return $this->root->get($newPath);
}
/**
diff --git a/lib/private/Files/ObjectStore/SwiftFactory.php b/lib/private/Files/ObjectStore/SwiftFactory.php
index 8baaec985e8..3ff534b4e64 100644
--- a/lib/private/Files/ObjectStore/SwiftFactory.php
+++ b/lib/private/Files/ObjectStore/SwiftFactory.php
@@ -56,7 +56,7 @@ class SwiftFactory {
private function getCachedToken(string $cacheKey) {
$cachedTokenString = $this->cache->get($cacheKey . '/token');
if ($cachedTokenString) {
- return json_decode($cachedTokenString);
+ return json_decode($cachedTokenString, true);
} else {
return null;
}
@@ -131,9 +131,9 @@ class SwiftFactory {
$cachedToken = $this->params['cachedToken'];
$hasValidCachedToken = false;
- if (is_array($cachedToken)) {
+ if (\is_array($cachedToken) && ($authService instanceof IdentityV3Service)) {
$token = $authService->generateTokenFromCache($cachedToken);
- if (is_null($token->catalog)) {
+ if (\is_null($token->catalog)) {
$this->logger->warning('Invalid cached token for swift, no catalog set: ' . json_encode($cachedToken));
} else if ($token->hasExpired()) {
$this->logger->debug('Cached token for swift expired');
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php
index d3599d14e7a..356d336f687 100644
--- a/lib/private/legacy/util.php
+++ b/lib/private/legacy/util.php
@@ -259,6 +259,23 @@ class OC_Util {
return $storage;
});
+ \OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) {
+ /*
+ * Do not allow any operations that modify the storage
+ */
+ if ($mount->getOption('readonly', false)) {
+ return new \OC\Files\Storage\Wrapper\PermissionsMask([
+ 'storage' => $storage,
+ 'mask' => \OCP\Constants::PERMISSION_ALL & ~(
+ \OCP\Constants::PERMISSION_UPDATE |
+ \OCP\Constants::PERMISSION_CREATE |
+ \OCP\Constants::PERMISSION_DELETE
+ ),
+ ]);
+ }
+ return $storage;
+ });
+
OC_Hook::emit('OC_Filesystem', 'preSetup', array('user' => $user));
\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(true);