diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 6655ef93d..56efe82bb 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -192,6 +192,30 @@ class ConfigController extends Controller ]); } + /** + * Disable 2FA using email. + * + * @Route("/config/otp/email/disable", name="disable_otp_email") + */ + public function disableOtpEmailAction() + { + if (!$this->getParameter('twofactor_auth')) { + return $this->createNotFoundException('two_factor not enabled'); + } + + $user = $this->getUser(); + $user->setEmailTwoFactor(false); + + $this->container->get('fos_user.user_manager')->updateUser($user, true); + + $this->addFlash( + 'notice', + 'flashes.config.notice.otp_disabled' + ); + + return $this->redirect($this->generateUrl('config') . '#set3'); + } + /** * Enable 2FA using email. * @@ -219,6 +243,32 @@ class ConfigController extends Controller return $this->redirect($this->generateUrl('config') . '#set3'); } + /** + * Disable 2FA using OTP app. + * + * @Route("/config/otp/app/disable", name="disable_otp_app") + */ + public function disableOtpAppAction() + { + if (!$this->getParameter('twofactor_auth')) { + return $this->createNotFoundException('two_factor not enabled'); + } + + $user = $this->getUser(); + + $user->setGoogleAuthenticatorSecret(''); + $user->setBackupCodes(null); + + $this->container->get('fos_user.user_manager')->updateUser($user, true); + + $this->addFlash( + 'notice', + 'flashes.config.notice.otp_disabled' + ); + + return $this->redirect($this->generateUrl('config') . '#set3'); + } + /** * Enable 2FA using OTP app, user will need to confirm the generated code from the app. * @@ -248,6 +298,11 @@ class ConfigController extends Controller $this->container->get('fos_user.user_manager')->updateUser($user, true); + $this->addFlash( + 'notice', + 'flashes.config.notice.otp_enabled' + ); + return $this->render('WallabagCoreBundle:Config:otp_app.html.twig', [ 'backupCodes' => $backupCodes, 'qr_code' => $this->get('scheb_two_factor.security.google_authenticator')->getQRContent($user), diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 53b60c729..fc43e9fd2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -613,6 +613,7 @@ flashes: # entries_reset: Entries reset # archived_reset: Archived entries deleted # otp_enabled: Two-factor authentication enabled + # otp_disabled: Two-factor authentication disabled # tagging_rules_imported: Tagging rules imported # tagging_rules_not_imported: Error while importing tagging rules entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index b9694be84..53c960b62 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -613,6 +613,7 @@ flashes: entries_reset: Einträge zurücksetzen archived_reset: Archiverte Einträge zurücksetzen # otp_enabled: Two-factor authentication enabled + # otp_disabled: Two-factor authentication disabled # tagging_rules_imported: Tagging rules imported # tagging_rules_not_imported: Error while importing tagging rules entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index e8b1ea154..c6e3cd42a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -613,6 +613,7 @@ flashes: entries_reset: Entries reset archived_reset: Archived entries deleted otp_enabled: Two-factor authentication enabled + otp_disabled: Two-factor authentication disabled tagging_rules_imported: Tagging rules imported tagging_rules_not_imported: Error while importing tagging rules entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 6fd44f8e3..72e364497 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -613,6 +613,7 @@ flashes: entries_reset: Artículos reiniciados archived_reset: Artículos archivados borrados otp_enabled: Autenticación de dos pasos activada + # otp_disabled: Two-factor authentication disabled tagging_rules_imported: Reglas de etiquetado importadas tagging_rules_not_imported: Un error se ha producico en la importación de las reglas de etiquetado entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 627923b07..8da90018b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -613,6 +613,7 @@ flashes: # entries_reset: Entries reset # archived_reset: Archived entries deleted # otp_enabled: Two-factor authentication enabled + # otp_disabled: Two-factor authentication disabled # tagging_rules_imported: Tagging rules imported # tagging_rules_not_imported: Error while importing tagging rules entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 542dc25cc..d54547819 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -614,6 +614,7 @@ flashes: entries_reset: "Articles supprimés" archived_reset: "Articles archivés supprimés" otp_enabled: "Authentification à double-facteur activée" + otp_disabled: "Authentification à double-facteur désactivée" tagging_rules_imported: Règles bien importées tagging_rules_not_imported: Impossible d'importer les règles entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 5d017a401..99a8dc2db 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -613,6 +613,7 @@ flashes: entries_reset: Reset articoli # archived_reset: Archived entries deleted # otp_enabled: Two-factor authentication enabled + # otp_disabled: Two-factor authentication disabled # tagging_rules_imported: Tagging rules imported # tagging_rules_not_imported: Error while importing tagging rules entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ja.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ja.yml index 9de8c5716..a1eaa5ddd 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ja.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ja.yml @@ -613,6 +613,7 @@ flashes: entries_reset: 記事がリセットされました archived_reset: アーカイブ済みの記事がリセットされました otp_enabled: 2要素認証が有効化されました + # otp_disabled: Two-factor authentication disabled tagging_rules_imported: タグ付けルールがインポートされました tagging_rules_not_imported: タグ付けルールのインポート中にエラーが発生しました entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index e0fb1933c..598243db0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -613,6 +613,7 @@ flashes: entries_reset: Articles levats archived_reset: Articles archivat suprimits otp_enabled: Autentificacion en dos temps activada + # otp_disabled: Two-factor authentication disabled tagging_rules_imported: Règlas d’etiquetatge importadas tagging_rules_not_imported: Error en important las règlas d’etiquetatge entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index dfaf9e892..af8447fe9 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -613,6 +613,7 @@ flashes: entries_reset: Zresetuj wpisy archived_reset: Zarchiwizowane wpisy usunięte # otp_enabled: Two-factor authentication enabled + # otp_disabled: Two-factor authentication disabled # tagging_rules_imported: Tagging rules imported # tagging_rules_not_imported: Error while importing tagging rules entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 8908c0cc8..d993cb059 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -613,6 +613,7 @@ flashes: entries_reset: Artigos reinicializados archived_reset: Artigos arquivados apagados otp_enabled: Autenticação de dois fatores ativada + # otp_disabled: Two-factor authentication disabled tagging_rules_imported: Regras de tags importadas tagging_rules_not_imported: Erro ao importar regras de tags entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index b269578a0..bc8b72e0b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -613,6 +613,7 @@ flashes: # entries_reset: Entries reset # archived_reset: Archived entries deleted # otp_enabled: Two-factor authentication enabled + # otp_disabled: Two-factor authentication disabled # tagging_rules_imported: Tagging rules imported # tagging_rules_not_imported: Error while importing tagging rules entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 648bbc80c..2f7f55e53 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -613,6 +613,7 @@ flashes: entries_reset: "Записи сброшены" # archived_reset: Archived entries deleted # otp_enabled: Two-factor authentication enabled + # otp_disabled: Two-factor authentication disabled # tagging_rules_imported: Tagging rules imported # tagging_rules_not_imported: Error while importing tagging rules entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 4de87adc7..48e1c34ad 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -613,6 +613,7 @@ flashes: entries_reset: รีเซ็ตรายการ archived_reset: การลบเอกสารของรายการ # otp_enabled: Two-factor authentication enabled + # otp_disabled: Two-factor authentication disabled # tagging_rules_imported: Tagging rules imported # tagging_rules_not_imported: Error while importing tagging rules entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 9afa648cd..19029c0b1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -613,6 +613,7 @@ flashes: # entries_reset: Entries reset # archived_reset: Archived entries deleted # otp_enabled: Two-factor authentication enabled + # otp_disabled: Two-factor authentication disabled # tagging_rules_imported: Tagging rules imported # tagging_rules_not_imported: Error while importing tagging rules entry: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.zh.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.zh.yml index a34e38520..f48ce37a8 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.zh.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.zh.yml @@ -613,6 +613,7 @@ flashes: entries_reset: 项目列表已重置 archived_reset: 所有存档项目已删除 otp_enabled: 两步验证已启用 + # otp_disabled: Two-factor authentication disabled tagging_rules_imported: 标签规则已导入 tagging_rules_not_imported: 导入标签规则时发生了错误 entry: diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig index f719bea25..eb395eac4 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig @@ -195,12 +195,12 @@