add column '2fa status' for customers and admins
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -52,6 +52,14 @@ class Text
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function type2fa(array $attributes): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'macro' => 'type2fa',
|
||||||
|
'data' => (int)$attributes['data']
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public static function customerfullname(array $attributes): string
|
public static function customerfullname(array $attributes): string
|
||||||
{
|
{
|
||||||
return User::getCorrectFullUserDetails($attributes['fields'], true);
|
return User::getCorrectFullUserDetails($attributes['fields'], true);
|
||||||
|
|||||||
@@ -110,6 +110,12 @@ return [
|
|||||||
'class' => 'text-center',
|
'class' => 'text-center',
|
||||||
'callback' => [Text::class, 'boolean'],
|
'callback' => [Text::class, 'boolean'],
|
||||||
],
|
],
|
||||||
|
'type_2fa' => [
|
||||||
|
'label' => lng('2fa.type_2fa'),
|
||||||
|
'field' => 'type_2fa',
|
||||||
|
'class' => 'text-center',
|
||||||
|
'callback' => [Text::class, 'type2fa'],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'visible_columns' => Listing::getVisibleColumnsForListing('admin_list', [
|
'visible_columns' => Listing::getVisibleColumnsForListing('admin_list', [
|
||||||
'loginname',
|
'loginname',
|
||||||
|
|||||||
@@ -149,6 +149,12 @@ return [
|
|||||||
'class' => 'text-center',
|
'class' => 'text-center',
|
||||||
'callback' => [Text::class, 'boolean'],
|
'callback' => [Text::class, 'boolean'],
|
||||||
],
|
],
|
||||||
|
'c.type_2fa' => [
|
||||||
|
'label' => lng('2fa.type_2fa'),
|
||||||
|
'field' => 'type_2fa',
|
||||||
|
'class' => 'text-center',
|
||||||
|
'callback' => [Text::class, 'type2fa'],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'visible_columns' => Listing::getVisibleColumnsForListing('customer_list', [
|
'visible_columns' => Listing::getVisibleColumnsForListing('customer_list', [
|
||||||
'c.name',
|
'c.name',
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ return [
|
|||||||
'2fa_ga_desc' => 'Das Konto ist eingerichtet, um zeitbasierte Einmalpasswörter via Authenticator-App zu erhalten. Um die gewünschte Authenticator-App einzurichten, scanne bitte den untenstehenden QR-Code. Zum Deaktivieren, klicke auf "2FA deaktivieren"',
|
'2fa_ga_desc' => 'Das Konto ist eingerichtet, um zeitbasierte Einmalpasswörter via Authenticator-App zu erhalten. Um die gewünschte Authenticator-App einzurichten, scanne bitte den untenstehenden QR-Code. Zum Deaktivieren, klicke auf "2FA deaktivieren"',
|
||||||
'2fa_not_activated' => 'Zwei-Faktor Authentifizierung ist nicht aktiviert',
|
'2fa_not_activated' => 'Zwei-Faktor Authentifizierung ist nicht aktiviert',
|
||||||
'2fa_not_activated_for_user' => 'Zwei-Faktor Authentifizierung ist für den aktuellen Benutzer nicht aktiviert',
|
'2fa_not_activated_for_user' => 'Zwei-Faktor Authentifizierung ist für den aktuellen Benutzer nicht aktiviert',
|
||||||
|
'type_2fa' => '2FA Status',
|
||||||
],
|
],
|
||||||
'admin' => [
|
'admin' => [
|
||||||
'overview' => 'Übersicht',
|
'overview' => 'Übersicht',
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ return [
|
|||||||
'2fa_ga_desc' => 'Your account is set up to use time-based one-time passwords via authenticator-app. Please scan the QR code below with your desired authenticator app to generate the codes. To deactivate, click on "Deactivate 2FA"',
|
'2fa_ga_desc' => 'Your account is set up to use time-based one-time passwords via authenticator-app. Please scan the QR code below with your desired authenticator app to generate the codes. To deactivate, click on "Deactivate 2FA"',
|
||||||
'2fa_not_activated' => 'Two-factor authentication is not enabled',
|
'2fa_not_activated' => 'Two-factor authentication is not enabled',
|
||||||
'2fa_not_activated_for_user' => 'Two-factor authentication is not enabled for the current user',
|
'2fa_not_activated_for_user' => 'Two-factor authentication is not enabled for the current user',
|
||||||
|
'type_2fa' => '2FA status',
|
||||||
],
|
],
|
||||||
'admin' => [
|
'admin' => [
|
||||||
'overview' => 'Overview',
|
'overview' => 'Overview',
|
||||||
|
|||||||
@@ -29,6 +29,16 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro type2fa(data) %}
|
||||||
|
{% if (data == 1) %}
|
||||||
|
<i class="fa-solid fa-envelope text-success"></i>
|
||||||
|
{% elseif (data == 2) %}
|
||||||
|
<i class="fa-solid fa-mobile text-success"></i>
|
||||||
|
{% else %}
|
||||||
|
<i class="fa-solid fa-lock-open text-warning"></i>
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro link(data) %}
|
{% macro link(data) %}
|
||||||
{% apply spaceless %}
|
{% apply spaceless %}
|
||||||
<a href="{{ data.href }}" {% if data.class is defined %} class="{{ data.class }}" {% endif %} {% if data.target is defined %} target="{{ data.target }}" {% endif %} {% if data.title is defined %} title="{{ data.title }}" {% endif %}>
|
<a href="{{ data.href }}" {% if data.class is defined %} class="{{ data.class }}" {% endif %} {% if data.target is defined %} target="{{ data.target }}" {% endif %} {% if data.title is defined %} title="{{ data.title }}" {% endif %}>
|
||||||
|
|||||||
@@ -47,6 +47,8 @@
|
|||||||
{{ macros.domainWithSan(td.data.data) }}
|
{{ macros.domainWithSan(td.data.data) }}
|
||||||
{% elseif td.data.macro == 'actions' %}
|
{% elseif td.data.macro == 'actions' %}
|
||||||
{{ macros.actions(td.data.data) }}
|
{{ macros.actions(td.data.data) }}
|
||||||
|
{% elseif td.data.macro == 'type2fa' %}
|
||||||
|
{{ macros.type2fa(td.data.data) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
Table macro '{{ td.data.macro|json_encode }}' is not implemented!
|
Table macro '{{ td.data.macro|json_encode }}' is not implemented!
|
||||||
Unable to handle this data: {{ td.data|json_encode }}
|
Unable to handle this data: {{ td.data|json_encode }}
|
||||||
|
|||||||
Reference in New Issue
Block a user