mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
More things [skip ci]
This commit is contained in:
parent
bb82b0eb79
commit
23cc7be231
@ -13,7 +13,6 @@ namespace FireflyIII\Http\Controllers\Admin;
|
|||||||
use FireflyIII\Http\Controllers\Controller;
|
use FireflyIII\Http\Controllers\Controller;
|
||||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Log;
|
|
||||||
use Preferences;
|
use Preferences;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,7 +39,7 @@ class UserController extends Controller
|
|||||||
// add meta stuff.
|
// add meta stuff.
|
||||||
$users->each(
|
$users->each(
|
||||||
function (User $user) use ($confirmAccount) {
|
function (User $user) use ($confirmAccount) {
|
||||||
// user must be logged in, then continue:
|
// is user activated?
|
||||||
$isConfirmed = Preferences::getForUser($user, 'user_confirmed', false)->data;
|
$isConfirmed = Preferences::getForUser($user, 'user_confirmed', false)->data;
|
||||||
if ($isConfirmed === false && $confirmAccount === true) {
|
if ($isConfirmed === false && $confirmAccount === true) {
|
||||||
$user->activated = false;
|
$user->activated = false;
|
||||||
@ -48,6 +47,17 @@ class UserController extends Controller
|
|||||||
$user->activated = true;
|
$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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -746,4 +746,5 @@ return [
|
|||||||
'administration' => 'Administration',
|
'administration' => 'Administration',
|
||||||
'user_administration' => 'User administration',
|
'user_administration' => 'User administration',
|
||||||
'list_all_users' => 'All users',
|
'list_all_users' => 'All users',
|
||||||
|
'all_users' => 'All users',
|
||||||
];
|
];
|
||||||
|
@ -39,4 +39,11 @@ return [
|
|||||||
'completed' => 'Completed',
|
'completed' => 'Completed',
|
||||||
'iban' => 'IBAN',
|
'iban' => 'IBAN',
|
||||||
'paid_current_period' => 'Paid this period',
|
'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',
|
||||||
];
|
];
|
||||||
|
@ -14,20 +14,40 @@
|
|||||||
<table class="table table-condensed table-sortable">
|
<table class="table table-condensed table-sortable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th colspan="2"> </th>
|
||||||
<th>{{ trans('list.email') }}</th>
|
<th>{{ trans('list.email') }}</th>
|
||||||
<th>{{ trans('list.registered_at') }}</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_activated') }}</th>
|
||||||
<th>{{ trans('list.is_blocked') }}</th>
|
<th>{{ trans('list.is_blocked') }}</th>
|
||||||
|
<th>{{ trans('list.blocked_code') }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for user in users %}
|
{% for user in users %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td>~</td>
|
||||||
|
<td>#{{ user.id }}</td>
|
||||||
<td>{{ user.email }}</td>
|
<td>{{ user.email }}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ user.created_at.formatLocalized(monthAndDayFormat) }}
|
{{ user.created_at.formatLocalized(monthAndDayFormat) }}
|
||||||
{{ user.created_at.format('H:i') }}
|
{{ user.created_at.format('H:i') }}
|
||||||
</td>
|
</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>
|
<td>
|
||||||
{% if user.activated %}
|
{% if user.activated %}
|
||||||
<small class="text-success"><i class="fa fa-fw fa-check"></i></small>
|
<small class="text-success"><i class="fa fa-fw fa-check"></i></small>
|
||||||
@ -37,9 +57,9 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if user.blocked == 1 %}
|
{% 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 %}
|
{% 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 %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
Loading…
Reference in New Issue
Block a user