aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/federatedfilesharing/l10n/pl.js1
-rw-r--r--apps/federatedfilesharing/l10n/pl.json1
-rw-r--r--apps/federatedfilesharing/lib/FederatedShareProvider.php39
-rw-r--r--apps/files/l10n/es.js5
-rw-r--r--apps/files/l10n/es.json5
-rw-r--r--apps/files/l10n/pl.js5
-rw-r--r--apps/files/l10n/pl.json5
-rw-r--r--apps/files_sharing/l10n/es.js1
-rw-r--r--apps/files_sharing/l10n/es.json1
-rw-r--r--apps/files_sharing/l10n/pl.js3
-rw-r--r--apps/files_sharing/l10n/pl.json3
-rw-r--r--apps/settings/l10n/et_EE.js1
-rw-r--r--apps/settings/l10n/et_EE.json1
-rw-r--r--apps/settings/l10n/lv.js3
-rw-r--r--apps/settings/l10n/lv.json3
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php37
-rw-r--r--core/l10n/es.js1
-rw-r--r--core/l10n/es.json1
-rw-r--r--core/l10n/pl.js1
-rw-r--r--core/l10n/pl.json1
-rw-r--r--lib/composer/composer/autoload_classmap.php1
-rw-r--r--lib/composer/composer/autoload_static.php1
-rw-r--r--lib/l10n/es.js5
-rw-r--r--lib/l10n/es.json5
-rw-r--r--lib/l10n/et_EE.js4
-rw-r--r--lib/l10n/et_EE.json4
-rw-r--r--lib/private/Share20/DefaultShareProvider.php42
-rw-r--r--lib/private/Share20/Manager.php13
-rw-r--r--lib/public/Share/IShareProviderSupportsAllSharesInFolder.php24
-rw-r--r--tests/lib/Share20/ManagerTest.php23
30 files changed, 177 insertions, 63 deletions
diff --git a/apps/federatedfilesharing/l10n/pl.js b/apps/federatedfilesharing/l10n/pl.js
index bc76be7c614..a86a3a7de0f 100644
--- a/apps/federatedfilesharing/l10n/pl.js
+++ b/apps/federatedfilesharing/l10n/pl.js
@@ -23,6 +23,7 @@ OC.L10N.register(
"Sharing" : "Udostępnianie",
"Federated file sharing" : "Udostępnianie federacyjne plików",
"Provide federated file sharing across servers" : "Zezwól na udostępnianie federacyjne plików na serwerach",
+ "This is used to retrieve the federated cloud ID to make federated sharing easier." : "Służy do pobierania ID Chmury Federacyjnej, aby ułatwić udostępnianie federacyjne.",
"Unable to update federated files sharing config" : "Nie można zaktualizować konfiguracji udostępniania federacyjnego plików",
"Adjust how people can share between servers. This includes shares between people on this server as well if they are using federated sharing." : "Dostosuj sposób udostępniania między serwerami. Obejmuje to również udostępnianie między ludźmi na tym serwerze, jeśli korzystają z udostępniania federacyjnego.",
"Allow people on this server to send shares to other servers (this option also allows WebDAV access to public shares)" : "Zezwalaj ludziom na tym serwerze na wysłanie udostępnień do innych serwerów (opcja ta umożliwia również dostęp WebDAV do udostępnień publicznych)",
diff --git a/apps/federatedfilesharing/l10n/pl.json b/apps/federatedfilesharing/l10n/pl.json
index b55118c022c..2797e9c8f2d 100644
--- a/apps/federatedfilesharing/l10n/pl.json
+++ b/apps/federatedfilesharing/l10n/pl.json
@@ -21,6 +21,7 @@
"Sharing" : "Udostępnianie",
"Federated file sharing" : "Udostępnianie federacyjne plików",
"Provide federated file sharing across servers" : "Zezwól na udostępnianie federacyjne plików na serwerach",
+ "This is used to retrieve the federated cloud ID to make federated sharing easier." : "Służy do pobierania ID Chmury Federacyjnej, aby ułatwić udostępnianie federacyjne.",
"Unable to update federated files sharing config" : "Nie można zaktualizować konfiguracji udostępniania federacyjnego plików",
"Adjust how people can share between servers. This includes shares between people on this server as well if they are using federated sharing." : "Dostosuj sposób udostępniania między serwerami. Obejmuje to również udostępnianie między ludźmi na tym serwerze, jeśli korzystają z udostępniania federacyjnego.",
"Allow people on this server to send shares to other servers (this option also allows WebDAV access to public shares)" : "Zezwalaj ludziom na tym serwerze na wysłanie udostępnień do innych serwerów (opcja ta umożliwia również dostęp WebDAV do udostępnień publicznych)",
diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php
index d993b35845c..7c95b83a5dd 100644
--- a/apps/federatedfilesharing/lib/FederatedShareProvider.php
+++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php
@@ -26,6 +26,7 @@ use OCP\Share\Exceptions\GenericShareException;
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IShare;
use OCP\Share\IShareProvider;
+use OCP\Share\IShareProviderSupportsAllSharesInFolder;
use Psr\Log\LoggerInterface;
/**
@@ -33,7 +34,7 @@ use Psr\Log\LoggerInterface;
*
* @package OCA\FederatedFileSharing
*/
-class FederatedShareProvider implements IShareProvider {
+class FederatedShareProvider implements IShareProvider, IShareProviderSupportsAllSharesInFolder {
public const SHARE_TYPE_REMOTE = 6;
/** @var string */
@@ -553,7 +554,17 @@ class FederatedShareProvider implements IShareProvider {
if (!$shallow) {
throw new \Exception('non-shallow getSharesInFolder is no longer supported');
}
+ return $this->getSharesInFolderInternal($userId, $node, $reshares);
+ }
+
+ public function getAllSharesInFolder(Folder $node): array {
+ return $this->getSharesInFolderInternal(null, $node, null);
+ }
+ /**
+ * @return array<int, list<IShare>>
+ */
+ private function getSharesInFolderInternal(?string $userId, Folder $node, ?bool $reshares): array {
$qb = $this->dbConnection->getQueryBuilder();
$qb->select('*')
->from('share', 's')
@@ -562,18 +573,20 @@ class FederatedShareProvider implements IShareProvider {
$qb->expr()->eq('share_type', $qb->createNamedParameter(IShare::TYPE_REMOTE))
);
- /**
- * Reshares for this user are shares where they are the owner.
- */
- if ($reshares === false) {
- $qb->andWhere($qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId)));
- } else {
- $qb->andWhere(
- $qb->expr()->orX(
- $qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
- $qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId))
- )
- );
+ if ($userId !== null) {
+ /**
+ * Reshares for this user are shares where they are the owner.
+ */
+ if ($reshares !== true) {
+ $qb->andWhere($qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId)));
+ } else {
+ $qb->andWhere(
+ $qb->expr()->orX(
+ $qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
+ $qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId))
+ )
+ );
+ }
}
$qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
diff --git a/apps/files/l10n/es.js b/apps/files/l10n/es.js
index 452372aa9b2..54e89b8c5e6 100644
--- a/apps/files/l10n/es.js
+++ b/apps/files/l10n/es.js
@@ -43,6 +43,8 @@ OC.L10N.register(
"Files" : "Archivos",
"A file or folder has been <strong>changed</strong>" : "Se ha <strong>modificado</strong> un archivo o carpeta",
"A favorite file or folder has been <strong>changed</strong>" : "Un archivo o carpeta favorito ha sido <strong>cambiado</strong>",
+ "%1$s (renamed)" : "%1$s (renombrado)",
+ "renamed file" : "archivo renombrado",
"Failed to authorize" : "Fallo al autorizar",
"Invalid folder path" : "Ruta de carpeta inválida",
"Folder not found" : "Carpeta no encontrada",
@@ -71,6 +73,8 @@ OC.L10N.register(
"Transferred from %1$s on %2$s" : "Se transfirió desde %1$s en %2$s",
"Files compatibility" : "Compatibilidad de archivos",
"Allow to restrict filenames to ensure files can be synced with all clients. By default all filenames valid on POSIX (e.g. Linux or macOS) are allowed." : "Permitir la restricción en nombres de archivo para asegurar que los archivos se puedan sincronizar con todos los clientes. Por defecto, se permiten todos los nombres de archivos válidos en POSIX (por ejemplo, Linux o macOS).",
+ "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Luego de habilitar los nombres de archivo compatibles con windows, los archivos existentes no podrán ser modificados, pero, podrán ser renombrados a nuevos nombres válidos por su respectivo propietario.",
+ "It is also possible to migrate files automatically after enabling this setting, please refer to the documentation about the occ command." : "También es posible migrar los archivos automáticamente luego de habilitar este ajuste. Por favor, refiérase a la documentación sobre el comando occ.",
"Enforce Windows compatibility" : "Forzar la compatibilidad con Windows",
"This will block filenames not valid on Windows systems, like using reserved names or special characters. But this will not enforce compatibility of case sensitivity." : "Esto bloqueará los nombres de archivos inválidos en sistemas Windows, tales como usar nombres reservados o caracteres especiales. Pero no forzará la compatibilidad del uso de mayúsculas y minúsculas.",
"File Management" : "Gestión de archivos",
@@ -328,6 +332,7 @@ OC.L10N.register(
"Unexpected error: {error}" : "Error inesperado: {error}",
"_%n file_::_%n files_" : ["%n archivo","%n archivos","%n archivos"],
"_%n folder_::_%n folders_" : ["%n carpeta","%n carpetas","%n carpetas"],
+ "_%n hidden_::_%n hidden_" : ["%n oculto","%n ocultos","%n ocultos"],
"Filename must not be empty." : "El nombre de archivo no debe estar vacío.",
"\"{char}\" is not allowed inside a filename." : "\"{char}\" no está permitido en el nombre de archivo.",
"\"{segment}\" is a reserved name and not allowed for filenames." : "\"{segment}\" es un nombre reservado y no se permite para los nombres de archivo.",
diff --git a/apps/files/l10n/es.json b/apps/files/l10n/es.json
index e59a967242e..79fb844a32c 100644
--- a/apps/files/l10n/es.json
+++ b/apps/files/l10n/es.json
@@ -41,6 +41,8 @@
"Files" : "Archivos",
"A file or folder has been <strong>changed</strong>" : "Se ha <strong>modificado</strong> un archivo o carpeta",
"A favorite file or folder has been <strong>changed</strong>" : "Un archivo o carpeta favorito ha sido <strong>cambiado</strong>",
+ "%1$s (renamed)" : "%1$s (renombrado)",
+ "renamed file" : "archivo renombrado",
"Failed to authorize" : "Fallo al autorizar",
"Invalid folder path" : "Ruta de carpeta inválida",
"Folder not found" : "Carpeta no encontrada",
@@ -69,6 +71,8 @@
"Transferred from %1$s on %2$s" : "Se transfirió desde %1$s en %2$s",
"Files compatibility" : "Compatibilidad de archivos",
"Allow to restrict filenames to ensure files can be synced with all clients. By default all filenames valid on POSIX (e.g. Linux or macOS) are allowed." : "Permitir la restricción en nombres de archivo para asegurar que los archivos se puedan sincronizar con todos los clientes. Por defecto, se permiten todos los nombres de archivos válidos en POSIX (por ejemplo, Linux o macOS).",
+ "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Luego de habilitar los nombres de archivo compatibles con windows, los archivos existentes no podrán ser modificados, pero, podrán ser renombrados a nuevos nombres válidos por su respectivo propietario.",
+ "It is also possible to migrate files automatically after enabling this setting, please refer to the documentation about the occ command." : "También es posible migrar los archivos automáticamente luego de habilitar este ajuste. Por favor, refiérase a la documentación sobre el comando occ.",
"Enforce Windows compatibility" : "Forzar la compatibilidad con Windows",
"This will block filenames not valid on Windows systems, like using reserved names or special characters. But this will not enforce compatibility of case sensitivity." : "Esto bloqueará los nombres de archivos inválidos en sistemas Windows, tales como usar nombres reservados o caracteres especiales. Pero no forzará la compatibilidad del uso de mayúsculas y minúsculas.",
"File Management" : "Gestión de archivos",
@@ -326,6 +330,7 @@
"Unexpected error: {error}" : "Error inesperado: {error}",
"_%n file_::_%n files_" : ["%n archivo","%n archivos","%n archivos"],
"_%n folder_::_%n folders_" : ["%n carpeta","%n carpetas","%n carpetas"],
+ "_%n hidden_::_%n hidden_" : ["%n oculto","%n ocultos","%n ocultos"],
"Filename must not be empty." : "El nombre de archivo no debe estar vacío.",
"\"{char}\" is not allowed inside a filename." : "\"{char}\" no está permitido en el nombre de archivo.",
"\"{segment}\" is a reserved name and not allowed for filenames." : "\"{segment}\" es un nombre reservado y no se permite para los nombres de archivo.",
diff --git a/apps/files/l10n/pl.js b/apps/files/l10n/pl.js
index 906004d2172..a06c4433bdc 100644
--- a/apps/files/l10n/pl.js
+++ b/apps/files/l10n/pl.js
@@ -43,6 +43,8 @@ OC.L10N.register(
"Files" : "Pliki",
"A file or folder has been <strong>changed</strong>" : "Plik lub katalog został <strong>zmieniony</strong>",
"A favorite file or folder has been <strong>changed</strong>" : "Ulubiony plik lub katalog został <strong>zmieniony</strong>",
+ "%1$s (renamed)" : "%1$s (zmieniona nazwa)",
+ "renamed file" : "zmieniona nazwa pliku",
"Failed to authorize" : "Błąd autoryzacji",
"Invalid folder path" : "Nieprawidłowa ścieżka katalogu",
"Folder not found" : "Nie znaleziono katalogu",
@@ -71,6 +73,8 @@ OC.L10N.register(
"Transferred from %1$s on %2$s" : "Przeniesiono z %1$s dnia %2$s",
"Files compatibility" : "Zgodność plików",
"Allow to restrict filenames to ensure files can be synced with all clients. By default all filenames valid on POSIX (e.g. Linux or macOS) are allowed." : "Zezwalaj na ograniczenie nazw plików, aby zapewnić synchronizację plików ze wszystkimi klientami. Domyślnie dozwolone są wszystkie nazwy plików obowiązujące w systemie POSIX (np. Linux lub macOS).",
+ "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Po włączeniu nazw plików zgodnych z systemem Windows, istniejących plików nie można już modyfikować, ale ich właściciel może zmienić ich nazwy na nowe, prawidłowe.",
+ "It is also possible to migrate files automatically after enabling this setting, please refer to the documentation about the occ command." : "Możliwe jest również automatyczne migrowanie plików po włączeniu tego ustawienia. Więcej informacji można znaleźć w dokumentacji polecenia occ.",
"Enforce Windows compatibility" : "Wymuszaj zgodność z systemem Windows",
"This will block filenames not valid on Windows systems, like using reserved names or special characters. But this will not enforce compatibility of case sensitivity." : "Spowoduje to zablokowanie nazw plików nieprawidłowych w systemach Windows, na przykład nazw zastrzeżonych lub znaków specjalnych. Nie wymusi to jednak zgodności z rozróżnianiem wielkości liter.",
"File Management" : "Zarządzanie plikami",
@@ -328,6 +332,7 @@ OC.L10N.register(
"Unexpected error: {error}" : "Nieoczekiwany błąd: {error}",
"_%n file_::_%n files_" : ["%n plik","%n pliki","%n plików","%n plików"],
"_%n folder_::_%n folders_" : ["%n katalog","%n katalogi","%n katalogów","%n katalogów"],
+ "_%n hidden_::_%n hidden_" : ["%n ukryty","%n ukryte","%n ukrytych","%n ukrytych"],
"Filename must not be empty." : "Nazwa pliku nie może być pusta.",
"\"{char}\" is not allowed inside a filename." : "„{char}” nie jest dozwolone w nazwie pliku.",
"\"{segment}\" is a reserved name and not allowed for filenames." : "„{segment}” jest nazwą zastrzeżoną i nie jest dozwolona w przypadku nazw plików.",
diff --git a/apps/files/l10n/pl.json b/apps/files/l10n/pl.json
index b312784d273..2705ef5eea4 100644
--- a/apps/files/l10n/pl.json
+++ b/apps/files/l10n/pl.json
@@ -41,6 +41,8 @@
"Files" : "Pliki",
"A file or folder has been <strong>changed</strong>" : "Plik lub katalog został <strong>zmieniony</strong>",
"A favorite file or folder has been <strong>changed</strong>" : "Ulubiony plik lub katalog został <strong>zmieniony</strong>",
+ "%1$s (renamed)" : "%1$s (zmieniona nazwa)",
+ "renamed file" : "zmieniona nazwa pliku",
"Failed to authorize" : "Błąd autoryzacji",
"Invalid folder path" : "Nieprawidłowa ścieżka katalogu",
"Folder not found" : "Nie znaleziono katalogu",
@@ -69,6 +71,8 @@
"Transferred from %1$s on %2$s" : "Przeniesiono z %1$s dnia %2$s",
"Files compatibility" : "Zgodność plików",
"Allow to restrict filenames to ensure files can be synced with all clients. By default all filenames valid on POSIX (e.g. Linux or macOS) are allowed." : "Zezwalaj na ograniczenie nazw plików, aby zapewnić synchronizację plików ze wszystkimi klientami. Domyślnie dozwolone są wszystkie nazwy plików obowiązujące w systemie POSIX (np. Linux lub macOS).",
+ "After enabling the windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Po włączeniu nazw plików zgodnych z systemem Windows, istniejących plików nie można już modyfikować, ale ich właściciel może zmienić ich nazwy na nowe, prawidłowe.",
+ "It is also possible to migrate files automatically after enabling this setting, please refer to the documentation about the occ command." : "Możliwe jest również automatyczne migrowanie plików po włączeniu tego ustawienia. Więcej informacji można znaleźć w dokumentacji polecenia occ.",
"Enforce Windows compatibility" : "Wymuszaj zgodność z systemem Windows",
"This will block filenames not valid on Windows systems, like using reserved names or special characters. But this will not enforce compatibility of case sensitivity." : "Spowoduje to zablokowanie nazw plików nieprawidłowych w systemach Windows, na przykład nazw zastrzeżonych lub znaków specjalnych. Nie wymusi to jednak zgodności z rozróżnianiem wielkości liter.",
"File Management" : "Zarządzanie plikami",
@@ -326,6 +330,7 @@
"Unexpected error: {error}" : "Nieoczekiwany błąd: {error}",
"_%n file_::_%n files_" : ["%n plik","%n pliki","%n plików","%n plików"],
"_%n folder_::_%n folders_" : ["%n katalog","%n katalogi","%n katalogów","%n katalogów"],
+ "_%n hidden_::_%n hidden_" : ["%n ukryty","%n ukryte","%n ukrytych","%n ukrytych"],
"Filename must not be empty." : "Nazwa pliku nie może być pusta.",
"\"{char}\" is not allowed inside a filename." : "„{char}” nie jest dozwolone w nazwie pliku.",
"\"{segment}\" is a reserved name and not allowed for filenames." : "„{segment}” jest nazwą zastrzeżoną i nie jest dozwolona w przypadku nazw plików.",
diff --git a/apps/files_sharing/l10n/es.js b/apps/files_sharing/l10n/es.js
index d34bc63699b..247c0a7f6c7 100644
--- a/apps/files_sharing/l10n/es.js
+++ b/apps/files_sharing/l10n/es.js
@@ -313,6 +313,7 @@ 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." : "Utiliza este método para compartir archivos con individuos o equipos dentro de tu organización. Si el destinatario ya tiene acceso pero no puede encontrarlos, puedes enviarle este enlace interno para facilitarle el acceso.",
"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." : "Usa este método para compartir archivos con individuos u organizaciones externas a tu organización. Los archivos y carpetas pueden ser compartidos mediante enlaces públicos y por correo. También puedes compartir con otras cuentas de Nextcloud alojadas en otras instancias utilizando su ID de nube federada.",
"Shares that are not part of the internal or external shares. This can be shares from apps or other sources." : "Recursos compartidos que no son internos o externos. Pueden estar compartidos desde aplicaciones u otras fuentes.",
+ "Share with accounts, teams, federated cloud id" : "Comparta con cuentas, equipos, id de nube federada",
"Share with accounts and teams" : "Compartir con cuentas y equipos",
"Email, federated cloud id" : "Email, ID de nube federada",
"Unable to load the shares list" : "No se pudo cargar la lista de recursos compartidos",
diff --git a/apps/files_sharing/l10n/es.json b/apps/files_sharing/l10n/es.json
index 229e84daeac..1b8048a731f 100644
--- a/apps/files_sharing/l10n/es.json
+++ b/apps/files_sharing/l10n/es.json
@@ -311,6 +311,7 @@
"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." : "Utiliza este método para compartir archivos con individuos o equipos dentro de tu organización. Si el destinatario ya tiene acceso pero no puede encontrarlos, puedes enviarle este enlace interno para facilitarle el acceso.",
"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." : "Usa este método para compartir archivos con individuos u organizaciones externas a tu organización. Los archivos y carpetas pueden ser compartidos mediante enlaces públicos y por correo. También puedes compartir con otras cuentas de Nextcloud alojadas en otras instancias utilizando su ID de nube federada.",
"Shares that are not part of the internal or external shares. This can be shares from apps or other sources." : "Recursos compartidos que no son internos o externos. Pueden estar compartidos desde aplicaciones u otras fuentes.",
+ "Share with accounts, teams, federated cloud id" : "Comparta con cuentas, equipos, id de nube federada",
"Share with accounts and teams" : "Compartir con cuentas y equipos",
"Email, federated cloud id" : "Email, ID de nube federada",
"Unable to load the shares list" : "No se pudo cargar la lista de recursos compartidos",
diff --git a/apps/files_sharing/l10n/pl.js b/apps/files_sharing/l10n/pl.js
index 06ac0506c6a..c2eb0447c35 100644
--- a/apps/files_sharing/l10n/pl.js
+++ b/apps/files_sharing/l10n/pl.js
@@ -313,8 +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." : "Użyj tej metody, aby udostępniać pliki osobom lub zespołom w swojej organizacji. Jeśli odbiorca ma już dostęp do udostępnionego pliku, ale nie może go zlokalizować, możesz wysłać mu wewnętrzny link do udostępniania, aby ułatwić dostęp.",
"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." : "Użyj tej metody, aby udostępniać pliki osobom lub organizacjom spoza Twojej organizacji. Pliki i katalogi można udostępniać za pośrednictwem publicznych linków udostępniania i adresów e-mail. Możesz również udostępniać pliki innym kontom Nextcloud hostowanym na różnych instancjach, używając ich identyfikatora Chmury Federacyjnej.",
"Shares that are not part of the internal or external shares. This can be shares from apps or other sources." : "Udostępnienia, które nie są częścią udostępnień wewnętrznych lub zewnętrznych. Mogą to być udostępnienia z aplikacji lub innych źródeł.",
+ "Share with accounts, teams, federated cloud id" : "Udostępnij kontom, zespołom, ID Chmury Federacyjnej",
"Share with accounts and teams" : "Udostępnij kontom i zespołom",
- "Email, federated cloud id" : "E-mail, identyfikator Chmury Federacyjnej",
+ "Email, federated cloud id" : "E-mail, ID Chmury Federacyjnej",
"Unable to load the shares list" : "Nie można pobrać listy udostępnień",
"Expires {relativetime}" : "Wygasa {relativetime}",
"this share just expired." : "te udostępnienie właśnie wygasło.",
diff --git a/apps/files_sharing/l10n/pl.json b/apps/files_sharing/l10n/pl.json
index 776f18bbf69..2d307482f9f 100644
--- a/apps/files_sharing/l10n/pl.json
+++ b/apps/files_sharing/l10n/pl.json
@@ -311,8 +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." : "Użyj tej metody, aby udostępniać pliki osobom lub zespołom w swojej organizacji. Jeśli odbiorca ma już dostęp do udostępnionego pliku, ale nie może go zlokalizować, możesz wysłać mu wewnętrzny link do udostępniania, aby ułatwić dostęp.",
"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." : "Użyj tej metody, aby udostępniać pliki osobom lub organizacjom spoza Twojej organizacji. Pliki i katalogi można udostępniać za pośrednictwem publicznych linków udostępniania i adresów e-mail. Możesz również udostępniać pliki innym kontom Nextcloud hostowanym na różnych instancjach, używając ich identyfikatora Chmury Federacyjnej.",
"Shares that are not part of the internal or external shares. This can be shares from apps or other sources." : "Udostępnienia, które nie są częścią udostępnień wewnętrznych lub zewnętrznych. Mogą to być udostępnienia z aplikacji lub innych źródeł.",
+ "Share with accounts, teams, federated cloud id" : "Udostępnij kontom, zespołom, ID Chmury Federacyjnej",
"Share with accounts and teams" : "Udostępnij kontom i zespołom",
- "Email, federated cloud id" : "E-mail, identyfikator Chmury Federacyjnej",
+ "Email, federated cloud id" : "E-mail, ID Chmury Federacyjnej",
"Unable to load the shares list" : "Nie można pobrać listy udostępnień",
"Expires {relativetime}" : "Wygasa {relativetime}",
"this share just expired." : "te udostępnienie właśnie wygasło.",
diff --git a/apps/settings/l10n/et_EE.js b/apps/settings/l10n/et_EE.js
index a2dce7d235e..1cb92f65345 100644
--- a/apps/settings/l10n/et_EE.js
+++ b/apps/settings/l10n/et_EE.js
@@ -175,6 +175,7 @@ OC.L10N.register(
"Task:" : "Ülesanded:",
"Enable" : "Lülita sisse",
"Machine translation" : "Masintõlge",
+ "Image generation" : "Pildiloome",
"None" : "Pole",
"Allow apps to use the Share API" : "Luba rakendustel kasutada Share API-t",
"Allow resharing" : "Luba edasijagamine",
diff --git a/apps/settings/l10n/et_EE.json b/apps/settings/l10n/et_EE.json
index 72c5450d2cf..0b1e47bae19 100644
--- a/apps/settings/l10n/et_EE.json
+++ b/apps/settings/l10n/et_EE.json
@@ -173,6 +173,7 @@
"Task:" : "Ülesanded:",
"Enable" : "Lülita sisse",
"Machine translation" : "Masintõlge",
+ "Image generation" : "Pildiloome",
"None" : "Pole",
"Allow apps to use the Share API" : "Luba rakendustel kasutada Share API-t",
"Allow resharing" : "Luba edasijagamine",
diff --git a/apps/settings/l10n/lv.js b/apps/settings/l10n/lv.js
index 97e8714b076..6c42b12b9fb 100644
--- a/apps/settings/l10n/lv.js
+++ b/apps/settings/l10n/lv.js
@@ -99,7 +99,7 @@ OC.L10N.register(
"Developer documentation" : "Izstrādātāja dokumentācija",
"Details" : "Detaļas",
"All" : "Visi",
- "No results" : "Nav rezultātu",
+ "No results" : "Nav iznākuma",
"Update to {version}" : "Atjaunināt uz {version}",
"Latest updated" : "Pēdējoreiz atjaunināta",
"Categories" : "Kategorijas",
@@ -174,6 +174,7 @@ OC.L10N.register(
"Storage location" : "Krātuves atrašanās vieta",
"Last login" : "Pēdējā pieteikšanās",
"Account actions" : "Konta darbības",
+ "{size} used" : "Izmantoti {size}",
"Delete account" : "Izdzēst kontu",
"In case of lost device or exiting the organization, this can remotely wipe the Nextcloud data from all devices associated with {userid}. Only works if the devices are connected to the internet." : "Pazaudētas ierīces vai apvienības pamešanas gadījumā šis var attālināti notīrīt Nextcloud datus visās ar {userid} saistītajās ierīcēs. Darbojas tikai tad, ja ierīces ir savienotas ar internetu.",
"Add account to group" : "Pievienot kontu kopai",
diff --git a/apps/settings/l10n/lv.json b/apps/settings/l10n/lv.json
index 316388bfc1e..a51271f4842 100644
--- a/apps/settings/l10n/lv.json
+++ b/apps/settings/l10n/lv.json
@@ -97,7 +97,7 @@
"Developer documentation" : "Izstrādātāja dokumentācija",
"Details" : "Detaļas",
"All" : "Visi",
- "No results" : "Nav rezultātu",
+ "No results" : "Nav iznākuma",
"Update to {version}" : "Atjaunināt uz {version}",
"Latest updated" : "Pēdējoreiz atjaunināta",
"Categories" : "Kategorijas",
@@ -172,6 +172,7 @@
"Storage location" : "Krātuves atrašanās vieta",
"Last login" : "Pēdējā pieteikšanās",
"Account actions" : "Konta darbības",
+ "{size} used" : "Izmantoti {size}",
"Delete account" : "Izdzēst kontu",
"In case of lost device or exiting the organization, this can remotely wipe the Nextcloud data from all devices associated with {userid}. Only works if the devices are connected to the internet." : "Pazaudētas ierīces vai apvienības pamešanas gadījumā šis var attālināti notīrīt Nextcloud datus visās ar {userid} saistītajās ierīcēs. Darbojas tikai tad, ja ierīces ir savienotas ar internetu.",
"Add account to group" : "Pievienot kontu kopai",
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index e6e1cf509e9..194a402848e 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -1112,6 +1112,17 @@ class ShareByMailProvider extends DefaultShareProvider implements IShareProvider
}
public function getSharesInFolder($userId, Folder $node, $reshares, $shallow = true): array {
+ return $this->getSharesInFolderInternal($userId, $node, $reshares);
+ }
+
+ public function getAllSharesInFolder(Folder $node): array {
+ return $this->getSharesInFolderInternal(null, $node, null);
+ }
+
+ /**
+ * @return array<int, list<IShare>>
+ */
+ private function getSharesInFolderInternal(?string $userId, Folder $node, ?bool $reshares): array {
$qb = $this->dbConnection->getQueryBuilder();
$qb->select('*')
->from('share', 's')
@@ -1120,18 +1131,20 @@ class ShareByMailProvider extends DefaultShareProvider implements IShareProvider
$qb->expr()->eq('share_type', $qb->createNamedParameter(IShare::TYPE_EMAIL))
);
- /**
- * Reshares for this user are shares where they are the owner.
- */
- if ($reshares === false) {
- $qb->andWhere($qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId)));
- } else {
- $qb->andWhere(
- $qb->expr()->orX(
- $qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
- $qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId))
- )
- );
+ if ($userId !== null) {
+ /**
+ * Reshares for this user are shares where they are the owner.
+ */
+ if ($reshares !== true) {
+ $qb->andWhere($qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId)));
+ } else {
+ $qb->andWhere(
+ $qb->expr()->orX(
+ $qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
+ $qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId))
+ )
+ );
+ }
}
$qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
diff --git a/core/l10n/es.js b/core/l10n/es.js
index 70beab656e2..ceab866b506 100644
--- a/core/l10n/es.js
+++ b/core/l10n/es.js
@@ -27,6 +27,7 @@ OC.L10N.register(
"Could not complete login" : "No se ha podido completar el inicio de sesión",
"State token missing" : "No se encontró token de estado",
"Your login token is invalid or has expired" : "Tu token de login no es válido o ha caducado",
+ "Please use original client" : "Por favor, use el cliente original",
"This community release of Nextcloud is unsupported and push notifications are limited." : "Esta versión comunitaria de Nextcloud ya no está soportada y las notificaciones push están limitadas.",
"Login" : "Iniciar sesión",
"Unsupported email length (>255)" : "Longitud de correo electrónico no soportada (>255)",
diff --git a/core/l10n/es.json b/core/l10n/es.json
index 7c69660a775..9a2b70b04ab 100644
--- a/core/l10n/es.json
+++ b/core/l10n/es.json
@@ -25,6 +25,7 @@
"Could not complete login" : "No se ha podido completar el inicio de sesión",
"State token missing" : "No se encontró token de estado",
"Your login token is invalid or has expired" : "Tu token de login no es válido o ha caducado",
+ "Please use original client" : "Por favor, use el cliente original",
"This community release of Nextcloud is unsupported and push notifications are limited." : "Esta versión comunitaria de Nextcloud ya no está soportada y las notificaciones push están limitadas.",
"Login" : "Iniciar sesión",
"Unsupported email length (>255)" : "Longitud de correo electrónico no soportada (>255)",
diff --git a/core/l10n/pl.js b/core/l10n/pl.js
index c87275d5182..b3cf525671b 100644
--- a/core/l10n/pl.js
+++ b/core/l10n/pl.js
@@ -27,6 +27,7 @@ OC.L10N.register(
"Could not complete login" : "Nie można dokończyć logowania",
"State token missing" : "Brak statusu tokena",
"Your login token is invalid or has expired" : "Token logowania jest nieprawidłowy lub wygasł",
+ "Please use original client" : "Użyj oryginalnego klienta",
"This community release of Nextcloud is unsupported and push notifications are limited." : "To wydanie społecznościowe Nextcloud nie jest obsługiwane, a powiadomienia Push są ograniczone.",
"Login" : "Zaloguj",
"Unsupported email length (>255)" : "Nieobsługiwana długość wiadomości e-mail (>255)",
diff --git a/core/l10n/pl.json b/core/l10n/pl.json
index 86c30aa0655..7c5a25a4a4a 100644
--- a/core/l10n/pl.json
+++ b/core/l10n/pl.json
@@ -25,6 +25,7 @@
"Could not complete login" : "Nie można dokończyć logowania",
"State token missing" : "Brak statusu tokena",
"Your login token is invalid or has expired" : "Token logowania jest nieprawidłowy lub wygasł",
+ "Please use original client" : "Użyj oryginalnego klienta",
"This community release of Nextcloud is unsupported and push notifications are limited." : "To wydanie społecznościowe Nextcloud nie jest obsługiwane, a powiadomienia Push są ograniczone.",
"Login" : "Zaloguj",
"Unsupported email length (>255)" : "Nieobsługiwana długość wiadomości e-mail (>255)",
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index 177abfefe8e..b1c6c453b0a 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -780,6 +780,7 @@ return array(
'OCP\\Share\\IShareHelper' => $baseDir . '/lib/public/Share/IShareHelper.php',
'OCP\\Share\\IShareProvider' => $baseDir . '/lib/public/Share/IShareProvider.php',
'OCP\\Share\\IShareProviderSupportsAccept' => $baseDir . '/lib/public/Share/IShareProviderSupportsAccept.php',
+ 'OCP\\Share\\IShareProviderSupportsAllSharesInFolder' => $baseDir . '/lib/public/Share/IShareProviderSupportsAllSharesInFolder.php',
'OCP\\Share\\IShareProviderWithNotification' => $baseDir . '/lib/public/Share/IShareProviderWithNotification.php',
'OCP\\Share_Backend' => $baseDir . '/lib/public/Share_Backend.php',
'OCP\\Share_Backend_Collection' => $baseDir . '/lib/public/Share_Backend_Collection.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index ddccd0692ca..6eecb2da4b5 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -821,6 +821,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
'OCP\\Share\\IShareHelper' => __DIR__ . '/../../..' . '/lib/public/Share/IShareHelper.php',
'OCP\\Share\\IShareProvider' => __DIR__ . '/../../..' . '/lib/public/Share/IShareProvider.php',
'OCP\\Share\\IShareProviderSupportsAccept' => __DIR__ . '/../../..' . '/lib/public/Share/IShareProviderSupportsAccept.php',
+ 'OCP\\Share\\IShareProviderSupportsAllSharesInFolder' => __DIR__ . '/../../..' . '/lib/public/Share/IShareProviderSupportsAllSharesInFolder.php',
'OCP\\Share\\IShareProviderWithNotification' => __DIR__ . '/../../..' . '/lib/public/Share/IShareProviderWithNotification.php',
'OCP\\Share_Backend' => __DIR__ . '/../../..' . '/lib/public/Share_Backend.php',
'OCP\\Share_Backend_Collection' => __DIR__ . '/../../..' . '/lib/public/Share_Backend_Collection.php',
diff --git a/lib/l10n/es.js b/lib/l10n/es.js
index 94e52dbc724..a3cf61509ec 100644
--- a/lib/l10n/es.js
+++ b/lib/l10n/es.js
@@ -364,6 +364,11 @@ OC.L10N.register(
"How many images to generate" : "Cuántas imágenes se generarán",
"Output images" : "Imágenes de salida",
"The generated images" : "Las imágenes generadas",
+ "Generate speech" : "Generar dictado",
+ "Generate speech from a transcript" : "Generar dictado desde una transcripción",
+ "Write transcript that you want the assistant to generate speech from" : "Escriba la transcripción desde la que desea que el asistente genere un dictado",
+ "Output speech" : "Dictado de salida",
+ "The generated speech" : "El dictado generado",
"Free text to text prompt" : "Texto libre a prompt de texto",
"Runs an arbitrary prompt through a language model that returns a reply" : "Ejecuta un prompt arbitrario a través de un modelo de lenguaje que retorna una respuesta",
"Describe a task that you want the assistant to do or ask a question" : "Describa una tarea que quiere que el asistente realice, o, haga una pregunta",
diff --git a/lib/l10n/es.json b/lib/l10n/es.json
index 61f519db2a7..34d4db2eec4 100644
--- a/lib/l10n/es.json
+++ b/lib/l10n/es.json
@@ -362,6 +362,11 @@
"How many images to generate" : "Cuántas imágenes se generarán",
"Output images" : "Imágenes de salida",
"The generated images" : "Las imágenes generadas",
+ "Generate speech" : "Generar dictado",
+ "Generate speech from a transcript" : "Generar dictado desde una transcripción",
+ "Write transcript that you want the assistant to generate speech from" : "Escriba la transcripción desde la que desea que el asistente genere un dictado",
+ "Output speech" : "Dictado de salida",
+ "The generated speech" : "El dictado generado",
"Free text to text prompt" : "Texto libre a prompt de texto",
"Runs an arbitrary prompt through a language model that returns a reply" : "Ejecuta un prompt arbitrario a través de un modelo de lenguaje que retorna una respuesta",
"Describe a task that you want the assistant to do or ask a question" : "Describa una tarea que quiere que el asistente realice, o, haga una pregunta",
diff --git a/lib/l10n/et_EE.js b/lib/l10n/et_EE.js
index d0ff1a1e511..e14744dc6ee 100644
--- a/lib/l10n/et_EE.js
+++ b/lib/l10n/et_EE.js
@@ -293,6 +293,10 @@ OC.L10N.register(
"The audio to transcribe" : "Üleskirjutatav helifail",
"Transcription" : "Üleskirjutus",
"The transcribed text" : "Üleskirjutatud tekst",
+ "Context write" : "Kontekstuaalne kirjutamine",
+ "Writes text in a given style based on the provided source material." : "Kirjutab etteantud lähtematerjali lausel teksti üles.",
+ "Writing style" : "Kirjutamisstiil",
+ "Source material" : "Lähtematerjal",
"Generate image" : "Piltide loomine",
"Generate an image from a text prompt" : "Loo tekstisisendist pilt",
"Prompt" : "Sisendvorm",
diff --git a/lib/l10n/et_EE.json b/lib/l10n/et_EE.json
index f42e00f28f1..f6c46ab05cb 100644
--- a/lib/l10n/et_EE.json
+++ b/lib/l10n/et_EE.json
@@ -291,6 +291,10 @@
"The audio to transcribe" : "Üleskirjutatav helifail",
"Transcription" : "Üleskirjutus",
"The transcribed text" : "Üleskirjutatud tekst",
+ "Context write" : "Kontekstuaalne kirjutamine",
+ "Writes text in a given style based on the provided source material." : "Kirjutab etteantud lähtematerjali lausel teksti üles.",
+ "Writing style" : "Kirjutamisstiil",
+ "Source material" : "Lähtematerjal",
"Generate image" : "Piltide loomine",
"Generate an image from a text prompt" : "Loo tekstisisendist pilt",
"Prompt" : "Sisendvorm",
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php
index a257bc4f7b5..e1eebe1e450 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -5,6 +5,7 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/
+
namespace OC\Share20;
use OC\Files\Cache\Cache;
@@ -31,6 +32,7 @@ use OCP\Share\IAttributes;
use OCP\Share\IManager;
use OCP\Share\IShare;
use OCP\Share\IShareProviderSupportsAccept;
+use OCP\Share\IShareProviderSupportsAllSharesInFolder;
use OCP\Share\IShareProviderWithNotification;
use Psr\Log\LoggerInterface;
use function str_starts_with;
@@ -40,7 +42,7 @@ use function str_starts_with;
*
* @package OC\Share20
*/
-class DefaultShareProvider implements IShareProviderWithNotification, IShareProviderSupportsAccept {
+class DefaultShareProvider implements IShareProviderWithNotification, IShareProviderSupportsAccept, IShareProviderSupportsAllSharesInFolder {
// Special share type for user modified group shares
public const SHARE_TYPE_USERGROUP = 2;
@@ -603,6 +605,17 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
throw new \Exception('non-shallow getSharesInFolder is no longer supported');
}
+ return $this->getSharesInFolderInternal($userId, $node, $reshares);
+ }
+
+ public function getAllSharesInFolder(Folder $node): array {
+ return $this->getSharesInFolderInternal(null, $node, null);
+ }
+
+ /**
+ * @return array<int, list<IShare>>
+ */
+ private function getSharesInFolderInternal(?string $userId, Folder $node, ?bool $reshares): array {
$qb = $this->dbConn->getQueryBuilder();
$qb->select('s.*',
'f.fileid', 'f.path', 'f.permissions AS f_permissions', 'f.storage', 'f.path_hash',
@@ -613,18 +626,20 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->andWhere($qb->expr()->in('share_type', $qb->createNamedParameter([IShare::TYPE_USER, IShare::TYPE_GROUP, IShare::TYPE_LINK], IQueryBuilder::PARAM_INT_ARRAY)));
- /**
- * Reshares for this user are shares where they are the owner.
- */
- if ($reshares === false) {
- $qb->andWhere($qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId)));
- } else {
- $qb->andWhere(
- $qb->expr()->orX(
- $qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
- $qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId))
- )
- );
+ if ($userId !== null) {
+ /**
+ * Reshares for this user are shares where they are the owner.
+ */
+ if ($reshares !== true) {
+ $qb->andWhere($qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId)));
+ } else {
+ $qb->andWhere(
+ $qb->expr()->orX(
+ $qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)),
+ $qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId))
+ )
+ );
+ }
}
// todo? maybe get these from the oc_mounts table
@@ -656,7 +671,6 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
foreach ($chunks as $chunk) {
$qb->setParameter('chunk', $chunk, IQueryBuilder::PARAM_INT_ARRAY);
- $a = $qb->getSQL();
$cursor = $qb->executeQuery();
while ($data = $cursor->fetch()) {
$shares[$data['fileid']][] = $this->createShare($data);
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 3b247475afa..2104c07593a 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -51,6 +51,7 @@ use OCP\Share\IProviderFactory;
use OCP\Share\IShare;
use OCP\Share\IShareProvider;
use OCP\Share\IShareProviderSupportsAccept;
+use OCP\Share\IShareProviderSupportsAllSharesInFolder;
use OCP\Share\IShareProviderWithNotification;
use Psr\Log\LoggerInterface;
@@ -1213,11 +1214,13 @@ class Manager implements IManager {
$shares = [];
foreach ($providers as $provider) {
if ($isOwnerless) {
- foreach ($node->getDirectoryListing() as $childNode) {
- $data = $provider->getSharesByPath($childNode);
- $fid = $childNode->getId();
- $shares[$fid] ??= [];
- $shares[$fid] = array_merge($shares[$fid], $data);
+ // If the provider does not implement the additional interface,
+ // we lack a performant way of querying all shares and therefore ignore the provider.
+ if ($provider instanceof IShareProviderSupportsAllSharesInFolder) {
+ foreach ($provider->getAllSharesInFolder($node) as $fid => $data) {
+ $shares[$fid] ??= [];
+ $shares[$fid] = array_merge($shares[$fid], $data);
+ }
}
} else {
foreach ($provider->getSharesInFolder($userId, $node, $reshares) as $fid => $data) {
diff --git a/lib/public/Share/IShareProviderSupportsAllSharesInFolder.php b/lib/public/Share/IShareProviderSupportsAllSharesInFolder.php
new file mode 100644
index 00000000000..e27da7682ce
--- /dev/null
+++ b/lib/public/Share/IShareProviderSupportsAllSharesInFolder.php
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\Share;
+
+use OCP\Files\Folder;
+
+/**
+ * Allows defining a IShareProvider with support for the getAllSharesInFolder method.
+ *
+ * @since 32.0.0
+ */
+interface IShareProviderSupportsAllSharesInFolder extends IShareProvider {
+ /**
+ * Get all shares in a folder.
+ *
+ * @return array<int, list<IShare>>
+ * @since 32.0.0
+ */
+ public function getAllSharesInFolder(Folder $node): array;
+}
diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php
index 9e778207a8e..357ae9ee678 100644
--- a/tests/lib/Share20/ManagerTest.php
+++ b/tests/lib/Share20/ManagerTest.php
@@ -55,6 +55,7 @@ use OCP\Share\IManager;
use OCP\Share\IProviderFactory;
use OCP\Share\IShare;
use OCP\Share\IShareProvider;
+use OCP\Share\IShareProviderSupportsAllSharesInFolder;
use PHPUnit\Framework\MockObject\MockBuilder;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
@@ -4551,7 +4552,7 @@ class ManagerTest extends \Test\TestCase {
$manager = $this->createManager($factory);
$factory->setProvider($this->defaultProvider);
- $extraProvider = $this->createMock(IShareProvider::class);
+ $extraProvider = $this->createMock(IShareProviderSupportsAllSharesInFolder::class);
$factory->setSecondProvider($extraProvider);
$share1 = $this->createMock(IShare::class);
@@ -4559,28 +4560,20 @@ class ManagerTest extends \Test\TestCase {
$mount = $this->createMock(IShareOwnerlessMount::class);
- $file = $this->createMock(File::class);
- $file
- ->method('getId')
- ->willReturn(1);
-
$folder = $this->createMock(Folder::class);
$folder
->method('getMountPoint')
->willReturn($mount);
- $folder
- ->method('getDirectoryListing')
- ->willReturn([$file]);
$this->defaultProvider
- ->method('getSharesByPath')
- ->with($file)
- ->willReturn([$share1]);
+ ->method('getAllSharesInFolder')
+ ->with($folder)
+ ->willReturn([1 => [$share1]]);
$extraProvider
- ->method('getSharesByPath')
- ->with($file)
- ->willReturn([$share2]);
+ ->method('getAllSharesInFolder')
+ ->with($folder)
+ ->willReturn([1 => [$share2]]);
$this->assertSame([
1 => [$share1, $share2],