diff --git a/plugins/Makefile b/plugins/Makefile
index 34975ac1f..210254294 100644
--- a/plugins/Makefile
+++ b/plugins/Makefile
@@ -1,4 +1,4 @@
-SUBDIRS = ai archive chat desktopnotifications files filesbackendDefault filesbackendSeafile intranet kendox maps mdm meet passwd smime templatesnippets
+SUBDIRS = ai archive chat desktopnotifications files filesbackendDefault filesbackendSeafile google2fa intranet kendox maps mdm meet passwd smime templatesnippets
.PHONY: subdirs $(SUBDIRS)
diff --git a/plugins/google2fa/Makefile b/plugins/google2fa/Makefile
new file mode 100644
index 000000000..dc6e51a5f
--- /dev/null
+++ b/plugins/google2fa/Makefile
@@ -0,0 +1,31 @@
+include ../shared.mk
+
+MSGFMT ?= msgfmt
+
+JSFILES = js/Google2FAPlugin.js \
+ js/data/Configuration.js \
+ js/data/ResponseHandler.js \
+ js/settings/Category.js \
+ js/settings/GeneralSettingsWidget.js
+
+COPYFILES = manifest.xml config.php \
+ $(wildcard resources/css/*.css) \
+ $(shell find resources/icons/ -type f \( -name '*.png' -o -name '*.gif' -o -name '*.jpg' \) ) \
+ $(shell find php/ -type f \! -name '.*' -not -path '*/tests/*' -not -path '*/examples/*' -not -path '*/vendor/bin/*' -not -path '*/.github/*' -not -iname '*.py' -not -iname 'naturalselection')
+
+CSSDEPLOY = $(DESTDIR)/resources/css/
+
+COPYFILESDEST = $(addprefix $(DESTDIR)/, $(COPYFILES))
+
+all: $(COPYFILESDEST) $(JSDEPLOY)/google2fa.js $(CSSDEPLOY)/google2fa.css
+
+$(JSDEPLOY)/google2fa.js: $(JSFILES)
+ mkdir -p $(DESTDIR)/js
+ cat $(JSFILES) > $(@:.js=-debug.js)
+ $(JSCOMPILER) $(@:.js=-debug.js) --output $@ \
+ --source-map "url='$(shell basename $@.map)'" \
+ $(JSOPTIONS)
+
+$(CSSDEPLOY)/google2fa.css: $(CSSFILES)
+ mkdir -p $(CSSDEPLOY)
+ cat $(CSSFILES) > $(CSSDEPLOY)/google2fa.css
diff --git a/plugins/google2fa/README.md b/plugins/google2fa/README.md
new file mode 100644
index 000000000..475b47d15
--- /dev/null
+++ b/plugins/google2fa/README.md
@@ -0,0 +1,26 @@
+# grommunio Google 2FA Plugin
+
+This plugin will integrate two-factor authorization with an external OTP provider (Google Authenticator App) in grommunio-web.
+
+# Configuration
+
+The plugin configuration can be found in the **'config.php'** file.
+
+```const PLUGIN_GOOGLE2FA_ENABLE = true;```
+
+* Enable/Disable plugin
+* Default for new users, this doesn't mean the activation of two-factor authentication!
+
+```const PLUGIN_GOOGLE2FA_ALWAYS_ENABLED = false;```
+
+* Enable plugin when plugin is loading, the user can't disable the plugin.
+
+```const PLUGIN_GOOGLE2FA_ACTIVATE = false;```
+
+* Activate / deactivate 2FA
+* Default for new users.
+
+```const PLUGIN_GOOGLE2FA_ALWAYS_ACTIVATED = false;```
+
+* Activate 2FA when plugin is loading.
+
diff --git a/plugins/google2fa/config.php b/plugins/google2fa/config.php
new file mode 100644
index 000000000..bf0f833fc
--- /dev/null
+++ b/plugins/google2fa/config.php
@@ -0,0 +1,27 @@
+" +
+ _('After activation you need next to your password an one-time code to log in.') + "
" + "
" +
+ _('To generate an one-time code, you have to configure a second device, usually a smartphone.') + "
"
+ }, {
+ xtype: "button",
+ text: _('Configuration'),
+ handler: this.openConfigurationDialog,
+ scope: this,
+ width: 250
+ }, {
+ xtype: "displayfield",
+ hideLabel: true,
+ value: "
+ */ + function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void + { + @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); + } +} diff --git a/plugins/google2fa/resources/css/google2fa.css b/plugins/google2fa/resources/css/google2fa.css new file mode 100644 index 000000000..a11719c32 --- /dev/null +++ b/plugins/google2fa/resources/css/google2fa.css @@ -0,0 +1,8 @@ +.icon_google2fa_category { + background-image: url(../icons/google2fa_icon_category.png) !important; +} + +.x-btn .x-btn-large .icon_google2fa_category { + background-image: url(../icons/google2fa_icon_category_large.png) !important; +} + diff --git a/plugins/google2fa/resources/icons/google2fa_icon_category.png b/plugins/google2fa/resources/icons/google2fa_icon_category.png new file mode 100644 index 000000000..671c36599 Binary files /dev/null and b/plugins/google2fa/resources/icons/google2fa_icon_category.png differ diff --git a/plugins/google2fa/resources/icons/google2fa_icon_category_large.png b/plugins/google2fa/resources/icons/google2fa_icon_category_large.png new file mode 100644 index 000000000..de33e64bc Binary files /dev/null and b/plugins/google2fa/resources/icons/google2fa_icon_category_large.png differ diff --git a/server/language/de_DE.UTF-8/LC_MESSAGES/grommunio_web.po b/server/language/de_DE.UTF-8/LC_MESSAGES/grommunio_web.po index e3ce2bbe8..3377e55e1 100644 --- a/server/language/de_DE.UTF-8/LC_MESSAGES/grommunio_web.po +++ b/server/language/de_DE.UTF-8/LC_MESSAGES/grommunio_web.po @@ -8136,3 +8136,94 @@ msgstr "Ungültiges UTF-8-Zeichen, möglicherweise falsch enkodiert" #, php-format msgid "Some problem encountered when encoding/decoding JSON data: - %s" msgstr "Bei der En-/Dekodierung von JSON-Daten ist ein Problem aufgetreten: - %s" + +# google2fa plugin +msgid "Google2FA Plugin" +msgstr "Google2FA Plugin" + +msgid "Two-factor authentication" +msgstr "Zwei-Faktor Authentifizierung" + +msgid "Configure two-factor authentication" +msgstr "Konfiguriere Zwei-Faktor Authentifizierung" + +msgid "The two-factor authentication provides an additional protection for the WebApp." +msgstr "Die Zwei-Faktor Authentifizierung liefert einen zusätzlichen Schutz ihrer WebApp." + +msgid "After activation you need next to your password an one-time code to log in." +msgstr "Nach der Aktivierung benötigen sie neben ihrem Passwort ebenfalls einen Einmalcode um sich einzuloggen." + +msgid "To generate an one-time code, you have to configure a second device, usually a smartphone." +msgstr "Um einen Einmalcode zu generieren, konfigurieren sie bitte ein Zweitgerät, normalerweise ein Smartphone." + +msgid "Configuration" +msgstr "Konfiguration" + +msgid "Activate or deactivate the two-factor authentication." +msgstr "Aktivieren oder Deaktivieren der Zwei-Faktor Authentifizierung." + +msgid "Current status" +msgstr "Aktueller Status" + +msgid "Activate / Deactivate" +msgstr "Aktivieren / Deaktivieren" + +msgid "You can completely reset the configuration." +msgstr "Sie können die Konfiguration vollständidg zurücksetzen." + +msgid "This deletes the secret key and deactivates the two-factor authentication." +msgstr "Dies entfernt den geheimen Schlüssel und deaktiviert die Zwei-Faktor Authentifizierung." + +msgid "If fundamental changes in the configuration were made, for example the encryption type, this step might be useful." +msgstr "Falls sie grundlegende Änderungen an der Konfiguration durchgeführt haben, ist dieser Schritt nützlich." + +msgid "Activated" +msgstr "Aktiviert" + +msgid "Deactivated" +msgstr "Deaktiviert" + +msgid "Do you really want to reset the configuration?" +msgstr "Soll die Konfiguration wirklich zurückgesetzt werden?" + +msgid "The configuration has been reset." +msgstr "Doe Konfiguration wurde zurückgesetzt." + +msgid "Please install an authentication App on second device:" +msgstr "Bitte installieren sie eine Authentifizierungs App auf einem Zweitgerät:" + +msgid "Google Authenticator (Android, iOS, BlackBerry), Authenticator (Windows Phone)" +msgstr "Google Authenticator (Android, iOS, BlackBerry), Authenticator (Windows Phone)" + +msgid "Open and configure the authentication app by scanning the QR code below." +msgstr "Öffnen sie die Authentifizierungs App und scannen sie den QR-Code." + +msgid "Alternatively, you can manually create an account with the following information." +msgstr "Alternativ können sie manuell einen Account mit folgenden Informationen anlegen." + +msgid "Application" +msgstr "Anwendung" + +msgid "Afterwards test the function with a generated code to ensure that the configurations are correct." +msgstr "Anschließend testen sie bitte die Funktion der generierten Codes um sicherzustellen dass die Konfiguration korrekt ist." + +msgid "Key" +msgstr "Schlüssel" + +msgid "Test generated code" +msgstr "Testen generierter Codes" + +msgid "Please enter code" +msgstr "Bitte geben sie den Code ein" + +msgid "Valid code, you can use the two-factor authentication." +msgstr "Gültiger Code, sie können nun die Zwei-Faktor Authentifizierung verwenden." + +msgid "Invalid code, please check code." +msgstr "Ungültiger Code, bitte prüfen sie den eingegebenen Code." + +msgid "You can use a code only one-time." +msgstr "Sie können einen Code nur einmalig verwenden." + +msgid "Please make sure that time from of server and second device are correct." +msgstr "Bitte stellen sie sicher, dass die Zeit auf dem Server und ihrem Zweitgerät korrekt sind." diff --git a/server/language/en_GB.UTF-8/LC_MESSAGES/grommunio_web.po b/server/language/en_GB.UTF-8/LC_MESSAGES/grommunio_web.po index 1e4bdf783..bb55ba6c3 100644 --- a/server/language/en_GB.UTF-8/LC_MESSAGES/grommunio_web.po +++ b/server/language/en_GB.UTF-8/LC_MESSAGES/grommunio_web.po @@ -8133,3 +8133,94 @@ msgstr "Malformed UTF-8 characters, possibly incorrectly encoded" #, php-format msgid "Some problem encountered when encoding/decoding JSON data: - %s" msgstr "Some problem encountered when encoding/decoding JSON data: - %s" + +# google2fa plugin +msgid "Google2FA Plugin" +msgstr "Google2FA Plugin" + +msgid "Two-factor authentication" +msgstr "Two-factor authentication" + +msgid "Configure two-factor authentication" +msgstr "Configure two-factor authentication" + +msgid "The two-factor authentication provides an additional protection for the WebApp." +msgstr "The two-factor authentication provides an additional protection for the WebApp." + +msgid "After activation you need next to your password an one-time code to log in." +msgstr "After activation you need next to your password an one-time code to log in." + +msgid "To generate an one-time code, you have to configure a second device, usually a smartphone." +msgstr "To generate an one-time code, you have to configure a second device, usually a smartphone." + +msgid "Configuration" +msgstr "Configuration" + +msgid "Activate or deactivate the two-factor authentication." +msgstr "Activate or deactivate the two-factor authentication." + +msgid "Current status" +msgstr "Current status" + +msgid "Activate / Deactivate" +msgstr "Activate / Deactivate" + +msgid "You can completely reset the configuration." +msgstr "You can completely reset the configuration." + +msgid "This deletes the secret key and deactivates the two-factor authentication." +msgstr "This deletes the secret key and deactivates the two-factor authentication." + +msgid "If fundamental changes in the configuration were made, for example the encryption type, this step might be useful." +msgstr "If fundamental changes in the configuration were made, for example the encryption type, this step might be useful." + +msgid "Activated" +msgstr "Activated" + +msgid "Deactivated" +msgstr "Deactivated" + +msgid "Do you really want to reset the configuration?" +msgstr "Do you really want to reset the configuration?" + +msgid "The configuration has been reset." +msgstr "The configuration has been reset." + +msgid "Please install an authentication App on second device:" +msgstr "Please install an authentication App on second device:" + +msgid "Google Authenticator (Android, iOS, BlackBerry), Authenticator (Windows Phone)" +msgstr "Google Authenticator (Android, iOS, BlackBerry), Authenticator (Windows Phone)" + +msgid "Open and configure the authentication app by scanning the QR code below." +msgstr "Open and configure the authentication app by scanning the QR code below." + +msgid "Alternatively, you can manually create an account with the following information." +msgstr "Alternatively, you can manually create an account with the following information." + +msgid "Application" +msgstr "Application" + +msgid "Afterwards test the function with a generated code to ensure that the configurations are correct." +msgstr "Afterwards test the function with a generated code to ensure that the configurations are correct." + +msgid "Key" +msgstr "Key" + +msgid "Test generated code" +msgstr "Test generated code" + +msgid "Please enter code" +msgstr "Please enter code" + +msgid "Valid code, you can use the two-factor authentication." +msgstr "Valid code, you can use the two-factor authentication." + +msgid "Invalid code, please check code." +msgstr "Invalid code, please check code." + +msgid "You can use a code only one-time." +msgstr "You can use a code only one-time." + +msgid "Please make sure that time from of server and second device are correct." +msgstr "Please make sure that time from of server and second device are correct." diff --git a/server/language/en_US.UTF-8/LC_MESSAGES/grommunio_web.po b/server/language/en_US.UTF-8/LC_MESSAGES/grommunio_web.po index 74c31e297..f0afc702b 100644 --- a/server/language/en_US.UTF-8/LC_MESSAGES/grommunio_web.po +++ b/server/language/en_US.UTF-8/LC_MESSAGES/grommunio_web.po @@ -8132,3 +8132,94 @@ msgstr "Malformed UTF-8 characters, possibly incorrectly encoded" #, php-format msgid "Some problem encountered when encoding/decoding JSON data: - %s" msgstr "Some problem encountered when encoding/decoding JSON data: - %s" + +# google2fa plugin +msgid "Google2FA Plugin" +msgstr "Google2FA Plugin" + +msgid "Two-factor authentication" +msgstr "Two-factor authentication" + +msgid "Configure two-factor authentication" +msgstr "Configure two-factor authentication" + +msgid "The two-factor authentication provides an additional protection for the WebApp." +msgstr "The two-factor authentication provides an additional protection for the WebApp." + +msgid "After activation you need next to your password an one-time code to log in." +msgstr "After activation you need next to your password an one-time code to log in." + +msgid "To generate an one-time code, you have to configure a second device, usually a smartphone." +msgstr "To generate an one-time code, you have to configure a second device, usually a smartphone." + +msgid "Configuration" +msgstr "Configuration" + +msgid "Activate or deactivate the two-factor authentication." +msgstr "Activate or deactivate the two-factor authentication." + +msgid "Current status" +msgstr "Current status" + +msgid "Activate / Deactivate" +msgstr "Activate / Deactivate" + +msgid "You can completely reset the configuration." +msgstr "You can completely reset the configuration." + +msgid "This deletes the secret key and deactivates the two-factor authentication." +msgstr "This deletes the secret key and deactivates the two-factor authentication." + +msgid "If fundamental changes in the configuration were made, for example the encryption type, this step might be useful." +msgstr "If fundamental changes in the configuration were made, for example the encryption type, this step might be useful." + +msgid "Activated" +msgstr "Activated" + +msgid "Deactivated" +msgstr "Deactivated" + +msgid "Do you really want to reset the configuration?" +msgstr "Do you really want to reset the configuration?" + +msgid "The configuration has been reset." +msgstr "The configuration has been reset." + +msgid "Please install an authentication App on second device:" +msgstr "Please install an authentication App on second device:" + +msgid "Google Authenticator (Android, iOS, BlackBerry), Authenticator (Windows Phone)" +msgstr "Google Authenticator (Android, iOS, BlackBerry), Authenticator (Windows Phone)" + +msgid "Open and configure the authentication app by scanning the QR code below." +msgstr "Open and configure the authentication app by scanning the QR code below." + +msgid "Alternatively, you can manually create an account with the following information." +msgstr "Alternatively, you can manually create an account with the following information." + +msgid "Application" +msgstr "Application" + +msgid "Afterwards test the function with a generated code to ensure that the configurations are correct." +msgstr "Afterwards test the function with a generated code to ensure that the configurations are correct." + +msgid "Key" +msgstr "Key" + +msgid "Test generated code" +msgstr "Test generated code" + +msgid "Please enter code" +msgstr "Please enter code" + +msgid "Valid code, you can use the two-factor authentication." +msgstr "Valid code, you can use the two-factor authentication." + +msgid "Invalid code, please check code." +msgstr "Invalid code, please check code." + +msgid "You can use a code only one-time." +msgstr "You can use a code only one-time." + +msgid "Please make sure that time from of server and second device are correct." +msgstr "Please make sure that time from of server and second device are correct."