aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/l10n/de.js6
-rw-r--r--apps/files_sharing/l10n/de.json6
-rw-r--r--apps/files_sharing/l10n/de_DE.js4
-rw-r--r--apps/files_sharing/l10n/de_DE.json4
-rw-r--r--apps/files_sharing/l10n/ga.js3
-rw-r--r--apps/files_sharing/l10n/ga.json3
-rw-r--r--apps/files_sharing/lib/Cache.php2
-rw-r--r--apps/files_sharing/lib/Controller/PublicPreviewController.php14
-rw-r--r--apps/files_sharing/lib/External/Scanner.php3
-rw-r--r--apps/files_sharing/openapi.json23
-rw-r--r--apps/files_sharing/src/views/SharingDetailsTab.vue3
-rw-r--r--apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php4
-rw-r--r--apps/files_sharing/tests/EncryptedSizePropagationTest.php11
-rw-r--r--apps/files_sharing/tests/TestCase.php4
14 files changed, 72 insertions, 18 deletions
diff --git a/apps/files_sharing/l10n/de.js b/apps/files_sharing/l10n/de.js
index f547ac5d350..f6aa0685ab2 100644
--- a/apps/files_sharing/l10n/de.js
+++ b/apps/files_sharing/l10n/de.js
@@ -54,7 +54,7 @@ OC.L10N.register(
"{actor} removed you from the share named {file}" : "{actor} hat dich aus der Freigabe von {file} entfernt",
"Share for file {file} with {user} expired" : "Freigabe für die Datei {file} mit {user} abgelaufen",
"Share for file {file} expired" : "Freigabe für die Datei {file} abgelaufen",
- "A file or folder shared by mail or by public link was <strong>downloaded</strong>" : "Öffentlich oder per E-Mail geteilte Datei oder Ordner wurde <strong>heruntergeladen</strong>",
+ "A file or folder shared by mail or by public link was <strong>downloaded</strong>" : "Öffentlich oder per E-Mail geteilte Datei oder geteilter Ordner wurde <strong>heruntergeladen</strong>",
"Files have been <strong>uploaded</strong> to a folder shared by mail or by public link" : "Dateien wurden in einen per E-Mail oder über einen öffentlichen Link freigegebenen Ordner <strong>hochgeladen</strong>",
"A file or folder was shared from <strong>another server</strong>" : "Eine Datei oder ein Ordner wurde von <strong>einem anderen Server</strong> geteilt",
"Sharing" : "Teilen",
@@ -356,10 +356,10 @@ OC.L10N.register(
"List of files that you shared with others." : "Liste der Dateien, die du mit anderen geteilt hast",
"Nothing shared yet" : "Noch nichts geteilt",
"Files and folders you shared will show up here" : "Von dir geteilte Dateien und Ordner werden hier angezeigt",
- "Shared by link" : "Geteilt über einen Link",
+ "Shared by link" : "Über einen Link geteilt",
"List of files that are shared by link." : "Liste der Dateien, die mittels Link geteilt wurden.",
"No shared links" : "Keine geteilten Links",
- "Files and folders you shared by link will show up here" : "Von dir per Link geteilte Dateien werden hier angezeigt",
+ "Files and folders you shared by link will show up here" : "Von dir mittels Link geteilte Dateien und Ordner werden hier angezeigt werden",
"File requests" : "Dateianfragen",
"List of file requests." : "Liste der Dateianfragen.",
"No file requests" : "Keine Dateianfragen",
diff --git a/apps/files_sharing/l10n/de.json b/apps/files_sharing/l10n/de.json
index ec1399b28fa..52b17773dbd 100644
--- a/apps/files_sharing/l10n/de.json
+++ b/apps/files_sharing/l10n/de.json
@@ -52,7 +52,7 @@
"{actor} removed you from the share named {file}" : "{actor} hat dich aus der Freigabe von {file} entfernt",
"Share for file {file} with {user} expired" : "Freigabe für die Datei {file} mit {user} abgelaufen",
"Share for file {file} expired" : "Freigabe für die Datei {file} abgelaufen",
- "A file or folder shared by mail or by public link was <strong>downloaded</strong>" : "Öffentlich oder per E-Mail geteilte Datei oder Ordner wurde <strong>heruntergeladen</strong>",
+ "A file or folder shared by mail or by public link was <strong>downloaded</strong>" : "Öffentlich oder per E-Mail geteilte Datei oder geteilter Ordner wurde <strong>heruntergeladen</strong>",
"Files have been <strong>uploaded</strong> to a folder shared by mail or by public link" : "Dateien wurden in einen per E-Mail oder über einen öffentlichen Link freigegebenen Ordner <strong>hochgeladen</strong>",
"A file or folder was shared from <strong>another server</strong>" : "Eine Datei oder ein Ordner wurde von <strong>einem anderen Server</strong> geteilt",
"Sharing" : "Teilen",
@@ -354,10 +354,10 @@
"List of files that you shared with others." : "Liste der Dateien, die du mit anderen geteilt hast",
"Nothing shared yet" : "Noch nichts geteilt",
"Files and folders you shared will show up here" : "Von dir geteilte Dateien und Ordner werden hier angezeigt",
- "Shared by link" : "Geteilt über einen Link",
+ "Shared by link" : "Über einen Link geteilt",
"List of files that are shared by link." : "Liste der Dateien, die mittels Link geteilt wurden.",
"No shared links" : "Keine geteilten Links",
- "Files and folders you shared by link will show up here" : "Von dir per Link geteilte Dateien werden hier angezeigt",
+ "Files and folders you shared by link will show up here" : "Von dir mittels Link geteilte Dateien und Ordner werden hier angezeigt werden",
"File requests" : "Dateianfragen",
"List of file requests." : "Liste der Dateianfragen.",
"No file requests" : "Keine Dateianfragen",
diff --git a/apps/files_sharing/l10n/de_DE.js b/apps/files_sharing/l10n/de_DE.js
index b8928cb36b9..1269c6a0cfb 100644
--- a/apps/files_sharing/l10n/de_DE.js
+++ b/apps/files_sharing/l10n/de_DE.js
@@ -54,7 +54,7 @@ OC.L10N.register(
"{actor} removed you from the share named {file}" : "{actor} hat Sie aus der Freigabe von {file} entfernt",
"Share for file {file} with {user} expired" : "Freigabe der Datei {file} für {user} abgelaufen",
"Share for file {file} expired" : "Freigabe für die Datei {file} abgelaufen",
- "A file or folder shared by mail or by public link was <strong>downloaded</strong>" : "Öffentlich oder per E-Mail geteilte Datei / Ordner wurde <strong>heruntergeladen</strong>",
+ "A file or folder shared by mail or by public link was <strong>downloaded</strong>" : "Öffentlich oder per E-Mail geteilte Datei oder geteilter Ordner wurde <strong>heruntergeladen</strong>",
"Files have been <strong>uploaded</strong> to a folder shared by mail or by public link" : "Dateien wurden in einen per E-Mail oder über einen öffentlichen Link freigegebenen Ordner <strong>hochgeladen</strong>",
"A file or folder was shared from <strong>another server</strong>" : "Eine Datei oder ein Ordner wurde von <strong>einem anderen Server</strong> geteilt",
"Sharing" : "Teilen",
@@ -356,7 +356,7 @@ OC.L10N.register(
"List of files that you shared with others." : "Liste der Dateien, die Sie mit anderen geteilt haben.",
"Nothing shared yet" : "Noch nichts geteilt",
"Files and folders you shared will show up here" : "Von Ihnen geteilte Dateien und Ordner werden hier angezeigt werden",
- "Shared by link" : "Geteilt über einen Link",
+ "Shared by link" : "Über einen Link geteilt",
"List of files that are shared by link." : "Liste der Dateien, die mittels Link geteilt wurden.",
"No shared links" : "Keine geteilten Links",
"Files and folders you shared by link will show up here" : "Von Ihnen mittels Link geteilte Dateien und Ordner werden hier angezeigt werden",
diff --git a/apps/files_sharing/l10n/de_DE.json b/apps/files_sharing/l10n/de_DE.json
index 1a2c0380c70..0a61a725d3e 100644
--- a/apps/files_sharing/l10n/de_DE.json
+++ b/apps/files_sharing/l10n/de_DE.json
@@ -52,7 +52,7 @@
"{actor} removed you from the share named {file}" : "{actor} hat Sie aus der Freigabe von {file} entfernt",
"Share for file {file} with {user} expired" : "Freigabe der Datei {file} für {user} abgelaufen",
"Share for file {file} expired" : "Freigabe für die Datei {file} abgelaufen",
- "A file or folder shared by mail or by public link was <strong>downloaded</strong>" : "Öffentlich oder per E-Mail geteilte Datei / Ordner wurde <strong>heruntergeladen</strong>",
+ "A file or folder shared by mail or by public link was <strong>downloaded</strong>" : "Öffentlich oder per E-Mail geteilte Datei oder geteilter Ordner wurde <strong>heruntergeladen</strong>",
"Files have been <strong>uploaded</strong> to a folder shared by mail or by public link" : "Dateien wurden in einen per E-Mail oder über einen öffentlichen Link freigegebenen Ordner <strong>hochgeladen</strong>",
"A file or folder was shared from <strong>another server</strong>" : "Eine Datei oder ein Ordner wurde von <strong>einem anderen Server</strong> geteilt",
"Sharing" : "Teilen",
@@ -354,7 +354,7 @@
"List of files that you shared with others." : "Liste der Dateien, die Sie mit anderen geteilt haben.",
"Nothing shared yet" : "Noch nichts geteilt",
"Files and folders you shared will show up here" : "Von Ihnen geteilte Dateien und Ordner werden hier angezeigt werden",
- "Shared by link" : "Geteilt über einen Link",
+ "Shared by link" : "Über einen Link geteilt",
"List of files that are shared by link." : "Liste der Dateien, die mittels Link geteilt wurden.",
"No shared links" : "Keine geteilten Links",
"Files and folders you shared by link will show up here" : "Von Ihnen mittels Link geteilte Dateien und Ordner werden hier angezeigt werden",
diff --git a/apps/files_sharing/l10n/ga.js b/apps/files_sharing/l10n/ga.js
index 0d41d4d1235..f8ddae9a8ea 100644
--- a/apps/files_sharing/l10n/ga.js
+++ b/apps/files_sharing/l10n/ga.js
@@ -313,7 +313,9 @@ OC.L10N.register(
"Use this method to share files with individuals or teams within your organization. If the recipient already has access to the share but cannot locate it, you can send them the internal share link for easy access." : "Bain úsáid as an modh seo chun comhaid a roinnt le daoine aonair nó le foirne laistigh de d'eagraíocht. Má tá rochtain ag an bhfaighteoir ar an sciar cheana féin ach nach féidir leis í a aimsiú, is féidir leat an nasc scaire inmheánach a sheoladh chucu le go mbeidh rochtain éasca air.",
"Use this method to share files with individuals or organizations outside your organization. Files and folders can be shared via public share links and email addresses. You can also share to other Nextcloud accounts hosted on different instances using their federated cloud ID." : "Bain úsáid as an modh seo chun comhaid a roinnt le daoine aonair nó le heagraíochtaí lasmuigh de d'eagraíocht. Is féidir comhaid agus fillteáin a roinnt trí naisc scaireanna poiblí agus seoltaí ríomhphoist. Is féidir leat a roinnt freisin le cuntais Nextcloud eile arna óstáil ar chásanna éagsúla ag baint úsáide as a n-ID néil cónasctha.",
"Shares that are not part of the internal or external shares. This can be shares from apps or other sources." : "Scaireanna nach cuid de na scaireanna inmheánacha nó seachtracha iad. Is féidir gur scaireanna iad seo ó aipeanna nó ó fhoinsí eile.",
+ "Share with accounts, teams, federated cloud IDs" : "Comhroinn le cuntais, foirne, agus aitheantóirí scamall cónaidhme",
"Share with accounts and teams" : "Roinn le cuntais agus foirne",
+ "Email, federated cloud ID" : "Ríomhphost, ID scamall cónaidhme",
"Unable to load the shares list" : "Ní féidir an liosta scaireanna a lódáil",
"Expires {relativetime}" : "In éag {relativetime}",
"this share just expired." : "tá an sciar seo díreach imithe in éag.",
@@ -422,6 +424,7 @@ OC.L10N.register(
"You are not allowed to edit link shares that you don't own" : "Níl cead agat scaireanna naisc nach leatsa a chur in eagar",
"_1 email address already added_::_{count} email addresses already added_" : ["1 seoladh ríomhphoist curtha leis cheana féin","{count} seoladh ríomhphoist curtha leis cheana","{count} seoladh ríomhphoist curtha leis cheana","{count} seoladh ríomhphoist curtha leis cheana","{count} seoladh ríomhphoist curtha leis cheana"],
"_1 email address added_::_{count} email addresses added_" : ["Cuireadh 1 seoladh ríomhphoist leis","{count} seoladh ríomhphoist curtha leis","{count} seoladh ríomhphoist curtha leis","{count} seoladh ríomhphoist curtha leis","{count} seoladh ríomhphoist curtha leis"],
+ "Share with accounts, teams, federated cloud id" : "Comhroinn le cuntais, foirne, aitheantas scamall cónaidhme",
"Email, federated cloud id" : "Ríomhphost, aitheantas scamall cónaidhme"
},
"nplurals=5; plural=(n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : 4);");
diff --git a/apps/files_sharing/l10n/ga.json b/apps/files_sharing/l10n/ga.json
index 418aa49ccc3..f556e802f52 100644
--- a/apps/files_sharing/l10n/ga.json
+++ b/apps/files_sharing/l10n/ga.json
@@ -311,7 +311,9 @@
"Use this method to share files with individuals or teams within your organization. If the recipient already has access to the share but cannot locate it, you can send them the internal share link for easy access." : "Bain úsáid as an modh seo chun comhaid a roinnt le daoine aonair nó le foirne laistigh de d'eagraíocht. Má tá rochtain ag an bhfaighteoir ar an sciar cheana féin ach nach féidir leis í a aimsiú, is féidir leat an nasc scaire inmheánach a sheoladh chucu le go mbeidh rochtain éasca air.",
"Use this method to share files with individuals or organizations outside your organization. Files and folders can be shared via public share links and email addresses. You can also share to other Nextcloud accounts hosted on different instances using their federated cloud ID." : "Bain úsáid as an modh seo chun comhaid a roinnt le daoine aonair nó le heagraíochtaí lasmuigh de d'eagraíocht. Is féidir comhaid agus fillteáin a roinnt trí naisc scaireanna poiblí agus seoltaí ríomhphoist. Is féidir leat a roinnt freisin le cuntais Nextcloud eile arna óstáil ar chásanna éagsúla ag baint úsáide as a n-ID néil cónasctha.",
"Shares that are not part of the internal or external shares. This can be shares from apps or other sources." : "Scaireanna nach cuid de na scaireanna inmheánacha nó seachtracha iad. Is féidir gur scaireanna iad seo ó aipeanna nó ó fhoinsí eile.",
+ "Share with accounts, teams, federated cloud IDs" : "Comhroinn le cuntais, foirne, agus aitheantóirí scamall cónaidhme",
"Share with accounts and teams" : "Roinn le cuntais agus foirne",
+ "Email, federated cloud ID" : "Ríomhphost, ID scamall cónaidhme",
"Unable to load the shares list" : "Ní féidir an liosta scaireanna a lódáil",
"Expires {relativetime}" : "In éag {relativetime}",
"this share just expired." : "tá an sciar seo díreach imithe in éag.",
@@ -420,6 +422,7 @@
"You are not allowed to edit link shares that you don't own" : "Níl cead agat scaireanna naisc nach leatsa a chur in eagar",
"_1 email address already added_::_{count} email addresses already added_" : ["1 seoladh ríomhphoist curtha leis cheana féin","{count} seoladh ríomhphoist curtha leis cheana","{count} seoladh ríomhphoist curtha leis cheana","{count} seoladh ríomhphoist curtha leis cheana","{count} seoladh ríomhphoist curtha leis cheana"],
"_1 email address added_::_{count} email addresses added_" : ["Cuireadh 1 seoladh ríomhphoist leis","{count} seoladh ríomhphoist curtha leis","{count} seoladh ríomhphoist curtha leis","{count} seoladh ríomhphoist curtha leis","{count} seoladh ríomhphoist curtha leis"],
+ "Share with accounts, teams, federated cloud id" : "Comhroinn le cuntais, foirne, aitheantas scamall cónaidhme",
"Email, federated cloud id" : "Ríomhphost, aitheantas scamall cónaidhme"
},"pluralForm" :"nplurals=5; plural=(n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : 4);"
} \ No newline at end of file
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php
index ccc93eb0952..024df5d3f43 100644
--- a/apps/files_sharing/lib/Cache.php
+++ b/apps/files_sharing/lib/Cache.php
@@ -68,7 +68,7 @@ class Cache extends CacheJail {
return $this->root;
}
- protected function getGetUnjailedRoot(): string {
+ public function getGetUnjailedRoot(): string {
return $this->sourceRootInfo->getPath();
}
diff --git a/apps/files_sharing/lib/Controller/PublicPreviewController.php b/apps/files_sharing/lib/Controller/PublicPreviewController.php
index 91dead57e80..16886e930fa 100644
--- a/apps/files_sharing/lib/Controller/PublicPreviewController.php
+++ b/apps/files_sharing/lib/Controller/PublicPreviewController.php
@@ -11,6 +11,7 @@ use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\Attribute\PublicPage;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\FileDisplayResponse;
+use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\PublicShareController;
use OCP\Constants;
use OCP\Files\Folder;
@@ -18,6 +19,7 @@ use OCP\Files\NotFoundException;
use OCP\IPreview;
use OCP\IRequest;
use OCP\ISession;
+use OCP\Preview\IMimeIconProvider;
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IManager as ShareManager;
use OCP\Share\IShare;
@@ -33,6 +35,7 @@ class PublicPreviewController extends PublicShareController {
private ShareManager $shareManager,
ISession $session,
private IPreview $previewManager,
+ private IMimeIconProvider $mimeIconProvider,
) {
parent::__construct($appName, $request, $session);
}
@@ -63,9 +66,11 @@ class PublicPreviewController extends PublicShareController {
* @param int $x Width of the preview
* @param int $y Height of the preview
* @param bool $a Whether to not crop the preview
- * @return FileDisplayResponse<Http::STATUS_OK, array{Content-Type: string}>|DataResponse<Http::STATUS_BAD_REQUEST|Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND, list<empty>, array{}>
+ * @param bool $mimeFallback Whether to fallback to the mime icon if no preview is available
+ * @return FileDisplayResponse<Http::STATUS_OK, array{Content-Type: string}>|DataResponse<Http::STATUS_BAD_REQUEST|Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND, list<empty>, array{}>|RedirectResponse<Http::STATUS_SEE_OTHER, array{}>
*
* 200: Preview returned
+ * 303: Redirect to the mime icon url if mimeFallback is true
* 400: Getting preview is not possible
* 403: Getting preview is not allowed
* 404: Share or preview not found
@@ -79,6 +84,7 @@ class PublicPreviewController extends PublicShareController {
int $x = 32,
int $y = 32,
$a = false,
+ bool $mimeFallback = false,
) {
$cacheForSeconds = 60 * 60 * 24; // 1 day
@@ -124,6 +130,12 @@ class PublicPreviewController extends PublicShareController {
$response->cacheFor($cacheForSeconds);
return $response;
} catch (NotFoundException $e) {
+ // If we have no preview enabled, we can redirect to the mime icon if any
+ if ($mimeFallback) {
+ if ($url = $this->mimeIconProvider->getMimeIconUrl($file->getMimeType())) {
+ return new RedirectResponse($url);
+ }
+ }
return new DataResponse([], Http::STATUS_NOT_FOUND);
} catch (\InvalidArgumentException $e) {
return new DataResponse([], Http::STATUS_BAD_REQUEST);
diff --git a/apps/files_sharing/lib/External/Scanner.php b/apps/files_sharing/lib/External/Scanner.php
index e45d3723923..2b0741b4b96 100644
--- a/apps/files_sharing/lib/External/Scanner.php
+++ b/apps/files_sharing/lib/External/Scanner.php
@@ -6,6 +6,7 @@
*/
namespace OCA\Files_Sharing\External;
+use OC\Files\Cache\CacheEntry;
use OC\ForbiddenException;
use OCP\Files\NotFoundException;
use OCP\Files\StorageInvalidException;
@@ -29,7 +30,7 @@ class Scanner extends \OC\Files\Cache\Scanner {
* @param string $file file to scan
* @param int $reuseExisting
* @param int $parentId
- * @param \OC\Files\Cache\CacheEntry|array|null|false $cacheData existing data in the cache for the file to be scanned
+ * @param CacheEntry|array|null|false $cacheData existing data in the cache for the file to be scanned
* @param bool $lock set to false to disable getting an additional read lock during scanning
* @param array|null $data the metadata for the file, as returned by the storage
* @return array|null an array of metadata of the scanned file
diff --git a/apps/files_sharing/openapi.json b/apps/files_sharing/openapi.json
index e70764a59f2..68420dde80e 100644
--- a/apps/files_sharing/openapi.json
+++ b/apps/files_sharing/openapi.json
@@ -1477,6 +1477,19 @@
1
]
}
+ },
+ {
+ "name": "mimeFallback",
+ "in": "query",
+ "description": "Whether to fallback to the mime icon if no preview is available",
+ "schema": {
+ "type": "integer",
+ "default": 0,
+ "enum": [
+ 0,
+ 1
+ ]
+ }
}
],
"responses": {
@@ -1514,6 +1527,16 @@
"schema": {}
}
}
+ },
+ "303": {
+ "description": "Redirect to the mime icon url if mimeFallback is true",
+ "headers": {
+ "Location": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue
index 5b778223c8b..8912ff340b7 100644
--- a/apps/files_sharing/src/views/SharingDetailsTab.vue
+++ b/apps/files_sharing/src/views/SharingDetailsTab.vue
@@ -905,8 +905,9 @@ export default {
this.advancedSectionAccordionExpanded = true
}
- if (this.share.note) {
+ if (this.isValidShareAttribute(this.share.note)) {
this.writeNoteToRecipientIsChecked = true
+ this.advancedSectionAccordionExpanded = true
}
},
diff --git a/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php b/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php
index bd64cfc60b4..9750274ff62 100644
--- a/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php
+++ b/apps/files_sharing/tests/Controller/PublicPreviewControllerTest.php
@@ -18,6 +18,7 @@ use OCP\Files\SimpleFS\ISimpleFile;
use OCP\IPreview;
use OCP\IRequest;
use OCP\ISession;
+use OCP\Preview\IMimeIconProvider;
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IAttributes;
use OCP\Share\IManager;
@@ -52,7 +53,8 @@ class PublicPreviewControllerTest extends TestCase {
$this->request,
$this->shareManager,
$this->createMock(ISession::class),
- $this->previewManager
+ $this->previewManager,
+ $this->createMock(IMimeIconProvider::class),
);
}
diff --git a/apps/files_sharing/tests/EncryptedSizePropagationTest.php b/apps/files_sharing/tests/EncryptedSizePropagationTest.php
index 1430e5f17ac..a416cd14715 100644
--- a/apps/files_sharing/tests/EncryptedSizePropagationTest.php
+++ b/apps/files_sharing/tests/EncryptedSizePropagationTest.php
@@ -17,13 +17,22 @@ use Test\Traits\EncryptionTrait;
class EncryptedSizePropagationTest extends SizePropagationTest {
use EncryptionTrait;
+ protected function setUp(): void {
+ parent::setUp();
+ $this->config->setAppValue('encryption', 'useMasterKey', '0');
+ }
+
protected function setupUser($name, $password = '') {
$this->createUser($name, $password);
$tmpFolder = Server::get(ITempManager::class)->getTemporaryFolder();
$this->registerMount($name, '\OC\Files\Storage\Local', '/' . $name, ['datadir' => $tmpFolder]);
- $this->config->setAppValue('encryption', 'useMasterKey', '0');
$this->setupForUser($name, $password);
$this->loginWithEncryption($name);
return new View('/' . $name . '/files');
}
+
+ protected function loginHelper($user, $create = false, $password = false) {
+ $this->setupForUser($user, $password);
+ parent::loginHelper($user, $create, $password);
+ }
}
diff --git a/apps/files_sharing/tests/TestCase.php b/apps/files_sharing/tests/TestCase.php
index 647a591db8d..34e2d71fb02 100644
--- a/apps/files_sharing/tests/TestCase.php
+++ b/apps/files_sharing/tests/TestCase.php
@@ -108,7 +108,7 @@ abstract class TestCase extends \Test\TestCase {
Server::get(DisplayNameCache::class)->clear();
//login as user1
- self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
+ $this->loginHelper(self::TEST_FILES_SHARING_API_USER1);
$this->data = 'foobar';
$this->view = new View('/' . self::TEST_FILES_SHARING_API_USER1 . '/files');
@@ -173,7 +173,7 @@ abstract class TestCase extends \Test\TestCase {
* @param bool $create
* @param bool $password
*/
- protected static function loginHelper($user, $create = false, $password = false) {
+ protected function loginHelper($user, $create = false, $password = false) {
if ($password === false) {
$password = $user;
}