Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix 2FA check #1125
James Cole4b789979ac19
diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.phpindex 043761a3fd..f4fa02a18b 100644--- a/app/Http/Controllers/Admin/UserController.php+++ b/app/Http/Controllers/Admin/UserController.php@@ -125,7 +125,7 @@ class UserController extends Controller$list = ['twoFactorAuthEnabled', 'twoFactorAuthSecret'];$preferences = Preferences::getArrayForUser($user, $list);$user->isAdmin = $user->hasRole('owner');- $is2faEnabled = true === $preferences['twoFactorAuthEnabled'];+ $is2faEnabled = 1 === $preferences['twoFactorAuthEnabled'];$has2faSecret = null !== $preferences['twoFactorAuthSecret'];$user->has2FA = ($is2faEnabled && $has2faSecret) ? true : false;$user->prefs = $preferences;diff --git a/resources/views/preferences/code.twig b/resources/views/preferences/code.twigindex becd1d4432..84735f09e7 100644--- a/resources/views/preferences/code.twig+++ b/resources/views/preferences/code.twig@@ -5,7 +5,7 @@{% endblock %}{% block content %}- <form method="POST" action="{{ route('preferences.code.store') }}" accept-charset="UTF-8" class="form-horizontal" id="preferences.code">+ <form method="POST" action="{{ route('preferences.code.store') }}" accept-charset="UTF-8" class="form-horizontal" id="preferences_code"><input name="_token" type="hidden" value="{{ csrf_token() }}"><div class="row"><div class="col-lg-6 col-md-6 col-sm-6">@@ -40,7 +40,15 @@</div></div></div>-- <!-- form close --></form>{% endblock %}+{% block scripts %}+<script type="text/javascript">+ $(function () {+ "use strict";++ // Focus first visible form element.+ $("form#preferences_code input:enabled:visible:first").first().select();+ });+</script>+{% endblock %}\ No newline at end of file