diff options
Diffstat (limited to 'apps/files_sharing')
25 files changed, 115 insertions, 84 deletions
diff --git a/apps/files_sharing/l10n/de.js b/apps/files_sharing/l10n/de.js index 9a636d54456..20d4a9b9ee1 100644 --- a/apps/files_sharing/l10n/de.js +++ b/apps/files_sharing/l10n/de.js @@ -223,8 +223,8 @@ OC.L10N.register( "Password protection (enforced)" : "Passwortschutz (erzwungen)", "Password protection" : "Passwortschutz", "Enter a password" : "Passwort eingeben", - "Enable link expiration (enforced)" : "Gültigkeit des Links aktivieren (erzwungen)", - "Enable link expiration" : "Ablauf des Links aktivieren", + "Enable link expiration (enforced)" : "Ablaufdatum des Links aktivieren (erzwungen)", + "Enable link expiration" : "Ablaufdatum des Links aktivieren", "Enter expiration date (enforced)" : "Ablaufdatum eingeben (erzwungen)", "Enter expiration date" : "Ablaufdatum eingeben", "Create share" : "Freigabe erstellen", diff --git a/apps/files_sharing/l10n/de.json b/apps/files_sharing/l10n/de.json index c80c9b8bfd5..d7561764bd8 100644 --- a/apps/files_sharing/l10n/de.json +++ b/apps/files_sharing/l10n/de.json @@ -221,8 +221,8 @@ "Password protection (enforced)" : "Passwortschutz (erzwungen)", "Password protection" : "Passwortschutz", "Enter a password" : "Passwort eingeben", - "Enable link expiration (enforced)" : "Gültigkeit des Links aktivieren (erzwungen)", - "Enable link expiration" : "Ablauf des Links aktivieren", + "Enable link expiration (enforced)" : "Ablaufdatum des Links aktivieren (erzwungen)", + "Enable link expiration" : "Ablaufdatum des Links aktivieren", "Enter expiration date (enforced)" : "Ablaufdatum eingeben (erzwungen)", "Enter expiration date" : "Ablaufdatum eingeben", "Create share" : "Freigabe erstellen", diff --git a/apps/files_sharing/l10n/de_DE.js b/apps/files_sharing/l10n/de_DE.js index 061bceaba1e..c2514fd2500 100644 --- a/apps/files_sharing/l10n/de_DE.js +++ b/apps/files_sharing/l10n/de_DE.js @@ -141,7 +141,7 @@ OC.L10N.register( "_{count} email address already added_::_{count} email addresses already added_" : ["{count} E-Mail-Adresse bereits hinzugefügt","{count} E-Mail-Adressen bereits hinzugefügt"], "_{count} email address added_::_{count} email addresses added_" : ["{count} E-Mail-Adresse hinzugefügt","{count} E-Mail-Adressen hinzugefügt"], "You can now share the link below to allow people to upload files to your directory." : "Sie können jetzt den unten stehenden Link freigeben, damit andere Dateien in Ihr Verzeichnis hochladen können.", - "Share link" : "Link teilen", + "Share link" : "Freigabe Link", "Copy to clipboard" : "In die Zwischenablage kopieren", "Send link via email" : "Link per E-Mail verschicken", "Enter an email address or paste a list" : "E-Mail-Adresse eingeben oder eine Liste einfügen", @@ -210,21 +210,21 @@ OC.L10N.register( "Shared via link by {initiator}" : "Geteilt mittels Link von {initiator}", "File request ({label})" : "Dateianfrage ({label})", "Mail share ({label})" : "Mail-Freigabe ({label})", - "Share link ({label})" : "Link teilen ({label})", + "Share link ({label})" : "Externer Link ({label})", "Mail share" : "E-Mail-Freigabe", - "Share link ({index})" : "Link teilen ({index})", + "Share link ({index})" : "Externer Link ({index})", "Create public link" : "Öffentlichen Link erstellen", "Actions for \"{title}\"" : "Aktionen für \"{title}\"", "Copy public link of \"{title}\" to clipboard" : "Öffentlichen Link von \"{title}\" in die Zwischenablage kopieren", "Error, please enter proper password and/or expiration date" : "Fehler. Bitte gebe das richtige Passwort und/oder Ablaufdatum ein", "Link share created" : "Link-Freigabe erstellt", "Error while creating the share" : "Fehler beim Erstellen der Freigabe", - "Please enter the following required information before creating the share" : "Bitte geben Sie die benötigten Informationen ein, bevor die Freigabe erstellt wird", + "Please enter the following required information before creating the share" : "Vor Erstellen der Freigabe bitte die erforderlichen Informationen eingeben", "Password protection (enforced)" : "Passwortschutz (erzwungen)", "Password protection" : "Passwortschutz", "Enter a password" : "Passwort eingeben", - "Enable link expiration (enforced)" : "Gültigkeit des Links aktivieren (erzwungen)", - "Enable link expiration" : "Gültigkeit des Links aktivieren", + "Enable link expiration (enforced)" : "Ablaufdatum des Links aktivieren (erzwungen)", + "Enable link expiration" : "Ablaufdatum des Links aktivieren", "Enter expiration date (enforced)" : "Ablaufdatum eingeben (erzwungen)", "Enter expiration date" : "Ablaufdatum eingeben", "Create share" : "Freigabe erstellen", @@ -283,7 +283,7 @@ OC.L10N.register( "Advanced settings" : "Erweiterte Einstellungen", "Share label" : "Freigabe-Label", "Share link token" : "Freigabe-Token teilen", - "Set the public share link token to something easy to remember or generate a new token. It is not recommended to use a guessable token for shares which contain sensitive information." : "Das öffentliche Freigabelink-Token auf einen Begriff festlegen, der leicht zu merken ist , oder generieren Sie ein neues Token. Es ist nicht empfehlenswert, ein erratbares Token für Freigaben zu verwenden, die vertrauliche Informationen enthalten.", + "Set the public share link token to something easy to remember or generate a new token. It is not recommended to use a guessable token for shares which contain sensitive information." : "Das öffentliche Freigabelink-Token auf einen Begriff festlegen, der leicht zu merken ist, oder ein neues Token erstellen. Es ist nicht zu empfehlen, für Freigaben , die vertrauliche Informationen enthalten, ein erratbares Token zu verwenden.", "Generating…" : "Generieren…", "Generate new token" : "Neues Token generieren", "Set password" : "Passwort festlegen", diff --git a/apps/files_sharing/l10n/de_DE.json b/apps/files_sharing/l10n/de_DE.json index 59d8719585c..4a8a5fcfeb3 100644 --- a/apps/files_sharing/l10n/de_DE.json +++ b/apps/files_sharing/l10n/de_DE.json @@ -139,7 +139,7 @@ "_{count} email address already added_::_{count} email addresses already added_" : ["{count} E-Mail-Adresse bereits hinzugefügt","{count} E-Mail-Adressen bereits hinzugefügt"], "_{count} email address added_::_{count} email addresses added_" : ["{count} E-Mail-Adresse hinzugefügt","{count} E-Mail-Adressen hinzugefügt"], "You can now share the link below to allow people to upload files to your directory." : "Sie können jetzt den unten stehenden Link freigeben, damit andere Dateien in Ihr Verzeichnis hochladen können.", - "Share link" : "Link teilen", + "Share link" : "Freigabe Link", "Copy to clipboard" : "In die Zwischenablage kopieren", "Send link via email" : "Link per E-Mail verschicken", "Enter an email address or paste a list" : "E-Mail-Adresse eingeben oder eine Liste einfügen", @@ -208,21 +208,21 @@ "Shared via link by {initiator}" : "Geteilt mittels Link von {initiator}", "File request ({label})" : "Dateianfrage ({label})", "Mail share ({label})" : "Mail-Freigabe ({label})", - "Share link ({label})" : "Link teilen ({label})", + "Share link ({label})" : "Externer Link ({label})", "Mail share" : "E-Mail-Freigabe", - "Share link ({index})" : "Link teilen ({index})", + "Share link ({index})" : "Externer Link ({index})", "Create public link" : "Öffentlichen Link erstellen", "Actions for \"{title}\"" : "Aktionen für \"{title}\"", "Copy public link of \"{title}\" to clipboard" : "Öffentlichen Link von \"{title}\" in die Zwischenablage kopieren", "Error, please enter proper password and/or expiration date" : "Fehler. Bitte gebe das richtige Passwort und/oder Ablaufdatum ein", "Link share created" : "Link-Freigabe erstellt", "Error while creating the share" : "Fehler beim Erstellen der Freigabe", - "Please enter the following required information before creating the share" : "Bitte geben Sie die benötigten Informationen ein, bevor die Freigabe erstellt wird", + "Please enter the following required information before creating the share" : "Vor Erstellen der Freigabe bitte die erforderlichen Informationen eingeben", "Password protection (enforced)" : "Passwortschutz (erzwungen)", "Password protection" : "Passwortschutz", "Enter a password" : "Passwort eingeben", - "Enable link expiration (enforced)" : "Gültigkeit des Links aktivieren (erzwungen)", - "Enable link expiration" : "Gültigkeit des Links aktivieren", + "Enable link expiration (enforced)" : "Ablaufdatum des Links aktivieren (erzwungen)", + "Enable link expiration" : "Ablaufdatum des Links aktivieren", "Enter expiration date (enforced)" : "Ablaufdatum eingeben (erzwungen)", "Enter expiration date" : "Ablaufdatum eingeben", "Create share" : "Freigabe erstellen", @@ -281,7 +281,7 @@ "Advanced settings" : "Erweiterte Einstellungen", "Share label" : "Freigabe-Label", "Share link token" : "Freigabe-Token teilen", - "Set the public share link token to something easy to remember or generate a new token. It is not recommended to use a guessable token for shares which contain sensitive information." : "Das öffentliche Freigabelink-Token auf einen Begriff festlegen, der leicht zu merken ist , oder generieren Sie ein neues Token. Es ist nicht empfehlenswert, ein erratbares Token für Freigaben zu verwenden, die vertrauliche Informationen enthalten.", + "Set the public share link token to something easy to remember or generate a new token. It is not recommended to use a guessable token for shares which contain sensitive information." : "Das öffentliche Freigabelink-Token auf einen Begriff festlegen, der leicht zu merken ist, oder ein neues Token erstellen. Es ist nicht zu empfehlen, für Freigaben , die vertrauliche Informationen enthalten, ein erratbares Token zu verwenden.", "Generating…" : "Generieren…", "Generate new token" : "Neues Token generieren", "Set password" : "Passwort festlegen", diff --git a/apps/files_sharing/l10n/fr.js b/apps/files_sharing/l10n/fr.js index a4b3ce4bd80..ec4da5a6c7d 100644 --- a/apps/files_sharing/l10n/fr.js +++ b/apps/files_sharing/l10n/fr.js @@ -128,7 +128,7 @@ OC.L10N.register( "Select a date" : "Sélectionner une date", "Your administrator has enforced a {count} days expiration policy." : "Votre administrateur a imposé une politique d'expiration de {count} jours.", "What password should be used for the request?" : "Quel mot de passe doit être utilisé pour la demande ?", - "Set a password" : "Saisissez un mot de passe", + "Set a password" : "Saisir un mot de passe", "Password" : "Mot de passe", "Enter a valid password" : "Saisir un mot de passe valide", "Generate a new password" : "Générer un nouveau mot de passe", @@ -143,7 +143,7 @@ OC.L10N.register( "You can now share the link below to allow people to upload files to your directory." : "Vous pouvez désormais partager le lien ci-dessous pour permettre aux gens de téléverser des fichiers dans votre dossier.", "Share link" : "Lien de partage", "Copy to clipboard" : "Copier dans le presse-papiers", - "Send link via email" : "Envoyer le lien par mail", + "Send link via email" : "Envoyer le lien par e-mail", "Enter an email address or paste a list" : "Entrez une adresse e-mail ou collez une liste", "Remove email" : "Retirer l'e-mail", "Select a destination" : "Choisir une destination", @@ -169,8 +169,8 @@ OC.L10N.register( "Error sending emails: {errorMessage}" : "Erreur à l'envoi des mails {errorMessage}", "Error sending emails" : "Erreur à l'envoi des e-mails", "Create a file request" : "Créer une demande de fichier", - "Collect files from others even if they do not have an account." : "Collecter les fichiers d'autres personnes même si elles n'ont pas de compte.", - "To ensure you can receive files, verify you have enough storage available." : "Pour vous assurer que vous pouvez recevoir des fichiers, vérifier que vous avez suffisamment d'espace disque.", + "Collect files from others even if they do not have an account." : "Collectez des fichiers auprès d'autres personnes, même si elles n'ont pas de compte.", + "To ensure you can receive files, verify you have enough storage available." : "Pour vous assurer de pouvoir recevoir des fichiers, vérifiez que vous disposez d'un espace de stockage suffisant.", "File request" : "Demande de fichier", "Previous step" : "Étape précédente", "Cancel" : "Annuler", diff --git a/apps/files_sharing/l10n/fr.json b/apps/files_sharing/l10n/fr.json index b3a8d9cdf08..29f6978ea47 100644 --- a/apps/files_sharing/l10n/fr.json +++ b/apps/files_sharing/l10n/fr.json @@ -126,7 +126,7 @@ "Select a date" : "Sélectionner une date", "Your administrator has enforced a {count} days expiration policy." : "Votre administrateur a imposé une politique d'expiration de {count} jours.", "What password should be used for the request?" : "Quel mot de passe doit être utilisé pour la demande ?", - "Set a password" : "Saisissez un mot de passe", + "Set a password" : "Saisir un mot de passe", "Password" : "Mot de passe", "Enter a valid password" : "Saisir un mot de passe valide", "Generate a new password" : "Générer un nouveau mot de passe", @@ -141,7 +141,7 @@ "You can now share the link below to allow people to upload files to your directory." : "Vous pouvez désormais partager le lien ci-dessous pour permettre aux gens de téléverser des fichiers dans votre dossier.", "Share link" : "Lien de partage", "Copy to clipboard" : "Copier dans le presse-papiers", - "Send link via email" : "Envoyer le lien par mail", + "Send link via email" : "Envoyer le lien par e-mail", "Enter an email address or paste a list" : "Entrez une adresse e-mail ou collez une liste", "Remove email" : "Retirer l'e-mail", "Select a destination" : "Choisir une destination", @@ -167,8 +167,8 @@ "Error sending emails: {errorMessage}" : "Erreur à l'envoi des mails {errorMessage}", "Error sending emails" : "Erreur à l'envoi des e-mails", "Create a file request" : "Créer une demande de fichier", - "Collect files from others even if they do not have an account." : "Collecter les fichiers d'autres personnes même si elles n'ont pas de compte.", - "To ensure you can receive files, verify you have enough storage available." : "Pour vous assurer que vous pouvez recevoir des fichiers, vérifier que vous avez suffisamment d'espace disque.", + "Collect files from others even if they do not have an account." : "Collectez des fichiers auprès d'autres personnes, même si elles n'ont pas de compte.", + "To ensure you can receive files, verify you have enough storage available." : "Pour vous assurer de pouvoir recevoir des fichiers, vérifiez que vous disposez d'un espace de stockage suffisant.", "File request" : "Demande de fichier", "Previous step" : "Étape précédente", "Cancel" : "Annuler", diff --git a/apps/files_sharing/l10n/it.js b/apps/files_sharing/l10n/it.js index 23f0a3b4a28..fa7d330d86e 100644 --- a/apps/files_sharing/l10n/it.js +++ b/apps/files_sharing/l10n/it.js @@ -254,7 +254,7 @@ OC.L10N.register( "Search for internal recipients" : "Cerca destinatari interni", "Note from" : "Nota da", "Note:" : "Nota:", - "File drop" : "Elimina file", + "File drop" : "Deposita file", "Upload files to {foldername}." : "Carica i file su{foldername}.", "By uploading files, you agree to the terms of service." : "Caricando i file accetti i termini del servizio.", "Successfully uploaded files" : "File caricati correttamente", diff --git a/apps/files_sharing/l10n/it.json b/apps/files_sharing/l10n/it.json index fc84fa187f2..77427218f18 100644 --- a/apps/files_sharing/l10n/it.json +++ b/apps/files_sharing/l10n/it.json @@ -252,7 +252,7 @@ "Search for internal recipients" : "Cerca destinatari interni", "Note from" : "Nota da", "Note:" : "Nota:", - "File drop" : "Elimina file", + "File drop" : "Deposita file", "Upload files to {foldername}." : "Carica i file su{foldername}.", "By uploading files, you agree to the terms of service." : "Caricando i file accetti i termini del servizio.", "Successfully uploaded files" : "File caricati correttamente", diff --git a/apps/files_sharing/l10n/uk.js b/apps/files_sharing/l10n/uk.js index ace63ae6a4a..7da314c64ac 100644 --- a/apps/files_sharing/l10n/uk.js +++ b/apps/files_sharing/l10n/uk.js @@ -116,6 +116,7 @@ OC.L10N.register( "Remember to upload the files to %s" : "Пам'ятати про завантаження файлів до %s", "We would like to kindly remind you that you have not yet uploaded any files to the shared folder." : "Нагадування про те, що ви ще не завантажили жодного файлу до спільного каталогу.", "Open \"%s\"" : "Відкрити \"%s\"", + "This application enables people to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable people can then share files and folders with other accounts 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 people 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. Адміністратори також можуть встановлювати паролі, терміни дії та вмикати обмін між серверами за допомогою посилань для спільного доступу, а також обмін з мобільних пристроїв.\n\nВимкнення цієї функції видаляє спільні файли та каталоги на сервері для всіх одержувачів спільного доступу, а також на клієнтах синхронізації та в мобільних додатках. Більше інформації можна знайти в документації Nextcloud.", "People" : "Користувачі", "Filter accounts" : "Вибрати користувачів", "The request will expire on {date} at midnight and will be password protected." : "Термін дії запиту спливе опівночі {date}, запит буде захищено паролем. ", diff --git a/apps/files_sharing/l10n/uk.json b/apps/files_sharing/l10n/uk.json index 3af74737035..d1ad7a12475 100644 --- a/apps/files_sharing/l10n/uk.json +++ b/apps/files_sharing/l10n/uk.json @@ -114,6 +114,7 @@ "Remember to upload the files to %s" : "Пам'ятати про завантаження файлів до %s", "We would like to kindly remind you that you have not yet uploaded any files to the shared folder." : "Нагадування про те, що ви ще не завантажили жодного файлу до спільного каталогу.", "Open \"%s\"" : "Відкрити \"%s\"", + "This application enables people to share files within Nextcloud. If enabled, the admin can choose which groups can share files. The applicable people can then share files and folders with other accounts 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 people 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. Адміністратори також можуть встановлювати паролі, терміни дії та вмикати обмін між серверами за допомогою посилань для спільного доступу, а також обмін з мобільних пристроїв.\n\nВимкнення цієї функції видаляє спільні файли та каталоги на сервері для всіх одержувачів спільного доступу, а також на клієнтах синхронізації та в мобільних додатках. Більше інформації можна знайти в документації Nextcloud.", "People" : "Користувачі", "Filter accounts" : "Вибрати користувачів", "The request will expire on {date} at midnight and will be password protected." : "Термін дії запиту спливе опівночі {date}, запит буде захищено паролем. ", diff --git a/apps/files_sharing/lib/Config/ConfigLexicon.php b/apps/files_sharing/lib/Config/ConfigLexicon.php index a463b4e7ef2..3211c755fc7 100644 --- a/apps/files_sharing/lib/Config/ConfigLexicon.php +++ b/apps/files_sharing/lib/Config/ConfigLexicon.php @@ -8,28 +8,28 @@ declare(strict_types=1); namespace OCA\Files_Sharing\Config; -use NCU\Config\Lexicon\ConfigLexiconEntry; -use NCU\Config\Lexicon\ConfigLexiconStrictness; -use NCU\Config\Lexicon\IConfigLexicon; -use NCU\Config\ValueType; +use OCP\Config\Lexicon\Entry; +use OCP\Config\Lexicon\ILexicon; +use OCP\Config\Lexicon\Strictness; +use OCP\Config\ValueType; /** * Config Lexicon for files_sharing. * * Please Add & Manage your Config Keys in that file and keep the Lexicon up to date! * - * {@see IConfigLexicon} + * {@see ILexicon} */ -class ConfigLexicon implements IConfigLexicon { +class ConfigLexicon implements ILexicon { public const SHOW_FEDERATED_AS_INTERNAL = 'show_federated_shares_as_internal'; - public function getStrictness(): ConfigLexiconStrictness { - return ConfigLexiconStrictness::IGNORE; + public function getStrictness(): Strictness { + return Strictness::IGNORE; } public function getAppConfigs(): array { return [ - new ConfigLexiconEntry(self::SHOW_FEDERATED_AS_INTERNAL, ValueType::BOOL, false, 'shows federated shares as internal shares', true), + new Entry(self::SHOW_FEDERATED_AS_INTERNAL, ValueType::BOOL, false, 'shows federated shares as internal shares', true), ]; } diff --git a/apps/files_sharing/src/components/FileListFilterAccount.vue b/apps/files_sharing/src/components/FileListFilterAccount.vue index 46c847e7b19..150516e139b 100644 --- a/apps/files_sharing/src/components/FileListFilterAccount.vue +++ b/apps/files_sharing/src/components/FileListFilterAccount.vue @@ -8,7 +8,7 @@ :filter-name="t('files_sharing', 'People')" @reset-filter="resetFilter"> <template #icon> - <NcIconSvgWrapper :path="mdiAccountMultiple" /> + <NcIconSvgWrapper :path="mdiAccountMultipleOutline" /> </template> <NcActionInput v-if="availableAccounts.length > 1" :label="t('files_sharing', 'Filter accounts')" @@ -39,7 +39,7 @@ import type { IAccountData } from '../files_filters/AccountFilter.ts' import { translate as t } from '@nextcloud/l10n' -import { mdiAccountMultiple } from '@mdi/js' +import { mdiAccountMultipleOutline } from '@mdi/js' import { computed, ref, watch } from 'vue' import FileListFilter from '../../../files/src/components/FileListFilter/FileListFilter.vue' diff --git a/apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogIntro.vue b/apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogIntro.vue index 2d4d8eafa2b..5ac60c37e29 100644 --- a/apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogIntro.vue +++ b/apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogIntro.vue @@ -78,7 +78,7 @@ import { getFilePickerBuilder } from '@nextcloud/dialogs' import { t } from '@nextcloud/l10n' import IconFolder from 'vue-material-design-icons/Folder.vue' -import IconInfo from 'vue-material-design-icons/Information.vue' +import IconInfo from 'vue-material-design-icons/InformationOutline.vue' import IconLock from 'vue-material-design-icons/Lock.vue' import NcTextArea from '@nextcloud/vue/components/NcTextArea' import NcTextField from '@nextcloud/vue/components/NcTextField' diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index 702b876306f..6a456fa0a15 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -74,10 +74,10 @@ {{ config.enforcePasswordForPublicLink ? t('files_sharing', 'Password protection (enforced)') : t('files_sharing', 'Password protection') }} </NcActionCheckbox> - <NcActionInput v-if="pendingEnforcedPassword || share.password" + <NcActionInput v-if="pendingEnforcedPassword || isPasswordProtected" class="share-link-password" :label="t('files_sharing', 'Enter a password')" - :value.sync="share.password" + :value.sync="share.newPassword" :disabled="saving" :required="config.enableLinkPasswordByDefault || config.enforcePasswordForPublicLink" :minlength="isPasswordPolicyEnabled && config.passwordPolicy.minLength" @@ -115,7 +115,8 @@ </template> </NcActionInput> - <NcActionButton @click.prevent.stop="onNewLinkShare(true)"> + <NcActionButton :disabled="pendingEnforcedPassword && !share.newPassword" + @click.prevent.stop="onNewLinkShare(true)"> <template #icon> <CheckIcon :size="20" /> </template> @@ -242,10 +243,10 @@ import NcAvatar from '@nextcloud/vue/components/NcAvatar' import NcDialog from '@nextcloud/vue/components/NcDialog' import Tune from 'vue-material-design-icons/Tune.vue' -import IconCalendarBlank from 'vue-material-design-icons/CalendarBlank.vue' +import IconCalendarBlank from 'vue-material-design-icons/CalendarBlankOutline.vue' import IconQr from 'vue-material-design-icons/Qrcode.vue' import ErrorIcon from 'vue-material-design-icons/Exclamation.vue' -import LockIcon from 'vue-material-design-icons/Lock.vue' +import LockIcon from 'vue-material-design-icons/LockOutline.vue' import CheckIcon from 'vue-material-design-icons/CheckBold.vue' import ClipboardIcon from 'vue-material-design-icons/ContentCopy.vue' import CloseIcon from 'vue-material-design-icons/Close.vue' @@ -646,6 +647,7 @@ export default { // create share & close menu const share = new Share(shareDefaults) + share.newPassword = share.password const component = await new Promise(resolve => { this.$emit('add:share', share, resolve) }) @@ -838,7 +840,7 @@ export default { */ onPasswordSubmit() { if (this.hasUnsavedPassword) { - this.share.password = this.share.newPassword.trim() + this.share.newPassword = this.share.newPassword.trim() this.queueUpdate('password') } }, @@ -853,7 +855,7 @@ export default { */ onPasswordProtectedByTalkChange() { if (this.hasUnsavedPassword) { - this.share.password = this.share.newPassword.trim() + this.share.newPassword = this.share.newPassword.trim() } this.queueUpdate('sendPasswordByTalk', 'password') diff --git a/apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue b/apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue index 041841201d0..102eea63cb6 100644 --- a/apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue +++ b/apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue @@ -36,7 +36,7 @@ import ShareDetails from '../mixins/ShareDetails.js' import NcActions from '@nextcloud/vue/components/NcActions' import NcActionButton from '@nextcloud/vue/components/NcActionButton' import IconEyeOutline from 'vue-material-design-icons/EyeOutline.vue' -import IconPencil from 'vue-material-design-icons/Pencil.vue' +import IconPencil from 'vue-material-design-icons/PencilOutline.vue' import IconFileUpload from 'vue-material-design-icons/FileUpload.vue' import IconTune from 'vue-material-design-icons/Tune.vue' diff --git a/apps/files_sharing/src/files_actions/sharingStatusAction.ts b/apps/files_sharing/src/files_actions/sharingStatusAction.ts index 75fe7d54096..2dfd8467c5b 100644 --- a/apps/files_sharing/src/files_actions/sharingStatusAction.ts +++ b/apps/files_sharing/src/files_actions/sharingStatusAction.ts @@ -8,8 +8,8 @@ import { translate as t } from '@nextcloud/l10n' import { ShareType } from '@nextcloud/sharing' import { isPublicShare } from '@nextcloud/sharing/public' -import AccountGroupSvg from '@mdi/svg/svg/account-group.svg?raw' -import AccountPlusSvg from '@mdi/svg/svg/account-plus.svg?raw' +import AccountGroupSvg from '@mdi/svg/svg/account-group-outline.svg?raw' +import AccountPlusSvg from '@mdi/svg/svg/account-plus-outline.svg?raw' import LinkSvg from '@mdi/svg/svg/link.svg?raw' import CircleSvg from '../../../../core/img/apps/circles.svg?raw' diff --git a/apps/files_sharing/src/files_newMenu/newFileRequest.ts b/apps/files_sharing/src/files_newMenu/newFileRequest.ts index f7c5cc4057a..1d58e3552a2 100644 --- a/apps/files_sharing/src/files_newMenu/newFileRequest.ts +++ b/apps/files_sharing/src/files_newMenu/newFileRequest.ts @@ -7,7 +7,7 @@ import type { Entry, Folder, Node } from '@nextcloud/files' import { defineAsyncComponent } from 'vue' import { spawnDialog } from '@nextcloud/dialogs' import { translate as t } from '@nextcloud/l10n' -import FileUploadSvg from '@mdi/svg/svg/file-upload.svg?raw' +import FileUploadSvg from '@mdi/svg/svg/file-upload-outline.svg?raw' import Config from '../services/ConfigService' import { isPublicShare } from '@nextcloud/sharing/public' diff --git a/apps/files_sharing/src/files_views/shares.ts b/apps/files_sharing/src/files_views/shares.ts index 297fd4796fd..fd5e908638c 100644 --- a/apps/files_sharing/src/files_views/shares.ts +++ b/apps/files_sharing/src/files_views/shares.ts @@ -6,11 +6,11 @@ import { translate as t } from '@nextcloud/l10n' import { View, getNavigation } from '@nextcloud/files' import { ShareType } from '@nextcloud/sharing' import AccountClockSvg from '@mdi/svg/svg/account-clock.svg?raw' -import AccountGroupSvg from '@mdi/svg/svg/account-group.svg?raw' -import AccountPlusSvg from '@mdi/svg/svg/account-plus.svg?raw' +import AccountGroupSvg from '@mdi/svg/svg/account-group-outline.svg?raw' +import AccountPlusSvg from '@mdi/svg/svg/account-plus-outline.svg?raw' import AccountSvg from '@mdi/svg/svg/account.svg?raw' import DeleteSvg from '@mdi/svg/svg/delete.svg?raw' -import FileUploadSvg from '@mdi/svg/svg/file-upload.svg?raw' +import FileUploadSvg from '@mdi/svg/svg/file-upload-outline.svg?raw' import LinkSvg from '@mdi/svg/svg/link.svg?raw' import { getContents, isFileRequest } from '../services/SharingService' diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index c5bad91314e..a461da56d85 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -165,12 +165,12 @@ export default { isPasswordProtected: { get() { return this.config.enforcePasswordForPublicLink - || !!this.share.password + || this.share.password !== '' + || this.share.newPassword !== undefined }, async set(enabled) { if (enabled) { - this.share.password = await GeneratePassword(true) - this.$set(this.share, 'newPassword', this.share.password) + this.$set(this.share, 'newPassword', await GeneratePassword(true)) } else { this.share.password = '' this.$delete(this.share, 'newPassword') @@ -272,7 +272,7 @@ export default { this.loading = true this.open = false await this.deleteShare(this.share.id) - console.debug('Share deleted', this.share.id) + logger.debug('Share deleted', { shareId: this.share.id }) const message = this.share.itemType === 'file' ? t('files_sharing', 'File "{path}" has been unshared', { path: this.share.path }) : t('files_sharing', 'Folder "{path}" has been unshared', { path: this.share.path }) @@ -303,7 +303,12 @@ export default { const properties = {} // force value to string because that is what our // share api controller accepts - propertyNames.forEach(name => { + for (const name of propertyNames) { + if (name === 'password') { + properties[name] = this.share.newPassword ?? this.share.password + continue + } + if (this.share[name] === null || this.share[name] === undefined) { properties[name] = '' } else if ((typeof this.share[name]) === 'object') { @@ -311,7 +316,7 @@ export default { } else { properties[name] = this.share[name].toString() } - }) + } return this.updateQueue.add(async () => { this.saving = true @@ -319,8 +324,9 @@ export default { try { const updatedShare = await this.updateShare(this.share.id, properties) - if (propertyNames.indexOf('password') >= 0) { + if (propertyNames.includes('password')) { // reset password state after sync + this.share.password = this.share.newPassword ?? '' this.$delete(this.share, 'newPassword') // updates password expiration time after sync @@ -328,14 +334,18 @@ export default { } // clear any previous errors - this.$delete(this.errors, propertyNames[0]) + for (const property of propertyNames) { + this.$delete(this.errors, property) + } showSuccess(this.updateSuccessMessage(propertyNames)) } catch (error) { logger.error('Could not update share', { error, share: this.share, propertyNames }) const { message } = error if (message && message !== '') { - this.onSyncError(propertyNames[0], message) + for (const property of propertyNames) { + this.onSyncError(property, message) + } showError(message) } else { // We do not have information what happened, but we should still inform the user @@ -384,6 +394,13 @@ export default { * @param {string} message the error message */ onSyncError(property, message) { + if (property === 'password' && this.share.newPassword) { + if (this.share.newPassword === this.share.password) { + this.share.password = '' + } + this.$delete(this.share, 'newPassword') + } + // re-open menu if closed this.open = true switch (property) { diff --git a/apps/files_sharing/src/utils/GeneratePassword.ts b/apps/files_sharing/src/utils/GeneratePassword.ts index 2f3f65c51d8..82efaaa69d4 100644 --- a/apps/files_sharing/src/utils/GeneratePassword.ts +++ b/apps/files_sharing/src/utils/GeneratePassword.ts @@ -38,10 +38,29 @@ export default async function(verbose = false): Promise<string> { const array = new Uint8Array(10) const ratio = passwordSet.length / 255 - self.crypto.getRandomValues(array) + getRandomValues(array) let password = '' for (let i = 0; i < array.length; i++) { password += passwordSet.charAt(array[i] * ratio) } return password } + +/** + * Fills the given array with cryptographically secure random values. + * If the crypto API is not available, it falls back to less secure Math.random(). + * Crypto API is available in modern browsers on secure contexts (HTTPS). + * + * @param {Uint8Array} array - The array to fill with random values. + */ +function getRandomValues(array: Uint8Array): void { + if (self?.crypto?.getRandomValues) { + self.crypto.getRandomValues(array) + return + } + + let len = array.length + while (len--) { + array[len] = Math.floor(Math.random() * 256) + } +} diff --git a/apps/files_sharing/src/views/FilesViewFileDropEmptyContent.vue b/apps/files_sharing/src/views/FilesViewFileDropEmptyContent.vue index 33fec9af028..dac22748d8a 100644 --- a/apps/files_sharing/src/views/FilesViewFileDropEmptyContent.vue +++ b/apps/files_sharing/src/views/FilesViewFileDropEmptyContent.vue @@ -68,7 +68,7 @@ import NcDialog from '@nextcloud/vue/components/NcDialog' import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent' import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper' import NcNoteCard from '@nextcloud/vue/components/NcNoteCard' -import svgCloudUpload from '@mdi/svg/svg/cloud-upload.svg?raw' +import svgCloudUpload from '@mdi/svg/svg/cloud-upload-outline.svg?raw' defineProps<{ foldername: string diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index f1fb78e548b..ee902a24c8a 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -128,7 +128,7 @@ </NcCheckboxRadioSwitch> <NcPasswordField v-if="isPasswordProtected" autocomplete="new-password" - :value="hasUnsavedPassword ? share.newPassword : ''" + :value="share.newPassword ?? ''" :error="passwordError" :helper-text="errorPasswordLabel || passwordHint" :required="isPasswordEnforced && isNewShare" @@ -281,7 +281,7 @@ import NcTextArea from '@nextcloud/vue/components/NcTextArea' import CircleIcon from 'vue-material-design-icons/CircleOutline.vue' import CloseIcon from 'vue-material-design-icons/Close.vue' -import EditIcon from 'vue-material-design-icons/Pencil.vue' +import EditIcon from 'vue-material-design-icons/PencilOutline.vue' import EmailIcon from 'vue-material-design-icons/Email.vue' import LinkIcon from 'vue-material-design-icons/Link.vue' import GroupIcon from 'vue-material-design-icons/AccountGroup.vue' @@ -872,7 +872,6 @@ export default { if (this.isNewShare) { if ((this.config.enableLinkPasswordByDefault || this.isPasswordEnforced) && this.isPublicShare) { this.$set(this.share, 'newPassword', await GeneratePassword(true)) - this.$set(this.share, 'password', this.share.newPassword) this.advancedSectionAccordionExpanded = true } /* Set default expiration dates if configured */ @@ -973,10 +972,7 @@ export default { this.share.note = '' } if (this.isPasswordProtected) { - if (this.hasUnsavedPassword && this.isValidShareAttribute(this.share.newPassword)) { - this.share.password = this.share.newPassword - this.$delete(this.share, 'newPassword') - } else if (this.isPasswordEnforced && this.isNewShare && !this.isValidShareAttribute(this.share.password)) { + if (this.isPasswordEnforced && this.isNewShare && !this.isValidShareAttribute(this.share.password)) { this.passwordError = true } } else { @@ -1000,7 +996,7 @@ export default { incomingShare.expireDate = this.hasExpirationDate ? this.share.expireDate : '' if (this.isPasswordProtected) { - incomingShare.password = this.share.password + incomingShare.password = this.share.newPassword } let share @@ -1032,9 +1028,8 @@ export default { this.$emit('add:share', this.share) } else { // Let's update after creation as some attrs are only available after creation + await this.queueUpdate(...permissionsAndAttributes) this.$emit('update:share', this.share) - emit('update:share', this.share) - this.queueUpdate(...permissionsAndAttributes) } await this.getNode() @@ -1111,10 +1106,6 @@ export default { * "sendPasswordByTalk". */ onPasswordProtectedByTalkChange() { - if (this.hasUnsavedPassword) { - this.share.password = this.share.newPassword.trim() - } - this.queueUpdate('sendPasswordByTalk', 'password') }, isValidShareAttribute(value) { diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue index 82a11dea2e0..e56201f6e06 100644 --- a/apps/files_sharing/src/views/SharingTab.vue +++ b/apps/files_sharing/src/views/SharingTab.vue @@ -164,7 +164,7 @@ import { generateOcsUrl } from '@nextcloud/router' import { CollectionList } from 'nextcloud-vue-collections' import { ShareType } from '@nextcloud/sharing' -import InfoIcon from 'vue-material-design-icons/Information.vue' +import InfoIcon from 'vue-material-design-icons/InformationOutline.vue' import NcPopover from '@nextcloud/vue/components/NcPopover' import axios from '@nextcloud/axios' diff --git a/apps/files_sharing/tests/External/CacheTest.php b/apps/files_sharing/tests/External/CacheTest.php index 60820013f11..39e2057a24c 100644 --- a/apps/files_sharing/tests/External/CacheTest.php +++ b/apps/files_sharing/tests/External/CacheTest.php @@ -54,11 +54,11 @@ class CacheTest extends TestCase { $this->contactsManager = $this->createMock(IManager::class); $this->cloudIdManager = new CloudIdManager( + $this->createMock(ICacheFactory::class), + $this->createMock(IEventDispatcher::class), $this->contactsManager, $this->createMock(IURLGenerator::class), $this->createMock(IUserManager::class), - $this->createMock(ICacheFactory::class), - $this->createMock(IEventDispatcher::class) ); $this->remoteUser = $this->getUniqueID('remoteuser'); diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php index fbe6eb1e85b..14c6afec4d8 100644 --- a/apps/files_sharing/tests/External/ManagerTest.php +++ b/apps/files_sharing/tests/External/ManagerTest.php @@ -90,11 +90,11 @@ class ManagerTest extends TestCase { $this->testMountProvider = new MountProvider(Server::get(IDBConnection::class), function () { return $this->manager; }, new CloudIdManager( + $this->createMock(ICacheFactory::class), + $this->createMock(IEventDispatcher::class), $this->contactsManager, $this->createMock(IURLGenerator::class), $this->userManager, - $this->createMock(ICacheFactory::class), - $this->createMock(IEventDispatcher::class) )); $group1 = $this->createMock(IGroup::class); |