diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index 799facd837..a0948c0f34 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -32,22 +32,23 @@ class PreferencesController extends Controller */ public function index(ARI $repository) { - $accounts = $repository->getAccounts(['Default account', 'Asset account']); - $viewRangePref = Preferences::get('viewRange', '1M'); - $viewRange = $viewRangePref->data; - $frontPageAccounts = Preferences::get('frontPageAccounts', []); - $budgetMax = Preferences::get('budgetMaximum', 1000); - $language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data; - $budgetMaximum = $budgetMax->data; - $customFiscalYear = Preferences::get('customFiscalYear', 0)->data; - $fiscalYearStartStr = Preferences::get('fiscalYearStart', '01-01')->data; - $fiscalYearStart = date('Y') . '-' . $fiscalYearStartStr; + $accounts = $repository->getAccounts(['Default account', 'Asset account']); + $viewRangePref = Preferences::get('viewRange', '1M'); + $viewRange = $viewRangePref->data; + $frontPageAccounts = Preferences::get('frontPageAccounts', []); + $budgetMax = Preferences::get('budgetMaximum', 1000); + $language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data; + $budgetMaximum = $budgetMax->data; + $customFiscalYear = Preferences::get('customFiscalYear', 0)->data; + $fiscalYearStartStr = Preferences::get('fiscalYearStart', '01-01')->data; + $fiscalYearStart = date('Y') . '-' . $fiscalYearStartStr; + $twoFactorAuthEnabled = Preferences::get('twoFactorAuthEnabled', 0)->data; $showIncomplete = env('SHOW_INCOMPLETE_TRANSLATIONS', 'false') == 'true'; return view( 'preferences.index', - compact('budgetMaximum', 'language', 'accounts', 'frontPageAccounts', 'viewRange', 'customFiscalYear', 'fiscalYearStart', 'showIncomplete') + compact('budgetMaximum', 'language', 'accounts', 'frontPageAccounts', 'viewRange', 'customFiscalYear', 'fiscalYearStart', 'twoFactorAuthEnabled', 'showIncomplete') ); } @@ -82,6 +83,10 @@ class PreferencesController extends Controller $fiscalYearStart = date('m-d', strtotime(Input::get('fiscalYearStart'))); Preferences::set('fiscalYearStart', $fiscalYearStart); + // two factor auth + $twoFactorAuthEnabled = (int)Input::get('twoFactorAuthEnabled'); + Preferences::set('twoFactorAuthEnabled', $twoFactorAuthEnabled); + // language: $lang = Input::get('language'); if (in_array($lang, array_keys(Config::get('firefly.languages')))) { diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 2097de254c..74a32e7cc3 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -211,6 +211,9 @@ return [ 'pref_custom_fiscal_year_label' => 'Enabled', 'pref_custom_fiscal_year_help' => 'In countries that use a financial year other than January 1 to December 31, you can switch this on and specify start / end days of the fiscal year', 'pref_fiscal_year_start_label' => 'Fiscal year start date', + 'pref_two_factor_auth' => '2-step verification', + 'pref_two_factor_auth_help' => '2-step verification provides improved security for your Firefly III account. If 2-step verification is enabled, you will need to enter your password in addition to a one-time verification code when logging into Firefly III. Verification codes are obtained from authenticator apps installed on your mobile device. Examples of aps are Authy or Google Authenticator. Therefore, if someone wants to access your account, he will not only need your username and password, but also your mobile device.', + 'pref_enable_two_factor_auth' => 'Enable 2-step verification', 'pref_save_settings' => 'Save settings', // profile: diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.php index 49225e7c12..84365d3e33 100755 --- a/resources/lang/nl_NL/firefly.php +++ b/resources/lang/nl_NL/firefly.php @@ -209,6 +209,9 @@ return [ 'pref_custom_fiscal_year_label' => 'Ingeschakeld', 'pref_custom_fiscal_year_help' => 'Voor in landen die een boekjaar gebruiken anders dan 1 januari tot 31 december', 'pref_fiscal_year_start_label' => 'Start van boekjaar', + 'pref_two_factor_auth' => '2-stapsverificatie', + 'pref_two_factor_auth_help' => 'De 2-stapsverificatie biedt een verbeterde beveiliging van uw Firefly III-account. Schakelt u de 2-stapsverificatie in, dan hebt u uw wachtwoord en een eenmalige verificatiecode nodig om u bij Firefly III aan te melden. De verificatiecodes krijgt u van een app geïnstalleerd op uw mobiele telefoon. Voorbeelden van deze app zijn Authy en Google Authenticator. Mocht iemand toegang tot uw account willen, dan heeft hij naast uw gebruikersnaam en wachtwoord ook uw mobiele telefoon nodig.', + 'pref_enable_two_factor_auth' => '2-stapsverificatie inschakelen', 'pref_save_settings' => 'Instellingen opslaan', // profile: diff --git a/resources/views/preferences/index.twig b/resources/views/preferences/index.twig index 30416d2918..78e48f64c0 100644 --- a/resources/views/preferences/index.twig +++ b/resources/views/preferences/index.twig @@ -137,6 +137,26 @@ + +
{{ 'pref_two_factor_auth_help'|_ }}
+