{% extends 'dashboard/base.twig' %} {% block title %}Administrateur : {{ admin.firstName }} {{ admin.name }}{% endblock %} {% block actions %} Retour à la liste {% endblock %} {% block body %}
{# --- HEADER GÉNÉRAL --- #} {# --- HEADER GÉNÉRAL : DESIGN ADMINISTRATEUR PRINCIPAL --- #}
{# Avatar stylisé #}
{{ admin.firstName|first|upper }}{{ admin.name|first|upper }}
{# Badge Administrateur Principal #} {% if 'ROLE_CLIENT_MAIN' in admin.roles %}
Administrateur Principal
{% endif %}

{{ admin.firstName }} {{ admin.name }}

{{ admin.email }}
System ID: #{{ admin.id }}
{# --- MODULE DE STATUT INTÉGRÉ --- #} {% if not admin.actif %}
Compte non activé
Activer
{% else %}
Accès en ligne
Désactiver
{% endif %}
{# --- COLONNE GAUCHE : FORMULAIRE IDENTITÉ (SANS LE TOGGLE ACTIF) --- #}
{{ form_start(form) }}
{{ admin.firstName|first|upper }}{{ admin.name|first|upper }}

Identité

Données personnelles

{{ form_widget(form.firstName, { 'attr': {'class': 'w-full px-4 py-3 bg-slate-50 dark:bg-slate-900 border-none rounded-xl focus:ring-2 focus:ring-indigo-500 transition-all text-sm font-medium dark:text-white'} }) }}
{{ form_widget(form.name, { 'attr': {'class': 'w-full px-4 py-3 bg-slate-50 dark:bg-slate-900 border-none rounded-xl focus:ring-2 focus:ring-indigo-500 transition-all text-sm font-medium dark:text-white'} }) }}

{{ form_widget(form.username, { 'attr': {'class': 'w-full px-4 py-3 bg-slate-50 dark:bg-slate-900 border-none rounded-xl focus:ring-2 focus:ring-amber-500 transition-all text-sm font-mono dark:text-white'} }) }}
{{ form_widget(form.email, { 'attr': {'class': 'w-full px-4 py-3 bg-slate-50 dark:bg-slate-900 border-none rounded-xl focus:ring-2 focus:ring-amber-500 transition-all text-sm dark:text-white'} }) }}
{{ form_end(form) }}
{# --- COLONNE DROITE : DROITS & HISTORIQUE --- #}
{# --- CARTE SÉCURITÉ & MOT DE PASSE --- #}

Sécurité et Mot de passe

Envoyer un lien de réinitialisation
{{ form_start(passwordForm) }}
{{ form_widget(passwordForm.password.first, { 'attr': {'class': 'w-full px-4 py-3 bg-slate-50 dark:bg-slate-900 border-none rounded-xl focus:ring-2 focus:ring-indigo-500 transition-all text-sm dark:text-white'} }) }}
{{ form_widget(passwordForm.password.second, { 'attr': {'class': 'w-full px-4 py-3 bg-slate-50 dark:bg-slate-900 border-none rounded-xl focus:ring-2 focus:ring-indigo-500 transition-all text-sm dark:text-white'} }) }}
{{ form_end(passwordForm) }}
{# HABILITATIONS #} {% if 'ROLE_CLIENT_MAIN' not in admin.roles %}

Habilitations Opérationnelles

{% set availableRoles = [ {'role': 'ROLE_ADMIN_EDIT', 'label': 'Gestion des Administrateurs', 'icon': 'M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z'}, {'role': 'ROLE_ADMIN_PRODUCT', 'label': 'Catalogue Produits', 'icon': 'M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4'}, {'role': 'ROLE_ADMIN_CONTRAT', 'label': 'Gestion Contrats', 'icon': 'M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'} ] %} {% for item in availableRoles %}
{{ item.label }} {{ item.role }}
{% endfor %}
{% else %}

Habilitation Totale Active

Le rang Client Principal accorde nativement toutes les permissions système.

{% endif %} {# PRIVILÈGE DE STRUCTURE (ROOT) #} {% if is_granted('ROLE_ROOT') %}

Privilège de Structure

{% endif %}
{# --- SECTIONS JOURNAUX (LOGS) --- #}
{# --- SECTION : JOURNAL D'AUDIT DU COMPTE --- #}
{# HEADER DU JOURNAL #}

Journal d'Audit Personnel

Historique des actions effectuées par cet utilisateur

{{ auditLogs.getTotalItemCount }} ÉVÈNEMENTS
{% if is_granted('ROLE_ROOT') %} {% endif %} {% for log in auditLogs %} {# 1. DATE #} {# 2. UA (ADMIN & APPAREIL) #} {# 3. TYPE D'ACTION #} {# 4. INTÉGRITÉ #} {# 5. DÉTAILS #} {# 6. ACTIONS ROOT #} {% if is_granted('ROLE_ROOT') %} {% endif %} {% else %} {% endfor %}
Horodatage Appareil / Source Action Intégrité DétailsActions
{{ log.actionAt|date('d/m/Y') }}
{{ log.actionAt|date('H:i:s') }}
{% if log.userAgent %} {% set ua = log.userAgent|lower %}
{% if 'firefox' in ua %} {% elseif 'chrome' in ua %} {% else %} {% endif %} {{ log.userAgent }}
{% else %} Source inconnue {% endif %}
{% set typeMapping = { 'CREATE': { 'label': 'CRÉATION', 'style': 'bg-emerald-500/10 text-emerald-600 border-emerald-500/20' }, 'DELETE': { 'label': 'SUPPRESSION', 'style': 'bg-rose-500/10 text-rose-600 border-rose-500/20' }, 'UPDATE': { 'label': 'MODIFICATION', 'style': 'bg-blue-500/10 text-blue-600 border-blue-500/20' }, 'AUTH': { 'label': 'CONNEXION', 'style': 'bg-amber-500/10 text-amber-600 border-amber-500/20' }, 'VIEW': { 'label': 'CONSULTATION', 'style': 'bg-sky-500/10 text-sky-600 border-sky-500/20' }, 'SECURITY_ALERT': { 'label': 'ALERTE SÉCURITÉ', 'style': 'bg-orange-500/10 text-orange-600 border-orange-500/20' }, 'SECURITY_CRITICAL': { 'label': 'CRITIQUE', 'style': 'bg-red-600 text-white border-red-700 animate-pulse font-black' } } %} {% set config = typeMapping[log.type] ?? { 'label': log.type, 'style': 'bg-slate-500/10 text-slate-500 border-slate-500/20' } %} {{ config.label }} {% if log.hashCode == log.generateSignature %}
Valide
{% else %}
Altéré
{% endif %}
{{ log.message }}
{{ log.path|default('/') }}
Aucun enregistrement d'audit pour ce compte.
{# PAGINATION #} {% if auditLogs.getTotalItemCount > 0 %}
Page {{ auditLogs.getCurrentPageNumber }} — {{ auditLogs|length }} logs affichés
{% endif %}
{# CONNEXIONS #}

Dernières Connexions

{% for login in loginRegisters %} {% else %} {% endfor %}
Date & Heure IP
{{ login.loginAt|date('d/m/Y H:i') }} {{ login.ip }}
Aucune connexion enregistrée.
{% if loginRegisters.getTotalItemCount > 0 %}
{{ knp_pagination_render(loginRegisters) }}
{% endif %}
{% endblock %}