{% extends 'base.html.twig' %} {% block title %}Edit {{ user.pseudo }} - ServerControl{% endblock %} {% block body %}
Back to users
{{ user.pseudo }} {% if isSelf %} Vous {% endif %}
{{ user.email }}
{{ user.isActive ? 'Active' : 'Inactive' }}
{# ── Onglets ── #}
{# ── Onglet 1 : Rôles & Statut ── #}
{% if isSelf %}
Vous ne pouvez pas modifier vos propres rôles et statut.
{% endif %} {{ form_start(form) }}
{% for child in form.roles %}
{{ form_widget(child, {attr: { class: 'form-check-input', disabled: isSelf ? 'disabled' : false }}) }} {{ form_label(child, null, {label_attr: {class: 'form-check-label'}}) }}
{% endfor %}
{{ form_errors(form.roles) }}
{{ form_widget(form.isActive, {attr: { class: 'form-check-input', role: 'switch', id: 'isActiveSwitch', disabled: isSelf ? 'disabled' : false }}) }}
{% if not isSelf %}
{% endif %} {{ form_end(form) }}
{# ── Onglet 2 : Email ── #}

Modifier l'adresse email du compte. L'utilisateur devra utiliser la nouvelle adresse pour se connecter.

{{ form_start(emailForm) }}
{{ form_label(emailForm.email, null, {label_attr: {class: 'form-label fw-semibold small'}}) }} {{ form_widget(emailForm.email, {attr: {class: 'form-control'}}) }} {{ form_errors(emailForm.email) }}
{{ form_end(emailForm) }}
{# ── Onglet 3 : Mot de passe ── #}

Definir un nouveau mot de passe pour ce compte. {% if isSelf %}L'ancien mot de passe sera remplacé.{% endif %}

{{ form_start(passwordForm) }}
{{ form_label(passwordForm.newPassword.first, null, {label_attr: {class: 'form-label fw-semibold small'}}) }} {{ form_widget(passwordForm.newPassword.first, {attr: {class: 'form-control'}}) }} {{ form_errors(passwordForm.newPassword.first) }}
{{ form_label(passwordForm.newPassword.second, null, {label_attr: {class: 'form-label fw-semibold small'}}) }} {{ form_widget(passwordForm.newPassword.second, {attr: {class: 'form-control'}}) }} {{ form_errors(passwordForm.newPassword.second) }} {{ form_errors(passwordForm.newPassword) }}
{{ form_end(passwordForm) }}
{# /tab-content #}
{# /card-body #} {% if accesses|length > 0 %} {% endif %}
{% if accesses|length > 0 %}
Current access ({{ accesses|length }})
{% for access in accesses %} {% endfor %}
Server IP SSH User
{{ access.server.name }} {{ access.server.ipAddress }} {{ access.sshUser }}
{% endif %} {% set unassignedServers = allServers|filter(s => s.id not in assignedIds) %}
Grant server access {{ unassignedServers|length }} available
{% if unassignedServers|length == 0 %}

Tout les serveurs sont déjà assignés a cet utilisateur.

{% else %}
{% for srv in unassignedServers %}
{{ srv.name }} {{ srv.ipAddress }}
{{ srv.lastStatus }}
{% endfor %}

Aucun serveur ne correspond a votre recheche.

{% endif %}
{% endblock %} {% block javascripts %} {% endblock %}