Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
More things [skip ci]
James Cole23cc7be23189
diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.phpindex 69bc9a174e..ad404e3e9f 100644--- a/app/Http/Controllers/Admin/UserController.php+++ b/app/Http/Controllers/Admin/UserController.php@@ -13,7 +13,6 @@ namespace FireflyIII\Http\Controllers\Admin;use FireflyIII\Http\Controllers\Controller;use FireflyIII\Repositories\User\UserRepositoryInterface;use FireflyIII\User;-use Log;use Preferences;/**@@ -40,7 +39,7 @@ class UserController extends Controller// add meta stuff.$users->each(function (User $user) use ($confirmAccount) {- // user must be logged in, then continue:+ // is user activated?$isConfirmed = Preferences::getForUser($user, 'user_confirmed', false)->data;if ($isConfirmed === false && $confirmAccount === true) {$user->activated = false;@@ -48,6 +47,17 @@ class UserController extends Controller$user->activated = true;}+ // is user admin?+ $user->isAdmin = $user->hasRole('owner');++ // user has 2FA enabled?+ $is2faEnabled = Preferences::getForUser($user, 'twoFactorAuthEnabled', false)->data;+ $has2faSecret = !is_null(Preferences::getForUser($user, 'twoFactorAuthSecret'));+ if ($is2faEnabled && $has2faSecret) {+ $user->has2FA = true;+ } else {+ $user->has2FA = false;+ }});diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.phpindex 02d36c3c92..696c89b530 100644--- a/resources/lang/en_US/firefly.php+++ b/resources/lang/en_US/firefly.php@@ -746,4 +746,5 @@ return ['administration' => 'Administration','user_administration' => 'User administration','list_all_users' => 'All users',+ 'all_users' => 'All users',];diff --git a/resources/lang/en_US/list.php b/resources/lang/en_US/list.phpindex 11eb8c8334..9aaccbe322 100644--- a/resources/lang/en_US/list.php+++ b/resources/lang/en_US/list.php@@ -39,4 +39,11 @@ return ['completed' => 'Completed','iban' => 'IBAN','paid_current_period' => 'Paid this period',+ 'email' => 'Email',+ 'registered_at' => 'Registered at',+ 'is_activated' => 'Is activated',+ 'is_blocked' => 'Is blocked',+ 'is_admin' => 'Is admin',+ 'has_two_factor' => 'Has 2FA',+ 'blocked_code' => 'Block code',];diff --git a/resources/views/admin/users/index.twig b/resources/views/admin/users/index.twigindex b41aec2af4..71fe8d4c90 100644--- a/resources/views/admin/users/index.twig+++ b/resources/views/admin/users/index.twig@@ -14,20 +14,40 @@<table class="table table-condensed table-sortable"><thead><tr>+ <th colspan="2"> </th><th>{{ trans('list.email') }}</th><th>{{ trans('list.registered_at') }}</th>+ <th>{{ trans('list.is_admin') }}</th>+ <th>{{ trans('list.has_two_factor') }}</th><th>{{ trans('list.is_activated') }}</th><th>{{ trans('list.is_blocked') }}</th>+ <th>{{ trans('list.blocked_code') }}</th></tr></thead><tbody>{% for user in users %}<tr>+ <td>~</td>+ <td>#{{ user.id }}</td><td>{{ user.email }}</td><td>{{ user.created_at.formatLocalized(monthAndDayFormat) }}{{ user.created_at.format('H:i') }}</td>+ <td>+ {% if user.isAdmin %}+ <small class="text-success"><i class="fa fa-fw fa-check"></i></small>+ {% else %}+ <small class="text-danger"><i class="fa fa-fw fa-times"></i></small>+ {% endif %}+ </td>+ <td>+ {% if user.has2FA %}+ <small class="text-success"><i class="fa fa-fw fa-check"></i></small>+ {% else %}+ <small class="text-danger"><i class="fa fa-fw fa-times"></i></small>+ {% endif %}+ </td><td>{% if user.activated %}<small class="text-success"><i class="fa fa-fw fa-check"></i></small>@@ -37,9 +57,9 @@</td><td>{% if user.blocked == 1 %}- <small class="text-danger"><i class="fa fa-fw fa-user-times" alt="Yes"></i></small>+ <small class="text-danger"><i class="fa fa-fw fa-check" title="{{ 'yes'|_ }}"></i></small>{% else %}- <small class="text-success"><i class="fa fa-fw fa-smile-o" alt="No"></i></small>+ <small class="text-success"><i class="fa fa-fw fa-times" title="{{ 'no'|_ }}"></i></small>{% endif %}</td><td>