diff options
Diffstat (limited to 'apps/files_sharing')
24 files changed, 76 insertions, 69 deletions
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js index 71192497143..3a6de0d5012 100644 --- a/apps/files_sharing/js/sharedfilelist.js +++ b/apps/files_sharing/js/sharedfilelist.js @@ -166,24 +166,8 @@ }, updateRow: function($tr, fileInfo, options) { - if(!fileInfo instanceof OCA.Sharing.SharedFileInfo) { - // recycle SharedFileInfo values if something tries to overwrite it - var oldModel = this.getModelForFile($tr); - - if(_.isUndefined(fileInfo.recipientData) && oldModel.recipientData) { - fileInfo.recipientData = oldModel.recipientData; - } - if(_.isUndefined(fileInfo.recipients) && oldModel.recipientData) { - fileInfo.recipientData = oldModel.recipientData; - } - if(_.isUndefined(fileInfo.shares) && oldModel.shares) { - fileInfo.shares = oldModel.shares; - } - if(_.isUndefined(fileInfo.shareOwner) && oldModel.shareOwner) { - fileInfo.shareOwner = oldModel.shareOwner; - } - } - OCA.Files.FileList.prototype._createRow.updateRow(this, arguments); + // no-op, suppress re-rendering + return $tr; }, reload: function() { @@ -328,11 +312,11 @@ * Converts the OCS API share response data to a file info * list * @param {Array} data OCS API share array + * @param {bool} sharedWithUser * @return {Array.<OCA.Sharing.SharedFileInfo>} array of shared file info */ _makeFilesFromShares: function(data, sharedWithUser) { /* jshint camelcase: false */ - var self = this; var files = data; if (this._linksOnly) { @@ -447,8 +431,8 @@ // array of sorted names data.mountType = 'shared'; delete data.recipientsCount; - if (self._sharedWithUser) { - // only for outgoing shres + if (sharedWithUser) { + // only for outgoing shares delete data.shareTypes; } else { data.shareTypes = _.keys(data.shareTypes); diff --git a/apps/files_sharing/l10n/cs.js b/apps/files_sharing/l10n/cs.js index 538f6b03849..b7def6d396e 100644 --- a/apps/files_sharing/l10n/cs.js +++ b/apps/files_sharing/l10n/cs.js @@ -18,7 +18,9 @@ OC.L10N.register( "Shares will show up here" : "Sdílení se zobrazí zde", "Restore share" : "Obnovit sdílení", "Something happened. Unable to restore the share." : "Něco se stalo. Sdílení se nedaří obnovit.", + "Move or copy" : "Přesunout nebo zkopírovat", "Download" : "Stáhnout", + "Delete" : "Smazat", "You can upload into this folder" : "Do této složky můžete nahrávat", "No compatible server found at {remote}" : "Na {remote} nebyl nalezen kompatibilní server", "Invalid server URL" : "Neplatná URL serveru", diff --git a/apps/files_sharing/l10n/cs.json b/apps/files_sharing/l10n/cs.json index ba71287dbc6..e7c3acc1d99 100644 --- a/apps/files_sharing/l10n/cs.json +++ b/apps/files_sharing/l10n/cs.json @@ -16,7 +16,9 @@ "Shares will show up here" : "Sdílení se zobrazí zde", "Restore share" : "Obnovit sdílení", "Something happened. Unable to restore the share." : "Něco se stalo. Sdílení se nedaří obnovit.", + "Move or copy" : "Přesunout nebo zkopírovat", "Download" : "Stáhnout", + "Delete" : "Smazat", "You can upload into this folder" : "Do této složky můžete nahrávat", "No compatible server found at {remote}" : "Na {remote} nebyl nalezen kompatibilní server", "Invalid server URL" : "Neplatná URL serveru", diff --git a/apps/files_sharing/l10n/en_GB.js b/apps/files_sharing/l10n/en_GB.js index 6f4da3b80cb..708b6d30029 100644 --- a/apps/files_sharing/l10n/en_GB.js +++ b/apps/files_sharing/l10n/en_GB.js @@ -92,7 +92,6 @@ OC.L10N.register( "Add to your Nextcloud" : "Add to your Nextcloud", "Share API is disabled" : "Share API is disabled", "File sharing" : "File sharing", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation.", "No entries found in this folder" : "No entries found in this folder", "Name" : "Name", "Share time" : "Share time", diff --git a/apps/files_sharing/l10n/en_GB.json b/apps/files_sharing/l10n/en_GB.json index c4e902a27e5..14c51e7f17f 100644 --- a/apps/files_sharing/l10n/en_GB.json +++ b/apps/files_sharing/l10n/en_GB.json @@ -90,7 +90,6 @@ "Add to your Nextcloud" : "Add to your Nextcloud", "Share API is disabled" : "Share API is disabled", "File sharing" : "File sharing", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation.", "No entries found in this folder" : "No entries found in this folder", "Name" : "Name", "Share time" : "Share time", diff --git a/apps/files_sharing/l10n/es.js b/apps/files_sharing/l10n/es.js index 317926f3a98..f409029db2f 100644 --- a/apps/files_sharing/l10n/es.js +++ b/apps/files_sharing/l10n/es.js @@ -106,7 +106,6 @@ OC.L10N.register( "Add to your Nextcloud" : "Añadir a tu Nextcloud", "Share API is disabled" : "El API de compartir está deshabilitado", "File sharing" : "Compartir archivos", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Esta aplicación permite a los usuarios compartir archivos dentro de Nextcloud. Si se activa, el administrador puede elegir qué grupos pueden compartir archivos. Los usuarios aplicables pueden entonces compartir archivos y carpetas con otros usuarios y grupos dentro de Nextcloud. Además, si el administrador activa la característica de enlace compartido, se puede usar un enlace externo para compartir archivos con otros usuarios fuera de Nextcloud. Los administradores pueden obligar a usar contraseñas o fechas de expiración y activar el compartir de servidor a servidor vía enlaces compartidos, así como compartir desde dispositivos móviles.\nApagar esta característica elimina los archivos compartidos y las carpetas en el servidor, para todos los receptores, y también los clientes de sincronización y móviles. Más información disponible en la documentación de Nextcloud.", "No entries found in this folder" : "No hay nada en esta carpeta", "Name" : "Nombre", "Share time" : "Compartido hace", diff --git a/apps/files_sharing/l10n/es.json b/apps/files_sharing/l10n/es.json index 89e95570438..cc90f6a2437 100644 --- a/apps/files_sharing/l10n/es.json +++ b/apps/files_sharing/l10n/es.json @@ -104,7 +104,6 @@ "Add to your Nextcloud" : "Añadir a tu Nextcloud", "Share API is disabled" : "El API de compartir está deshabilitado", "File sharing" : "Compartir archivos", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Esta aplicación permite a los usuarios compartir archivos dentro de Nextcloud. Si se activa, el administrador puede elegir qué grupos pueden compartir archivos. Los usuarios aplicables pueden entonces compartir archivos y carpetas con otros usuarios y grupos dentro de Nextcloud. Además, si el administrador activa la característica de enlace compartido, se puede usar un enlace externo para compartir archivos con otros usuarios fuera de Nextcloud. Los administradores pueden obligar a usar contraseñas o fechas de expiración y activar el compartir de servidor a servidor vía enlaces compartidos, así como compartir desde dispositivos móviles.\nApagar esta característica elimina los archivos compartidos y las carpetas en el servidor, para todos los receptores, y también los clientes de sincronización y móviles. Más información disponible en la documentación de Nextcloud.", "No entries found in this folder" : "No hay nada en esta carpeta", "Name" : "Nombre", "Share time" : "Compartido hace", diff --git a/apps/files_sharing/l10n/es_MX.js b/apps/files_sharing/l10n/es_MX.js index 97deac6c79c..b9b37744be7 100644 --- a/apps/files_sharing/l10n/es_MX.js +++ b/apps/files_sharing/l10n/es_MX.js @@ -92,7 +92,6 @@ OC.L10N.register( "Add to your Nextcloud" : "Agregar a tu Nextcloud", "Share API is disabled" : "El API para compartir está deshabilitado", "File sharing" : "Compartir archivos", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Esta aplicación le permite a los usuarios compartir archivos dentro de Nextcloud. Si está habilitada, el administrador puede elegir que grupos pueden compartir archivos. Los usuarios correspondientes entonces pueden compartir archivos y carpetas con otros usuarios y grupos dentro de Nextcloid. Además, si el adminsitrador habilita la funcionalidad de compartir liga, una liga externa puede ser usada para compartir archivos con otros usuarios fuera de Nextcloud. Los administradores también pueden forzar contraseñas, fechas de expiración, y habilitar el compartir de servidor-a-servidor mediante ligas, asi como compartir desde dispositivos móviles. \nEl deshabilitar la funcionalidad, elimina en el servidor a los archivos y carpetas compartidos para todos los destinatarios del elemento compartido y también en los clientes de sincronización y dispositivos móviles. Hay mas información disponible en la Documentación de Nextcloud.", "No entries found in this folder" : "No se encontraron elementos en esta carpeta", "Name" : "Nombre", "Share time" : "Compartido desde", diff --git a/apps/files_sharing/l10n/es_MX.json b/apps/files_sharing/l10n/es_MX.json index 2f60b6cb5c9..24aacd3f495 100644 --- a/apps/files_sharing/l10n/es_MX.json +++ b/apps/files_sharing/l10n/es_MX.json @@ -90,7 +90,6 @@ "Add to your Nextcloud" : "Agregar a tu Nextcloud", "Share API is disabled" : "El API para compartir está deshabilitado", "File sharing" : "Compartir archivos", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Esta aplicación le permite a los usuarios compartir archivos dentro de Nextcloud. Si está habilitada, el administrador puede elegir que grupos pueden compartir archivos. Los usuarios correspondientes entonces pueden compartir archivos y carpetas con otros usuarios y grupos dentro de Nextcloid. Además, si el adminsitrador habilita la funcionalidad de compartir liga, una liga externa puede ser usada para compartir archivos con otros usuarios fuera de Nextcloud. Los administradores también pueden forzar contraseñas, fechas de expiración, y habilitar el compartir de servidor-a-servidor mediante ligas, asi como compartir desde dispositivos móviles. \nEl deshabilitar la funcionalidad, elimina en el servidor a los archivos y carpetas compartidos para todos los destinatarios del elemento compartido y también en los clientes de sincronización y dispositivos móviles. Hay mas información disponible en la Documentación de Nextcloud.", "No entries found in this folder" : "No se encontraron elementos en esta carpeta", "Name" : "Nombre", "Share time" : "Compartido desde", diff --git a/apps/files_sharing/l10n/fr.js b/apps/files_sharing/l10n/fr.js index 874560d2a05..1ae57da363a 100644 --- a/apps/files_sharing/l10n/fr.js +++ b/apps/files_sharing/l10n/fr.js @@ -105,7 +105,6 @@ OC.L10N.register( "Add to your Nextcloud" : "Ajouter à votre Nextcloud", "Share API is disabled" : "l'API de partage est désactivée", "File sharing" : "Partage de fichier", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Cette application permet aux utilisateurs de partager des fichiers au sein de Nextcloud. Lorsqu'elle est activée, l'administrateur peut choisir quels groupes peuvent partager des fichiers. Les utilisateurs concernés peuvent alors partager des fichiers et des dossiers avec d'autres utilisateurs et d'autres groupes au sein de Nextcloud. De plus, si l'administrateur active la fonctionnalité de partage par lien, un lien externe peut être utilisé pour partager des fichiers avec d'autres utilisateurs en dehors de Nextcloud. Les administrateurs peuvent aussi forcer l'utilisation de mots de passe et de dates d'expiration, et activer le partage de serveur à serveur au moyen de liens de partage, ainsi que le partage depuis un appareil mobile.\nDésactiver la fonctionnalité supprime les fichiers et les dossiers partagés sur le serveur pour tous les destinataires, et aussi dans les clients de synchronisation et les applications mobiles. Plus d'informations sont disponibles dans la documentation Nextcloud.", "No entries found in this folder" : "Aucune entrée trouvée dans ce dossier", "Name" : "Nom", "Share time" : "Date de partage", diff --git a/apps/files_sharing/l10n/fr.json b/apps/files_sharing/l10n/fr.json index 98d91cdb5b6..0c9123ace6c 100644 --- a/apps/files_sharing/l10n/fr.json +++ b/apps/files_sharing/l10n/fr.json @@ -103,7 +103,6 @@ "Add to your Nextcloud" : "Ajouter à votre Nextcloud", "Share API is disabled" : "l'API de partage est désactivée", "File sharing" : "Partage de fichier", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Cette application permet aux utilisateurs de partager des fichiers au sein de Nextcloud. Lorsqu'elle est activée, l'administrateur peut choisir quels groupes peuvent partager des fichiers. Les utilisateurs concernés peuvent alors partager des fichiers et des dossiers avec d'autres utilisateurs et d'autres groupes au sein de Nextcloud. De plus, si l'administrateur active la fonctionnalité de partage par lien, un lien externe peut être utilisé pour partager des fichiers avec d'autres utilisateurs en dehors de Nextcloud. Les administrateurs peuvent aussi forcer l'utilisation de mots de passe et de dates d'expiration, et activer le partage de serveur à serveur au moyen de liens de partage, ainsi que le partage depuis un appareil mobile.\nDésactiver la fonctionnalité supprime les fichiers et les dossiers partagés sur le serveur pour tous les destinataires, et aussi dans les clients de synchronisation et les applications mobiles. Plus d'informations sont disponibles dans la documentation Nextcloud.", "No entries found in this folder" : "Aucune entrée trouvée dans ce dossier", "Name" : "Nom", "Share time" : "Date de partage", diff --git a/apps/files_sharing/l10n/it.js b/apps/files_sharing/l10n/it.js index 73d47955e63..2db5f629a1f 100644 --- a/apps/files_sharing/l10n/it.js +++ b/apps/files_sharing/l10n/it.js @@ -106,7 +106,7 @@ OC.L10N.register( "Add to your Nextcloud" : "Aggiungi al tuo Nextcloud", "Share API is disabled" : "API di condivisione disabilitate", "File sharing" : "Condivisione di file", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Questa applicazione consente agli utenti di condividere file all'interno di Nextcloud. Se abilitata, l'amministratore può scegliere quali gruppi possono condividere file. Gli utenti ai quali si applica possono quindi condividere file e cartelle con altri utenti e gruppi all'interno di Nextcloud. In aggiunta, se l'amministratore abilita la funzionalità di condivisione dei collegamenti, un collegamento esterno può essere utilizzato per condividere file con altri utenti all'esterno di Nextcloud. Gli amministratori possono inoltre forzare le password, le date di scadenza e abilitare la condivisione tra server tramite collegamenti di condivisione, così come la condivisione tra dispositivi mobili.\nLa disattivazione della funzionalità rimuove i file condivisi e le cartelle sul server per tutti i destinatari della condivisione, e anche sui client di sincronizzazione e sulle applicazioni mobili. Altre informazioni sono disponibili nella documentazione di Nextcloud.", + "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Questa applicazione consente agli utenti di condividere file all'interno di Nextcloud. Se abilitata, l'amministratore può scegliere quali gruppi possono condividere file. Gli utenti ai quali si applica possono quindi condividere file e cartelle con altri utenti e gruppi all'interno di Nextcloud. In aggiunta, se l'amministratore abilita la funzionalità dei collegamenti di condivisione, un collegamento esterno può essere utilizzato per condividere file con altri utenti all'esterno di Nextcloud. Gli amministratori possono inoltre forzare le password, le date di scadenza e abilitare la condivisione tra server tramite collegamenti di condivisione, così come la condivisione da dispositivi mobili.\nLa disattivazione della funzionalità rimuove i file e le cartelle condivisi sul server per tutti i destinatari della condivisione, e anche sui client di sincronizzazione e sulle applicazioni mobili. Altre informazioni sono disponibili nella documentazione di Nextcloud.", "No entries found in this folder" : "Nessuna voce trovata in questa cartella", "Name" : "Nome", "Share time" : "Tempo di condivisione", diff --git a/apps/files_sharing/l10n/it.json b/apps/files_sharing/l10n/it.json index 37e17fd55b5..1f24765f17f 100644 --- a/apps/files_sharing/l10n/it.json +++ b/apps/files_sharing/l10n/it.json @@ -104,7 +104,7 @@ "Add to your Nextcloud" : "Aggiungi al tuo Nextcloud", "Share API is disabled" : "API di condivisione disabilitate", "File sharing" : "Condivisione di file", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Questa applicazione consente agli utenti di condividere file all'interno di Nextcloud. Se abilitata, l'amministratore può scegliere quali gruppi possono condividere file. Gli utenti ai quali si applica possono quindi condividere file e cartelle con altri utenti e gruppi all'interno di Nextcloud. In aggiunta, se l'amministratore abilita la funzionalità di condivisione dei collegamenti, un collegamento esterno può essere utilizzato per condividere file con altri utenti all'esterno di Nextcloud. Gli amministratori possono inoltre forzare le password, le date di scadenza e abilitare la condivisione tra server tramite collegamenti di condivisione, così come la condivisione tra dispositivi mobili.\nLa disattivazione della funzionalità rimuove i file condivisi e le cartelle sul server per tutti i destinatari della condivisione, e anche sui client di sincronizzazione e sulle applicazioni mobili. Altre informazioni sono disponibili nella documentazione di Nextcloud.", + "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Questa applicazione consente agli utenti di condividere file all'interno di Nextcloud. Se abilitata, l'amministratore può scegliere quali gruppi possono condividere file. Gli utenti ai quali si applica possono quindi condividere file e cartelle con altri utenti e gruppi all'interno di Nextcloud. In aggiunta, se l'amministratore abilita la funzionalità dei collegamenti di condivisione, un collegamento esterno può essere utilizzato per condividere file con altri utenti all'esterno di Nextcloud. Gli amministratori possono inoltre forzare le password, le date di scadenza e abilitare la condivisione tra server tramite collegamenti di condivisione, così come la condivisione da dispositivi mobili.\nLa disattivazione della funzionalità rimuove i file e le cartelle condivisi sul server per tutti i destinatari della condivisione, e anche sui client di sincronizzazione e sulle applicazioni mobili. Altre informazioni sono disponibili nella documentazione di Nextcloud.", "No entries found in this folder" : "Nessuna voce trovata in questa cartella", "Name" : "Nome", "Share time" : "Tempo di condivisione", diff --git a/apps/files_sharing/l10n/pt_BR.js b/apps/files_sharing/l10n/pt_BR.js index befab592019..d92acf12c9c 100644 --- a/apps/files_sharing/l10n/pt_BR.js +++ b/apps/files_sharing/l10n/pt_BR.js @@ -106,7 +106,7 @@ OC.L10N.register( "Add to your Nextcloud" : "Adicionar ao seu Nextcloud", "Share API is disabled" : "O compartilhamento de API está desabilitado.", "File sharing" : "Compartilhamento de arquivos", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Este aplicativo permite que os usuários compartilhem arquivos no Nextcloud. Se ativado, o administrador pode escolher quais grupos podem compartilhar arquivos. Os usuários aplicáveis podem compartilhar arquivos e pastas com outros usuários e grupos no Nextcloud. Além disso, se o administrador ativar o recurso de link de compartilhamento, um link externo poderá ser usado para compartilhar arquivos com outros usuários fora do Nextcloud. Os administradores também podem colocar senhas, datas de vencimento e permitir o compartilhamento de servidor para servidor por meio de links de compartilhamento, bem como o compartilhamento de dispositivos móveis.\nDesativar o recurso remove arquivos e pastas compartilhados no servidor para todos os destinatários de compartilhamento e também nos clientes de sincronização e aplicativos móveis. Mais informações estão disponíveis na Documentação Nextcloud.", + "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Este aplicativo permite que os usuários compartilhem arquivos no Nextcloud. Se ativado, o administrador pode escolher quais grupos podem compartilhar arquivos. Os usuários aplicáveis podem compartilhar arquivos e pastas com outros usuários e grupos no Nextcloud. Além disso, se o administrador ativar o recurso de link de compartilhamento, um link externo poderá ser usado para compartilhar arquivos com outros usuários fora do Nextcloud. Os administradores também podem impor senhas, datas de vencimento e permitir o compartilhamento de servidor para servidor por meio de links de compartilhamento, bem como o compartilhamento de dispositivos móveis.\nDesativar este recurso remove arquivos e pastas compartilhados no servidor para todos os destinatários de compartilhamento e também nos clientes de sincronização e aplicativos móveis. Mais informações estão disponíveis na documentação do Nextcloud.", "No entries found in this folder" : "Nenhuma entrada foi encontrada nesta pasta", "Name" : "Nome", "Share time" : "Compartilhamento", diff --git a/apps/files_sharing/l10n/pt_BR.json b/apps/files_sharing/l10n/pt_BR.json index ea4e88f1d9e..90c3c40d237 100644 --- a/apps/files_sharing/l10n/pt_BR.json +++ b/apps/files_sharing/l10n/pt_BR.json @@ -104,7 +104,7 @@ "Add to your Nextcloud" : "Adicionar ao seu Nextcloud", "Share API is disabled" : "O compartilhamento de API está desabilitado.", "File sharing" : "Compartilhamento de arquivos", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Este aplicativo permite que os usuários compartilhem arquivos no Nextcloud. Se ativado, o administrador pode escolher quais grupos podem compartilhar arquivos. Os usuários aplicáveis podem compartilhar arquivos e pastas com outros usuários e grupos no Nextcloud. Além disso, se o administrador ativar o recurso de link de compartilhamento, um link externo poderá ser usado para compartilhar arquivos com outros usuários fora do Nextcloud. Os administradores também podem colocar senhas, datas de vencimento e permitir o compartilhamento de servidor para servidor por meio de links de compartilhamento, bem como o compartilhamento de dispositivos móveis.\nDesativar o recurso remove arquivos e pastas compartilhados no servidor para todos os destinatários de compartilhamento e também nos clientes de sincronização e aplicativos móveis. Mais informações estão disponíveis na Documentação Nextcloud.", + "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Este aplicativo permite que os usuários compartilhem arquivos no Nextcloud. Se ativado, o administrador pode escolher quais grupos podem compartilhar arquivos. Os usuários aplicáveis podem compartilhar arquivos e pastas com outros usuários e grupos no Nextcloud. Além disso, se o administrador ativar o recurso de link de compartilhamento, um link externo poderá ser usado para compartilhar arquivos com outros usuários fora do Nextcloud. Os administradores também podem impor senhas, datas de vencimento e permitir o compartilhamento de servidor para servidor por meio de links de compartilhamento, bem como o compartilhamento de dispositivos móveis.\nDesativar este recurso remove arquivos e pastas compartilhados no servidor para todos os destinatários de compartilhamento e também nos clientes de sincronização e aplicativos móveis. Mais informações estão disponíveis na documentação do Nextcloud.", "No entries found in this folder" : "Nenhuma entrada foi encontrada nesta pasta", "Name" : "Nome", "Share time" : "Compartilhamento", diff --git a/apps/files_sharing/l10n/pt_PT.js b/apps/files_sharing/l10n/pt_PT.js index a928eb5554a..257b01d8a16 100644 --- a/apps/files_sharing/l10n/pt_PT.js +++ b/apps/files_sharing/l10n/pt_PT.js @@ -21,9 +21,9 @@ OC.L10N.register( "Sharing" : "Partilha", "File shares" : "Partilhas de ficheiro", "Downloaded via public link" : "Transferido via hiperligação pública", - "Downloaded by {email}" : "Descarregado por {email}", - "{file} downloaded via public link" : "{file} descarregado através de uma hiperligação pública", - "{email} downloaded {file}" : "{email} descarregou {file}", + "Downloaded by {email}" : "Transferido por {email}", + "{file} downloaded via public link" : "{file} transferido via hiperligação pública", + "{email} downloaded {file}" : "{email} transferiu {file}", "Shared with group {group}" : "Partilhado com o grupo {group}", "Removed share for group {group}" : "Removeu a partilha para o grupo {group}", "{actor} shared with group {group}" : "{actor} partilhou com o grupo {group}", @@ -61,7 +61,7 @@ OC.L10N.register( "{actor} shared {file} with {user}" : "{actor} partilhou {file} com {user}", "{actor} removed {user} from {file}" : "{actor} removeu {user} de {file}", "{actor} shared {file} with you" : "{actor} partilhou {file} consigo", - "A file or folder shared by mail or by public link was <strong>downloaded</strong>" : "Um ficheiro ou pasta partilhado por email ou hiperligação publica foi <strong>descarregado</strong>", + "A file or folder shared by mail or by public link was <strong>downloaded</strong>" : "Um ficheiro ou pasta partilhado por e-mail ou hiperligação publica foi transferido</strong>", "A file or folder was shared from <strong>another server</strong>" : "Um ficheiro ou pasta foi partilhado a partir de <strong>outro servidor</strong>", "A file or folder has been <strong>shared</strong>" : "Foi <strong>partilhado</strong> um ficheiro ou uma pasta", "Wrong share ID, share doesn't exist" : "Id. de partilha errada, a partilha não existe", diff --git a/apps/files_sharing/l10n/pt_PT.json b/apps/files_sharing/l10n/pt_PT.json index 39fd45311af..8e19866f66b 100644 --- a/apps/files_sharing/l10n/pt_PT.json +++ b/apps/files_sharing/l10n/pt_PT.json @@ -19,9 +19,9 @@ "Sharing" : "Partilha", "File shares" : "Partilhas de ficheiro", "Downloaded via public link" : "Transferido via hiperligação pública", - "Downloaded by {email}" : "Descarregado por {email}", - "{file} downloaded via public link" : "{file} descarregado através de uma hiperligação pública", - "{email} downloaded {file}" : "{email} descarregou {file}", + "Downloaded by {email}" : "Transferido por {email}", + "{file} downloaded via public link" : "{file} transferido via hiperligação pública", + "{email} downloaded {file}" : "{email} transferiu {file}", "Shared with group {group}" : "Partilhado com o grupo {group}", "Removed share for group {group}" : "Removeu a partilha para o grupo {group}", "{actor} shared with group {group}" : "{actor} partilhou com o grupo {group}", @@ -59,7 +59,7 @@ "{actor} shared {file} with {user}" : "{actor} partilhou {file} com {user}", "{actor} removed {user} from {file}" : "{actor} removeu {user} de {file}", "{actor} shared {file} with you" : "{actor} partilhou {file} consigo", - "A file or folder shared by mail or by public link was <strong>downloaded</strong>" : "Um ficheiro ou pasta partilhado por email ou hiperligação publica foi <strong>descarregado</strong>", + "A file or folder shared by mail or by public link was <strong>downloaded</strong>" : "Um ficheiro ou pasta partilhado por e-mail ou hiperligação publica foi transferido</strong>", "A file or folder was shared from <strong>another server</strong>" : "Um ficheiro ou pasta foi partilhado a partir de <strong>outro servidor</strong>", "A file or folder has been <strong>shared</strong>" : "Foi <strong>partilhado</strong> um ficheiro ou uma pasta", "Wrong share ID, share doesn't exist" : "Id. de partilha errada, a partilha não existe", diff --git a/apps/files_sharing/l10n/ru.js b/apps/files_sharing/l10n/ru.js index 1ecf22c3508..c9bfe0e2f82 100644 --- a/apps/files_sharing/l10n/ru.js +++ b/apps/files_sharing/l10n/ru.js @@ -18,7 +18,9 @@ OC.L10N.register( "Shares will show up here" : "Здесь будут показаны общие ресурсы", "Restore share" : "Восстановить ресурсы общего доступа", "Something happened. Unable to restore the share." : "Не удалось восстановить общий ресурс.", + "Move or copy" : "Переместить или копировать", "Download" : "Скачать", + "Delete" : "Удалить", "You can upload into this folder" : "Вы можете загружать в этот каталог", "No compatible server found at {remote}" : "Не найден совместимый сервер на {remote}", "Invalid server URL" : "Неверный URL сервера", @@ -91,6 +93,7 @@ OC.L10N.register( "Sharing %s sending the password by Nextcloud Talk failed because Nextcloud Talk is not enabled" : "Не удалось отправить пароль для доступа к «%s»: приложение Nextcloud Talk отключено.", "You cannot share to a Circle if the app is not enabled" : "Вы не можете поделиться с кругом, если приложение «Круг» не включено", "Please specify a valid circle" : "Укажите верный круг", + "Sharing %s failed because the back end does not support room shares" : "Не удалось предоставить общий доступ к «%s» поскольку механизм обмена не поддерживает общий доступ такого типа", "Unknown share type" : "Общий доступ неизвестного типа", "Not a directory" : "Это не каталог", "Could not lock path" : "Не удалось заблокировать путь", @@ -103,7 +106,6 @@ OC.L10N.register( "Add to your Nextcloud" : "Добавить в свой Nextcloud", "Share API is disabled" : "API общего доступа отключён", "File sharing" : "Обмен файлами", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Это приложение позволяет пользователям обмениваться файлами в Nextcloud. Если включено, администратор может выбрать, какие группы пользователей могут обмениваться файлами. После этого пользователи, которым такой обмен разрешен, могут обмениваться файлами и папками с другими пользователями и группами в Nextcloud. Кроме того, если администратор позволяет использовать функцию общего доступа, внешняя ссылка может использоваться для обмена файлами с другими пользователями, не являющимися пользователями Nextcloud. Админы могут также вводить в действие пароли, даты истечения срока действия и разрешать совместное использование файлов между серверами(server to server) с помощью общих ссылок, а также совместное использование с мобильных устройств. Отключение данной функции, отключает общие файлы и папки на сервере для всех получателей общего доступа, а также при синхронизации клиентов и мобильных приложений. Дополнительная информация доступна в документации Nextcloud.", "No entries found in this folder" : "В этой папке ничего нет", "Name" : "Имя", "Share time" : "Дата публикации", diff --git a/apps/files_sharing/l10n/ru.json b/apps/files_sharing/l10n/ru.json index 6ac4f4749c9..4950fbf5f97 100644 --- a/apps/files_sharing/l10n/ru.json +++ b/apps/files_sharing/l10n/ru.json @@ -16,7 +16,9 @@ "Shares will show up here" : "Здесь будут показаны общие ресурсы", "Restore share" : "Восстановить ресурсы общего доступа", "Something happened. Unable to restore the share." : "Не удалось восстановить общий ресурс.", + "Move or copy" : "Переместить или копировать", "Download" : "Скачать", + "Delete" : "Удалить", "You can upload into this folder" : "Вы можете загружать в этот каталог", "No compatible server found at {remote}" : "Не найден совместимый сервер на {remote}", "Invalid server URL" : "Неверный URL сервера", @@ -89,6 +91,7 @@ "Sharing %s sending the password by Nextcloud Talk failed because Nextcloud Talk is not enabled" : "Не удалось отправить пароль для доступа к «%s»: приложение Nextcloud Talk отключено.", "You cannot share to a Circle if the app is not enabled" : "Вы не можете поделиться с кругом, если приложение «Круг» не включено", "Please specify a valid circle" : "Укажите верный круг", + "Sharing %s failed because the back end does not support room shares" : "Не удалось предоставить общий доступ к «%s» поскольку механизм обмена не поддерживает общий доступ такого типа", "Unknown share type" : "Общий доступ неизвестного типа", "Not a directory" : "Это не каталог", "Could not lock path" : "Не удалось заблокировать путь", @@ -101,7 +104,6 @@ "Add to your Nextcloud" : "Добавить в свой Nextcloud", "Share API is disabled" : "API общего доступа отключён", "File sharing" : "Обмен файлами", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Это приложение позволяет пользователям обмениваться файлами в Nextcloud. Если включено, администратор может выбрать, какие группы пользователей могут обмениваться файлами. После этого пользователи, которым такой обмен разрешен, могут обмениваться файлами и папками с другими пользователями и группами в Nextcloud. Кроме того, если администратор позволяет использовать функцию общего доступа, внешняя ссылка может использоваться для обмена файлами с другими пользователями, не являющимися пользователями Nextcloud. Админы могут также вводить в действие пароли, даты истечения срока действия и разрешать совместное использование файлов между серверами(server to server) с помощью общих ссылок, а также совместное использование с мобильных устройств. Отключение данной функции, отключает общие файлы и папки на сервере для всех получателей общего доступа, а также при синхронизации клиентов и мобильных приложений. Дополнительная информация доступна в документации Nextcloud.", "No entries found in this folder" : "В этой папке ничего нет", "Name" : "Имя", "Share time" : "Дата публикации", diff --git a/apps/files_sharing/l10n/sr.js b/apps/files_sharing/l10n/sr.js index 0d96e7759eb..69dfdadd6c0 100644 --- a/apps/files_sharing/l10n/sr.js +++ b/apps/files_sharing/l10n/sr.js @@ -106,7 +106,6 @@ OC.L10N.register( "Add to your Nextcloud" : "Додајте у свој облак", "Share API is disabled" : "API за дељене је искључен", "File sharing" : "Дељења фајлова", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Ова апликација омогућава корисницима да деле фајлове унутар Некстклауда. Када се укључи, администратор може да одабере које групе могу да деле фајлове. Такви корисници затим могу да деле фасцикле и фајлове са осталим корисницима и групама унутар Некстклауда. Додатно, ако администратор укључи и могућност за дељење везе, може се користити и спољна веза за дељење са корисницима ван Некстклауда. Администратори такође могу да захтевају лозинке, датум истека и да омогуће дељење између сервера преко веза дељења, као и дељење са мобилних уређаја.\nИскључивањем ове могућности искључује дељене фасцикле и фајлове на серверу за све дељенике, као и на синхронизованим клијентима и мобилним апликацијама. Више информација можете наћи у Некстклауд документацији.", "No entries found in this folder" : "Нема ничега у овој фасцикли", "Name" : "Назив", "Share time" : "Време дељења", diff --git a/apps/files_sharing/l10n/sr.json b/apps/files_sharing/l10n/sr.json index 544d8476132..fe7308639de 100644 --- a/apps/files_sharing/l10n/sr.json +++ b/apps/files_sharing/l10n/sr.json @@ -104,7 +104,6 @@ "Add to your Nextcloud" : "Додајте у свој облак", "Share API is disabled" : "API за дељене је искључен", "File sharing" : "Дељења фајлова", - "This application enables users to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable users can then share files and folders with other users and groups within Nextcloud. In addition, if the admin enables the share link feature, an external link can be used to share files with other users outside of Nextcloud. Admins can also enforce passwords, expirations dates, and enable server to server sharing via share links, as well as sharing from mobile devices.\nTurning the feature off removes shared files and folders on the server for all share recipients, and also on the sync clients and mobile apps. More information is available in the Nextcloud Documentation." : "Ова апликација омогућава корисницима да деле фајлове унутар Некстклауда. Када се укључи, администратор може да одабере које групе могу да деле фајлове. Такви корисници затим могу да деле фасцикле и фајлове са осталим корисницима и групама унутар Некстклауда. Додатно, ако администратор укључи и могућност за дељење везе, може се користити и спољна веза за дељење са корисницима ван Некстклауда. Администратори такође могу да захтевају лозинке, датум истека и да омогуће дељење између сервера преко веза дељења, као и дељење са мобилних уређаја.\nИскључивањем ове могућности искључује дељене фасцикле и фајлове на серверу за све дељенике, као и на синхронизованим клијентима и мобилним апликацијама. Више информација можете наћи у Некстклауд документацији.", "No entries found in this folder" : "Нема ничега у овој фасцикли", "Name" : "Назив", "Share time" : "Време дељења", diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php index cb02a2b5f23..47a787350d5 100644 --- a/apps/files_sharing/lib/MountProvider.php +++ b/apps/files_sharing/lib/MountProvider.php @@ -27,6 +27,8 @@ namespace OCA\Files_Sharing; +use OC\Cache\CappedMemoryCache; +use OC\Files\View; use OCP\Files\Config\IMountProvider; use OCP\Files\Storage\IStorageFactory; use OCP\IConfig; @@ -84,20 +86,35 @@ class MountProvider implements IMountProvider { $superShares = $this->buildSuperShares($shares, $user); $mounts = []; + $view = new View('/' . $user->getUID() . '/files'); + $ownerViews = []; + $sharingDisabledForUser = $this->shareManager->sharingDisabledForUser($user->getUID()); + $foldersExistCache = new CappedMemoryCache(); foreach ($superShares as $share) { try { - $mounts[] = new SharedMount( + /** @var \OCP\Share\IShare $parentShare */ + $parentShare = $share[0]; + $owner = $parentShare->getShareOwner(); + if (!isset($ownerViews[$owner])) { + $ownerViews[$owner] = new View('/' . $parentShare->getShareOwner() . '/files'); + } + $mount = new SharedMount( '\OCA\Files_Sharing\SharedStorage', $mounts, [ 'user' => $user->getUID(), // parent share - 'superShare' => $share[0], + 'superShare' => $parentShare, // children/component of the superShare 'groupedShares' => $share[1], + 'ownerView' => $ownerViews[$owner], + 'sharingDisabledForUser' => $sharingDisabledForUser ], - $storageFactory + $storageFactory, + $view, + $foldersExistCache ); + $mounts[$mount->getMountPoint()] = $mount; } catch (\Exception $e) { $this->logger->logException($e); $this->logger->error('Error while trying to create shared mount'); @@ -105,7 +122,7 @@ class MountProvider implements IMountProvider { } // array_filter removes the null values from the array - return array_filter($mounts); + return array_values(array_filter($mounts)); } /** diff --git a/apps/files_sharing/lib/SharedMount.php b/apps/files_sharing/lib/SharedMount.php index 1f5b7eaa13e..a44fa336875 100644 --- a/apps/files_sharing/lib/SharedMount.php +++ b/apps/files_sharing/lib/SharedMount.php @@ -28,10 +28,12 @@ namespace OCA\Files_Sharing; +use OC\Cache\CappedMemoryCache; use OC\Files\Filesystem; use OC\Files\Mount\MountPoint; use OC\Files\Mount\MoveableMount; use OC\Files\View; +use OCP\Files\Storage\IStorageFactory; /** * Shared mount points can be moved by the user @@ -61,19 +63,19 @@ class SharedMount extends MountPoint implements MoveableMount { /** * @param string $storage * @param SharedMount[] $mountpoints - * @param array|null $arguments - * @param \OCP\Files\Storage\IStorageFactory $loader + * @param array $arguments + * @param IStorageFactory $loader + * @param View $recipientView */ - public function __construct($storage, array $mountpoints, $arguments = null, $loader = null) { + public function __construct($storage, array $mountpoints, $arguments, IStorageFactory $loader, View $recipientView, CappedMemoryCache $folderExistCache) { $this->user = $arguments['user']; - $this->recipientView = new View('/' . $this->user . '/files'); + $this->recipientView = $recipientView; $this->superShare = $arguments['superShare']; $this->groupedShares = $arguments['groupedShares']; - $newMountPoint = $this->verifyMountPoint($this->superShare, $mountpoints); + $newMountPoint = $this->verifyMountPoint($this->superShare, $mountpoints, $folderExistCache); $absMountPoint = '/' . $this->user . '/files' . $newMountPoint; - $arguments['ownerView'] = new View('/' . $this->superShare->getShareOwner() . '/files'); parent::__construct($storage, $absMountPoint, $arguments, $loader); } @@ -84,12 +86,18 @@ class SharedMount extends MountPoint implements MoveableMount { * @param SharedMount[] $mountpoints * @return string */ - private function verifyMountPoint(\OCP\Share\IShare $share, array $mountpoints) { + private function verifyMountPoint(\OCP\Share\IShare $share, array $mountpoints, CappedMemoryCache $folderExistCache) { $mountPoint = basename($share->getTarget()); $parent = dirname($share->getTarget()); - if (!$this->recipientView->is_dir($parent)) { + if ($folderExistCache->hasKey($parent)) { + $parentExists = $folderExistCache->get($parent); + } else { + $parentExists = $this->recipientView->is_dir($parent); + $folderExistCache->set($parent, $parentExists); + } + if (!$parentExists) { $parent = Helper::getShareFolder($this->recipientView); } @@ -135,19 +143,11 @@ class SharedMount extends MountPoint implements MoveableMount { $name = $pathinfo['filename']; $dir = $pathinfo['dirname']; - // Helper function to find existing mount points - $mountpointExists = function ($path) use ($mountpoints) { - foreach ($mountpoints as $mountpoint) { - if ($mountpoint->getShare()->getTarget() === $path) { - return true; - } - } - return false; - }; - $i = 2; - while ($view->file_exists($path) || $mountpointExists($path)) { + $absolutePath = $this->recipientView->getAbsolutePath($path) . '/'; + while ($view->file_exists($path) || isset($mountpoints[$absolutePath])) { $path = Filesystem::normalizePath($dir . '/' . $name . ' (' . $i . ')' . $ext); + $absolutePath = $this->recipientView->getAbsolutePath($path) . '/'; $i++; } diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index f681854cd2b..2d2f14fc554 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -79,6 +79,9 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto private $options; + /** @var boolean */ + private $sharingDisabledForUser; + public function __construct($arguments) { $this->ownerView = $arguments['ownerView']; $this->logger = \OC::$server->getLogger(); @@ -87,6 +90,11 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto $this->groupedShares = $arguments['groupedShares']; $this->user = $arguments['user']; + if (isset($arguments['sharingDisabledForUser'])) { + $this->sharingDisabledForUser = $arguments['sharingDisabledForUser']; + } else { + $this->sharingDisabledForUser = false; + } parent::__construct([ 'storage' => null, @@ -193,7 +201,7 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto $permissions |= \OCP\Constants::PERMISSION_DELETE; } - if (\OCP\Util::isSharingDisabledForUser()) { + if ($this->sharingDisabledForUser) { $permissions &= ~\OCP\Constants::PERMISSION_SHARE; } |