From 3a652330628982564b8c87259c1cd6f5f68d69f9 Mon Sep 17 00:00:00 2001 From: F Wildermuth Date: Mon, 30 May 2022 08:17:17 +0000 Subject: [PATCH 1/9] Added translation using Weblate (German (de_DE@informal)) --- .../de_DE@informal/email-recovery.po | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 translationfiles/de_DE@informal/email-recovery.po diff --git a/translationfiles/de_DE@informal/email-recovery.po b/translationfiles/de_DE@informal/email-recovery.po new file mode 100644 index 0000000..48f4797 --- /dev/null +++ b/translationfiles/de_DE@informal/email-recovery.po @@ -0,0 +1,41 @@ +# BASE TRANSLATION FILE. +# Copyright (C) 2022 MURENA +# This file is distributed under the same license as the Nextcloud package. +# dev@murena.io +# +msgid "" +msgstr "" +"Project-Id-Version: Nextcloud 3.14159\n" +"Report-Msgid-Bugs-To: translations\\@example.com\n" +"POT-Creation-Date: 2022-05-06 19:52+0530\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: de_DE@informal\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:2 +msgid "Email Recovery" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:3 +msgid "Email Recovery App" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:3 +msgid "Recovery Email" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:7 +msgid "Recovery Email " +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:22 +msgid "Changes saved" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:26 +msgid "ErrorRecoveryEmailSameAsUserEmail" +msgstr "" -- GitLab From 9adf8f74ec95eda22bca2e4cf1592d07b6123dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnau=20V=C3=A0zquez?= Date: Mon, 10 Oct 2022 12:39:56 +0000 Subject: [PATCH 2/9] Added translation using Weblate (Italian) --- translationfiles/it/email-recovery.po | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 translationfiles/it/email-recovery.po diff --git a/translationfiles/it/email-recovery.po b/translationfiles/it/email-recovery.po new file mode 100644 index 0000000..b7c7ad7 --- /dev/null +++ b/translationfiles/it/email-recovery.po @@ -0,0 +1,41 @@ +# BASE TRANSLATION FILE. +# Copyright (C) 2022 MURENA +# This file is distributed under the same license as the Nextcloud package. +# dev@murena.io +# +msgid "" +msgstr "" +"Project-Id-Version: Nextcloud 3.14159\n" +"Report-Msgid-Bugs-To: translations\\@example.com\n" +"POT-Creation-Date: 2022-05-06 19:52+0530\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:2 +msgid "Email Recovery" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:3 +msgid "Email Recovery App" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:3 +msgid "Recovery Email" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:7 +msgid "Recovery Email " +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:22 +msgid "Changes saved" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:26 +msgid "ErrorRecoveryEmailSameAsUserEmail" +msgstr "" -- GitLab From c451bfdac84e2df09e9a76d45e3525ccdf9c8540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnau=20V=C3=A0zquez?= Date: Mon, 10 Oct 2022 12:40:08 +0000 Subject: [PATCH 3/9] Added translation using Weblate (French) --- translationfiles/fr/email-recovery.po | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 translationfiles/fr/email-recovery.po diff --git a/translationfiles/fr/email-recovery.po b/translationfiles/fr/email-recovery.po new file mode 100644 index 0000000..8b63695 --- /dev/null +++ b/translationfiles/fr/email-recovery.po @@ -0,0 +1,41 @@ +# BASE TRANSLATION FILE. +# Copyright (C) 2022 MURENA +# This file is distributed under the same license as the Nextcloud package. +# dev@murena.io +# +msgid "" +msgstr "" +"Project-Id-Version: Nextcloud 3.14159\n" +"Report-Msgid-Bugs-To: translations\\@example.com\n" +"POT-Creation-Date: 2022-05-06 19:52+0530\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:2 +msgid "Email Recovery" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:3 +msgid "Email Recovery App" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:3 +msgid "Recovery Email" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:7 +msgid "Recovery Email " +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:22 +msgid "Changes saved" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:26 +msgid "ErrorRecoveryEmailSameAsUserEmail" +msgstr "" -- GitLab From 7089d466f19e4d705f646b5e0ad4f9f9b3672c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnau=20V=C3=A0zquez?= Date: Mon, 10 Oct 2022 12:40:21 +0000 Subject: [PATCH 4/9] Added translation using Weblate (Spanish) --- translationfiles/es/email-recovery.po | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 translationfiles/es/email-recovery.po diff --git a/translationfiles/es/email-recovery.po b/translationfiles/es/email-recovery.po new file mode 100644 index 0000000..e5498c3 --- /dev/null +++ b/translationfiles/es/email-recovery.po @@ -0,0 +1,41 @@ +# BASE TRANSLATION FILE. +# Copyright (C) 2022 MURENA +# This file is distributed under the same license as the Nextcloud package. +# dev@murena.io +# +msgid "" +msgstr "" +"Project-Id-Version: Nextcloud 3.14159\n" +"Report-Msgid-Bugs-To: translations\\@example.com\n" +"POT-Creation-Date: 2022-05-06 19:52+0530\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:2 +msgid "Email Recovery" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:3 +msgid "Email Recovery App" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:3 +msgid "Recovery Email" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:7 +msgid "Recovery Email " +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:22 +msgid "Changes saved" +msgstr "" + +#: /home/nivesh/Desktop/repos/email-recovery/src/main.html:26 +msgid "ErrorRecoveryEmailSameAsUserEmail" +msgstr "" -- GitLab From d4431349e0c9c805c7ae91ab486485f90e40c254 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 10 Oct 2022 13:58:06 +0000 Subject: [PATCH 5/9] Translated using Weblate (German (de_DE@informal)) Currently translated at 83.3% (5 of 6 strings) Translation: ecloud/Email Recovery Translate-URL: https://i18n.e.foundation/projects/ecloud/email-recovery/de_DE@informal/ --- l10n/de_DE.js | 10 ++++++++++ l10n/de_DE.json | 8 ++++++++ .../de_DE@informal/email-recovery.po | 19 +++++++++++-------- 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 l10n/de_DE.js create mode 100644 l10n/de_DE.json diff --git a/l10n/de_DE.js b/l10n/de_DE.js new file mode 100644 index 0000000..f1195cc --- /dev/null +++ b/l10n/de_DE.js @@ -0,0 +1,10 @@ +OC.L10N.register( + "email-recovery", + { + "Email Recovery" : "E-Mail-Wiederherstellung", + "Email Recovery App" : "E-Mail-Wiederherstellungsapp", + "Recovery Email" : "Wiederherstellungs-E-Mail", + "Recovery Email " : "Wiederherstellungs-E-Mail ", + "Changes saved" : "Änderungen gespeichert" +}, +"nplurals=2; plural=n != 1;"); diff --git a/l10n/de_DE.json b/l10n/de_DE.json new file mode 100644 index 0000000..867c7cb --- /dev/null +++ b/l10n/de_DE.json @@ -0,0 +1,8 @@ +{ "translations": { + "Email Recovery" : "E-Mail-Wiederherstellung", + "Email Recovery App" : "E-Mail-Wiederherstellungsapp", + "Recovery Email" : "Wiederherstellungs-E-Mail", + "Recovery Email " : "Wiederherstellungs-E-Mail ", + "Changes saved" : "Änderungen gespeichert" +},"pluralForm" :"nplurals=2; plural=n != 1;" +} \ No newline at end of file diff --git a/translationfiles/de_DE@informal/email-recovery.po b/translationfiles/de_DE@informal/email-recovery.po index 48f4797..6a539a4 100644 --- a/translationfiles/de_DE@informal/email-recovery.po +++ b/translationfiles/de_DE@informal/email-recovery.po @@ -8,33 +8,36 @@ msgstr "" "Project-Id-Version: Nextcloud 3.14159\n" "Report-Msgid-Bugs-To: translations\\@example.com\n" "POT-Creation-Date: 2022-05-06 19:52+0530\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2022-10-11 14:51+0000\n" +"Last-Translator: Ronak Patel \n" +"Language-Team: German \n" "Language: de_DE@informal\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.11.2\n" #: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:2 msgid "Email Recovery" -msgstr "" +msgstr "E-Mail-Wiederherstellung" #: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:3 msgid "Email Recovery App" -msgstr "" +msgstr "E-Mail-Wiederherstellungsapp" #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:3 msgid "Recovery Email" -msgstr "" +msgstr "Wiederherstellungs-E-Mail" #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:7 msgid "Recovery Email " -msgstr "" +msgstr "Wiederherstellungs-E-Mail " #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:22 msgid "Changes saved" -msgstr "" +msgstr "Änderungen gespeichert" #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:26 msgid "ErrorRecoveryEmailSameAsUserEmail" -- GitLab From 8ab3d7c839fff1885623fec45d221b3b1453078a Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 10 Oct 2022 12:54:57 +0000 Subject: [PATCH 6/9] Translated using Weblate (Italian) Currently translated at 83.3% (5 of 6 strings) Translation: ecloud/Email Recovery Translate-URL: https://i18n.e.foundation/projects/ecloud/email-recovery/it/ --- l10n/it.js | 10 ++++++++++ l10n/it.json | 8 ++++++++ translationfiles/it/email-recovery.po | 19 +++++++++++-------- 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 l10n/it.js create mode 100644 l10n/it.json diff --git a/l10n/it.js b/l10n/it.js new file mode 100644 index 0000000..01faa9d --- /dev/null +++ b/l10n/it.js @@ -0,0 +1,10 @@ +OC.L10N.register( + "email-recovery", + { + "Email Recovery" : "Recupero delle e-mail", + "Email Recovery App" : "App per il recupero delle e-mail", + "Recovery Email" : "Recupero e-mail", + "Recovery Email " : "Recupero e-mail ", + "Changes saved" : "Modifiche salvate" +}, +"nplurals=2; plural=n != 1;"); diff --git a/l10n/it.json b/l10n/it.json new file mode 100644 index 0000000..c195259 --- /dev/null +++ b/l10n/it.json @@ -0,0 +1,8 @@ +{ "translations": { + "Email Recovery" : "Recupero delle e-mail", + "Email Recovery App" : "App per il recupero delle e-mail", + "Recovery Email" : "Recupero e-mail", + "Recovery Email " : "Recupero e-mail ", + "Changes saved" : "Modifiche salvate" +},"pluralForm" :"nplurals=2; plural=n != 1;" +} \ No newline at end of file diff --git a/translationfiles/it/email-recovery.po b/translationfiles/it/email-recovery.po index b7c7ad7..ccb48fb 100644 --- a/translationfiles/it/email-recovery.po +++ b/translationfiles/it/email-recovery.po @@ -8,33 +8,36 @@ msgstr "" "Project-Id-Version: Nextcloud 3.14159\n" "Report-Msgid-Bugs-To: translations\\@example.com\n" "POT-Creation-Date: 2022-05-06 19:52+0530\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2022-10-11 14:51+0000\n" +"Last-Translator: Ronak Patel \n" +"Language-Team: Italian \n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.11.2\n" #: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:2 msgid "Email Recovery" -msgstr "" +msgstr "Recupero delle e-mail" #: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:3 msgid "Email Recovery App" -msgstr "" +msgstr "App per il recupero delle e-mail" #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:3 msgid "Recovery Email" -msgstr "" +msgstr "Recupero e-mail" #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:7 msgid "Recovery Email " -msgstr "" +msgstr "Recupero e-mail " #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:22 msgid "Changes saved" -msgstr "" +msgstr "Modifiche salvate" #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:26 msgid "ErrorRecoveryEmailSameAsUserEmail" -- GitLab From 0566e35e25f85cf80eda3ec87a816cfb7abb001b Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 10 Oct 2022 12:53:16 +0000 Subject: [PATCH 7/9] Translated using Weblate (French) Currently translated at 83.3% (5 of 6 strings) Translation: ecloud/Email Recovery Translate-URL: https://i18n.e.foundation/projects/ecloud/email-recovery/fr/ --- l10n/fr.js | 10 ++++++++++ l10n/fr.json | 8 ++++++++ translationfiles/fr/email-recovery.po | 19 +++++++++++-------- 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 l10n/fr.js create mode 100644 l10n/fr.json diff --git a/l10n/fr.js b/l10n/fr.js new file mode 100644 index 0000000..1061055 --- /dev/null +++ b/l10n/fr.js @@ -0,0 +1,10 @@ +OC.L10N.register( + "email-recovery", + { + "Email Recovery" : "Récupération des e-mails", + "Email Recovery App" : "Application de récupération des e-mails", + "Recovery Email" : "Courriel de récupération", + "Recovery Email " : "Courriel de récupération ", + "Changes saved" : "Changements enregistrés" +}, +"nplurals=2; plural=n > 1;"); diff --git a/l10n/fr.json b/l10n/fr.json new file mode 100644 index 0000000..dcdb982 --- /dev/null +++ b/l10n/fr.json @@ -0,0 +1,8 @@ +{ "translations": { + "Email Recovery" : "Récupération des e-mails", + "Email Recovery App" : "Application de récupération des e-mails", + "Recovery Email" : "Courriel de récupération", + "Recovery Email " : "Courriel de récupération ", + "Changes saved" : "Changements enregistrés" +},"pluralForm" :"nplurals=2; plural=n > 1;" +} \ No newline at end of file diff --git a/translationfiles/fr/email-recovery.po b/translationfiles/fr/email-recovery.po index 8b63695..e5506c8 100644 --- a/translationfiles/fr/email-recovery.po +++ b/translationfiles/fr/email-recovery.po @@ -8,33 +8,36 @@ msgstr "" "Project-Id-Version: Nextcloud 3.14159\n" "Report-Msgid-Bugs-To: translations\\@example.com\n" "POT-Creation-Date: 2022-05-06 19:52+0530\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2022-10-11 14:51+0000\n" +"Last-Translator: Ronak Patel \n" +"Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.11.2\n" #: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:2 msgid "Email Recovery" -msgstr "" +msgstr "Récupération des e-mails" #: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:3 msgid "Email Recovery App" -msgstr "" +msgstr "Application de récupération des e-mails" #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:3 msgid "Recovery Email" -msgstr "" +msgstr "Courriel de récupération" #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:7 msgid "Recovery Email " -msgstr "" +msgstr "Courriel de récupération " #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:22 msgid "Changes saved" -msgstr "" +msgstr "Changements enregistrés" #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:26 msgid "ErrorRecoveryEmailSameAsUserEmail" -- GitLab From 99dc9be2326985b28fca082a6bc10f46faedba88 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 10 Oct 2022 12:55:43 +0000 Subject: [PATCH 8/9] Translated using Weblate (Spanish) Currently translated at 83.3% (5 of 6 strings) Translation: ecloud/Email Recovery Translate-URL: https://i18n.e.foundation/projects/ecloud/email-recovery/es/ --- l10n/es.js | 10 ++++++++++ l10n/es.json | 8 ++++++++ translationfiles/es/email-recovery.po | 19 +++++++++++-------- 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 l10n/es.js create mode 100644 l10n/es.json diff --git a/l10n/es.js b/l10n/es.js new file mode 100644 index 0000000..27d58da --- /dev/null +++ b/l10n/es.js @@ -0,0 +1,10 @@ +OC.L10N.register( + "email-recovery", + { + "Email Recovery" : "Recuperación del correo electrónico", + "Email Recovery App" : "Aplicación de recuperación de correo electrónico", + "Recovery Email" : "Correo electrónico de recuperación", + "Recovery Email " : "Correo electrónico de recuperación ", + "Changes saved" : "Cambios guardados" +}, +"nplurals=2; plural=n != 1;"); diff --git a/l10n/es.json b/l10n/es.json new file mode 100644 index 0000000..b32e59a --- /dev/null +++ b/l10n/es.json @@ -0,0 +1,8 @@ +{ "translations": { + "Email Recovery" : "Recuperación del correo electrónico", + "Email Recovery App" : "Aplicación de recuperación de correo electrónico", + "Recovery Email" : "Correo electrónico de recuperación", + "Recovery Email " : "Correo electrónico de recuperación ", + "Changes saved" : "Cambios guardados" +},"pluralForm" :"nplurals=2; plural=n != 1;" +} \ No newline at end of file diff --git a/translationfiles/es/email-recovery.po b/translationfiles/es/email-recovery.po index e5498c3..9c56dfc 100644 --- a/translationfiles/es/email-recovery.po +++ b/translationfiles/es/email-recovery.po @@ -8,33 +8,36 @@ msgstr "" "Project-Id-Version: Nextcloud 3.14159\n" "Report-Msgid-Bugs-To: translations\\@example.com\n" "POT-Creation-Date: 2022-05-06 19:52+0530\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2022-10-11 14:51+0000\n" +"Last-Translator: Ronak Patel \n" +"Language-Team: Spanish \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.11.2\n" #: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:2 msgid "Email Recovery" -msgstr "" +msgstr "Recuperación del correo electrónico" #: /home/nivesh/Desktop/repos/email-recovery/specialAppInfoFakeDummyForL10nScript.php:3 msgid "Email Recovery App" -msgstr "" +msgstr "Aplicación de recuperación de correo electrónico" #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:3 msgid "Recovery Email" -msgstr "" +msgstr "Correo electrónico de recuperación" #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:7 msgid "Recovery Email " -msgstr "" +msgstr "Correo electrónico de recuperación " #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:22 msgid "Changes saved" -msgstr "" +msgstr "Cambios guardados" #: /home/nivesh/Desktop/repos/email-recovery/src/main.html:26 msgid "ErrorRecoveryEmailSameAsUserEmail" -- GitLab From 7afed68e978d271c577dd10a298a324f16e4692f Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Mon, 1 Jul 2024 19:47:57 +0530 Subject: [PATCH 9/9] Moving Ecloud-account code to Email-recovery --- lib/Exception/BlacklistedEmailException.php | 9 + .../RecoveryEmailValidationException.php | 9 + lib/Listeners/UserChangedListener.php | 89 ++++++++++ lib/Service/BlackListService.php | 168 ++++++++++++++++++ lib/Service/LDAPConnectionService.php | 107 +++++++++++ lib/Service/RecoveryEmailService.php | 100 ++++++++++- 6 files changed, 477 insertions(+), 5 deletions(-) create mode 100644 lib/Exception/BlacklistedEmailException.php create mode 100644 lib/Exception/RecoveryEmailValidationException.php create mode 100644 lib/Listeners/UserChangedListener.php create mode 100644 lib/Service/BlackListService.php create mode 100644 lib/Service/LDAPConnectionService.php diff --git a/lib/Exception/BlacklistedEmailException.php b/lib/Exception/BlacklistedEmailException.php new file mode 100644 index 0000000..7138dcb --- /dev/null +++ b/lib/Exception/BlacklistedEmailException.php @@ -0,0 +1,9 @@ +util = $util; + $this->mailboxMapper = $mailboxMapper; + $this->logger = $logger; + $this->blackListService = $blackListService; + } + + public function handle(Event $event): void { + if (!($event instanceof UserChangedEvent)) { + return; + } + + $feature = $event->getFeature(); + $user = $event->getUser(); + $username = $user->getUID(); + $newValue = $event->getValue(); + + if ($feature === self::QUOTA_FEATURE) { + $updatedQuota = $event->getValue(); + $quotaInBytes = (int) $this->util->computerFileSize($updatedQuota); + $backend = $user->getBackend()->getBackendName(); + + $this->updateQuota($username, $backend, $quotaInBytes); + } + + if ($feature === self::RECOVERY_EMAIL_FEATURE) { + $recoveryEmail = $event->getValue(); + $recoveryEmailAttribute = [ + 'recoveryMailAddress' => $recoveryEmail + ]; + + $this->blackListService->updateAttributesInLDAP($username, $recoveryEmailAttribute); + } + + if ($feature === self::ENABLED_FEATURE) { + try { + $this->blackListService->mapActiveAttributesInLDAP($username, $newValue); + } catch (Exception $e) { + $this->logger->logException('Failed to update LDAP attributes for user: ' . $username, ['exception' => $e]); + } + } + } + + private function updateQuota(string $username, string $backend, int $quotaInBytes) { + try { + if ($backend === 'SQL raw') { + $this->mailboxMapper->updateMailboxQuota($username, $quotaInBytes); + } + if ($backend === 'LDAP') { + $quotaAttribute = [ + 'quota' => $quotaInBytes + ]; + $this->blackListService->updateAttributesInLDAP($username, $quotaAttribute); + } + } catch (Exception $e) { + $this->logger->error("Error setting quota for user $username " . $e->getMessage()); + } + } +} diff --git a/lib/Service/BlackListService.php b/lib/Service/BlackListService.php new file mode 100644 index 0000000..97a07e5 --- /dev/null +++ b/lib/Service/BlackListService.php @@ -0,0 +1,168 @@ +logger = $logger; + $this->l10nFactory = $l10nFactory; + $this->LDAPConnectionService = $LDAPConnectionService; + $this->appData = $appData; + $this->appName = $appName; + } + + public function mapActiveAttributesInLDAP(string $username, bool $isEnabled): void + { + $userActiveAttributes = $this->getActiveAttributes($isEnabled); + $this->updateAttributesInLDAP($username, $userActiveAttributes); + } + + private function getActiveAttributes(bool $isEnabled): array + { + return [ + 'active' => $isEnabled ? 'TRUE' : 'FALSE', + 'mailActive' => $isEnabled ? 'TRUE' : 'FALSE', + ]; + } + + public function updateAttributesInLDAP(string $username, array $attributes): void + { + if (!$this->LDAPConnectionService->isLDAPEnabled()) { + return; + } + + $conn = $this->LDAPConnectionService->getLDAPConnection(); + $userDn = $this->LDAPConnectionService->username2dn($username); + + if ($userDn === false) { + throw new Exception('Could not find DN for username: ' . $username); + } + + if (!ldap_modify($conn, $userDn, $attributes)) { + throw new Exception('Could not modify user ' . $username . ' entry at LDAP server. Attributes: ' . print_r($attributes, true)); + } + + $this->LDAPConnectionService->closeLDAPConnection($conn); + } + /** + * Check if an email domain is blacklisted against a JSON list of disposable email domains. + * + * @param string $email The email address to check. + * @return bool True if the email domain is blacklisted, false otherwise. + */ + public function isBlacklistedEmail(string $email): bool + { + if (!$this->ensureDocumentsFolder()) { + return false; + } + $blacklistedDomains = $this->getBlacklistedDomainData(); + if (empty($blacklistedDomains)) { + return false; + } + $emailParts = explode('@', $email); + $emailDomain = strtolower(end($emailParts)); + return in_array($emailDomain, $blacklistedDomains); + } + /** + * Update the blacklisted domains data by fetching it from a URL and saving it locally. + * + * @return void + */ + public function updateBlacklistedDomains(): void + { + $blacklisted_domain_url = self::BLACKLISTED_DOMAINS_URL; + $json_data = file_get_contents($blacklisted_domain_url); + $this->setBlacklistedDomainsData($json_data); + } + /** + * Store blacklisted domain data in a file within AppData. + * + * @param string $data The data to be stored in the file. + * @return void + */ + private function setBlacklistedDomainsData(string $data): void + { + $file = $this->getBlacklistedDomainsFile(); + $file->putContent($data); + } + /** + * Retrieve the blacklisted domain file path + * + * @return ISimpleFile + */ + private function getBlacklistedDomainsFile(): ISimpleFile + { + try { + $currentFolder = $this->appData->getFolder('/'); + } catch (NotFoundException $e) { + $currentFolder = $this->appData->newFolder('/'); + } + $filename = self::BLACKLISTED_DOMAINS_FILE_NAME; + if ($currentFolder->fileExists($filename)) { + return $currentFolder->getFile($filename); + } + return $currentFolder->newFile($filename); + } + /** + * Retrieve the blacklisted domain data. + * + * @return array The array of blacklisted domains. + */ + public function getBlacklistedDomainData(): array + { + $document = self::BLACKLISTED_DOMAINS_FILE_NAME; + $file = $this->getBlacklistedDomainsFile(); + try { + $blacklistedDomainsInJson = $file->getContent(); + if (empty($blacklistedDomainsInJson)) { + return []; + } + return json_decode($blacklistedDomainsInJson, true, 512, JSON_THROW_ON_ERROR); + } catch (NotFoundException $e) { + $this->logger->warning('Blacklisted domains file ' . $document . ' not found!'); + return []; + } catch (\Throwable $e) { + $this->logger->warning('Error decoding blacklisted domains file ' . $document . ': ' . $e->getMessage()); + return []; + } + } + + /** + * Ensure the specified folder exists within AppData. + * + * @return bool + */ + private function ensureDocumentsFolder(): bool + { + try { + $this->appData->getFolder('/'); + } catch (NotFoundException $e) { + $this->logger->error($this->appName . ' AppData folder not found!'); + return false; + } catch (\RuntimeException $e) { + $this->logger->error($this->appName . ' AppData folder not found! Runtime Error: ' . $e->getMessage()); + return false; + } + return true; + } +} diff --git a/lib/Service/LDAPConnectionService.php b/lib/Service/LDAPConnectionService.php new file mode 100644 index 0000000..58c3be6 --- /dev/null +++ b/lib/Service/LDAPConnectionService.php @@ -0,0 +1,107 @@ +userManager = $userManager; + $this->getConfigurationFromBackend(); + $ldapConfigPrefixes = $ldapBackendHelper->getServerConfigurationPrefixes(true); + $prefix = array_shift($ldapConfigPrefixes); + $this->ldapConfig = new Configuration($prefix); + $this->config = $config; + } + + + private function getConfigurationFromBackend() { + // We don't actually need user id to get access from backend + $uid = ''; + $backends = $this->userManager->getBackends(); + foreach ($backends as $backend) { + if ($backend->getBackendName() === 'LDAP') { + $this->access = $backend->getLDAPAccess($uid); + $connection = $this->access->getConnection(); + $configuration = $connection->getConfiguration(); + + if ($configuration['ldap_configuration_active']) { + $this->ldapEnabled = true; + $this->configuration = $configuration; + break; + } + } + } + } + + public function isUserOnLDAPBackend($user) { + $backend = $user->getBackend(); + return $backend->getBackendName() === 'LDAP'; + } + + public function isLDAPEnabled(): bool { + return $this->ldapEnabled; + } + + public function username2dn(string $username) { + return $this->access->username2dn($username); + } + public function getLDAPConnection() { + if (!$this->ldapEnabled) { + throw new Exception('LDAP backend is not enabled'); + } + + $adminDn = $this->configuration['ldap_dn']; + $adminPassword = $this->configuration['ldap_agent_password']; + $host = $this->configuration['ldap_host']; + $port = intval($this->configuration['ldap_port']); + + $conn = ldap_connect($host, $port); + ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3); + ldap_bind($conn, $adminDn, $adminPassword); + + if (!$conn) { + throw new Exception('Could not connect to LDAP server!'); + } + return $conn; + } + + public function closeLDAPConnection($conn): void { + ldap_close($conn); + } + + public function getLDAPAccess() { + if (!$this->access) { + throw new Exception('Access not defined!'); + } + return $this->access; + } + + public function getLDAPBaseUsers(): array { + $bases = $this->ldapConfig->ldapBaseUsers; + if (empty($bases)) { + $bases = $this->ldapConfig->ldapBase; + } + return $bases; + } + public function getDisplayNameAttribute(): string { + return $this->ldapConfig->ldapUserDisplayName; + } + public function getLdapQuota() { + return $this->config->getSystemValue('default_quota', '1024'); + } +} diff --git a/lib/Service/RecoveryEmailService.php b/lib/Service/RecoveryEmailService.php index dcdcf84..3b5f13a 100644 --- a/lib/Service/RecoveryEmailService.php +++ b/lib/Service/RecoveryEmailService.php @@ -10,7 +10,10 @@ use OCP\IConfig; use OCP\IUserManager; use OCA\EmailRecovery\Exception\InvalidRecoveryEmailException; use OCA\EmailRecovery\Exception\SameRecoveryEmailAsEmailException; -use OCA\EcloudAccounts\Service\LDAPConnectionService; +use OCA\EmailRecovery\Service\LDAPConnectionService; +use OCA\EmailRecovery\Service\BlackListService; +use OCA\EmailRecovery\Exception\BlacklistedEmailException; +use OCA\EmailRecovery\Exception\RecoveryEmailValidationException; class RecoveryEmailService { @@ -18,21 +21,34 @@ class RecoveryEmailService private $config; private $appName; private $userManager; + private $blackListService; + private $logger; - public function __construct(string $appName, ILogger $logger, IConfig $config, LDAPConnectionService $LDAPConnectionService, IUserManager $userManager) + public function __construct(string $appName, ILogger $logger, IConfig $config, LDAPConnectionService $LDAPConnectionService, IUserManager $userManager, BlackListService $blackListService) { $this->logger = $logger; $this->config = $config; $this->appName = $appName; $this->LDAPConnectionService = $LDAPConnectionService; $this->userManager = $userManager; + $this->blackListService = $blackListService; } - public function getRecoveryEmail(string $username) : string { return $this->config->getUserValue($username, $this->appName, 'recovery-email', ''); } - + public function setRecoveryEmail(string $uid, string $recoveryEmail): void { + $this->config->setUserValue($uid, $this->appName, 'recovery-email', $recoveryEmail); + } + public function setUnverifiedRecoveryEmail(string $uid, string $recoveryEmail): void { + $this->config->setUserValue($uid, $this->appName, 'unverified-recovery-email', $recoveryEmail); + } + public function getMainDomain() : string { + return $this->config->getSystemValue('main_domain', ''); + } + public function getLegacyDomain() : string { + return $this->config->getSystemValue('legacy_domain', ''); + } public function validateRecoveryEmail(string $username, string $recoveryEmail) : bool { $user = $this->userManager->get($username); @@ -70,5 +86,79 @@ class RecoveryEmailService throw new Exception('Could not modify user entry'); } $this->LDAPConnectionService->closeLDAPConnection($conn); - } + }/** + * Validates the recovery email address. + * + * @param string $recoveryEmail The recovery email address to be validated. + * @throws Exception If the recovery email address has an incorrect format, is already taken, or if the domain is disallowed. + * @return void + */ + public function validateRecoveryEmailAddress(string $recoveryEmail): void { + if (!$this->isValidEmailFormat($recoveryEmail)) { + throw new RecoveryEmailValidationException('Recovery email address has an incorrect format.'); + } + if ($this->checkRecoveryEmailAvailable($recoveryEmail)) { + throw new RecoveryEmailValidationException('Recovery email address is already taken.'); + } + if ($this->isRecoveryEmailDomainDisallowed($recoveryEmail)) { + throw new RecoveryEmailValidationException('You cannot set an email address with a Murena domain as recovery email address.'); + } + if ($this->blackListService->isBlacklistedEmail($recoveryEmail)) { + throw new BlacklistedEmailException('The domain of this email address is blacklisted. Please provide another recovery address.'); + } + } + /** + * Check if a recovery email address is available (not already taken by another user). + * + * @param string $recoveryEmail The recovery email address to check. + * + * @return bool True if the recovery email address is available, false otherwise. + */ + public function checkRecoveryEmailAvailable(string $recoveryEmail): bool { + $recoveryEmail = strtolower($recoveryEmail); + $users = $this->config->getUsersForUserValue('email-recovery', 'recovery-email', $recoveryEmail); + if(count($users)) { + return true; + } + $users = $this->config->getUsersForUserValue('email-recovery', 'unverified-recovery-email', $recoveryEmail); + if(count($users)) { + return true; + } + return false; + } + + /** + * Check if a recovery email address domain is restricted for some domains + * + * @param string $recoveryEmail The recovery email address to check. + * + * @return bool True if the recovery email address is disallowed, false otherwise. + */ + public function isRecoveryEmailDomainDisallowed(string $recoveryEmail): bool { + + $recoveryEmail = strtolower($recoveryEmail); + + $emailParts = explode('@', $recoveryEmail); + $domain = $emailParts[1] ?? ''; + + $legacyDomain = $this->getLegacyDomain(); + $mainDomain = $this->getMainDomain(); + + $restrictedDomains = [ $legacyDomain, $mainDomain ]; + + return in_array($domain, $restrictedDomains); + } + + /** + * Check if a recovery email address is in valid format + * + * @param string $recoveryEmail The recovery email address to check. + * + * @return bool True if the recovery email address is valid, false otherwise. + */ + public function isValidEmailFormat(string $recoveryEmail): bool { + return filter_var($recoveryEmail, FILTER_VALIDATE_EMAIL) !== false; + } + + } -- GitLab