{% extends "layouts/app.html" %} {% from "components/breadcrumb.html" import page_header %} {% from "components/button.html" import button %} {% from "components/table.html" import badge %} {% from "components/modal.html" import confirm_modal %} {% block title %}{{ user.email }} - NeoZen Admin{% endblock %} {% block page_header %} {% call page_header( user.email or "User Details", subtitle="User ID: " ~ user.id, breadcrumbs=[{"label": "Users", "href": "/users"}, {"label": user.email or "User"}] ) %}
{% if current_admin and current_admin.is_superadmin %}
{% endif %} {% if user.is_active %} {% else %}
{% endif %}
{% endcall %} {% endblock %} {% block content %}
{% if active_tab == 'profile' %}

Profile Information

Email
{{ user.email or '-' }}
Username
{{ user.username or '-' }}
User ID
{{ user.id }}
Status
{% if user.is_active %} Active {% else %} Inactive {% endif %}
Email Verified
{% if user.is_verified %} Verified {% else %} Unverified {% endif %}
Created
{{ user.created_at.strftime('%B %d, %Y at %H:%M UTC') if user.created_at else '-' }}
Last Updated
{{ user.updated_at.strftime('%B %d, %Y at %H:%M UTC') if user.updated_at else '-' }}

Quick Summary

Active Sessions {{ sessions|length }}
Roles Assigned {{ roles|length }}
MFA Status {{ 'Enabled' if user.totp_enabled else 'Disabled' }}
{% elif active_tab == 'credentials' %}

Password

Manage the user's password authentication.

Password Status
{% if user.hashed_password %} Set {% else %} Not Set {% endif %}
Last Changed
{{ user.password_changed_at.strftime('%B %d, %Y') if user.password_changed_at else 'Never' }}

Multi-Factor Authentication

TOTP-based two-factor authentication.

TOTP Status
{% if user.totp_enabled %} Enabled {% else %} Disabled {% endif %}
{% if user.totp_confirmed_at %}
Confirmed At
{{ user.totp_confirmed_at.strftime('%B %d, %Y') }}
{% endif %}
{% if user.totp_enabled %}
{% endif %}
{% elif active_tab == 'sessions' %}

Active Sessions

{% if sessions %}
{% endif %}
{% if sessions %}
{% for session in sessions %} {% endfor %}
Session IP Address Created Expires Actions
{{ session.token_hash[:16] }}...
{{ session.user_agent or 'Unknown device' }}
{{ session.ip_address or '-' }} {{ session.created_at.strftime('%b %d, %Y %H:%M') if session.created_at else '-' }} {{ session.expires_at.strftime('%b %d, %Y %H:%M') if session.expires_at else '-' }}
{% else %}

No active sessions

This user has no active sessions.

{% endif %}
{% elif active_tab == 'roles' %}

Assigned Roles

{% if roles %}
{% for role in roles %} {% endfor %}
Role Type Permissions Actions
{{ role.name }}
{% if role.description %}
{{ role.description }}
{% endif %}
{% if role.is_system %} System {% else %} Custom {% endif %}
{% for perm in role.get_permissions_list()[:3] %} {{ perm }} {% endfor %} {% if role.get_permissions_list()|length > 3 %} +{{ role.get_permissions_list()|length - 3 }} more {% endif %}
{% else %}

No roles assigned

Assign a role above to grant permissions.

{% endif %}
{% endif %} {{ confirm_modal( id="deactivate", title="Deactivate User", message="Are you sure you want to deactivate this user? They will no longer be able to sign in.", confirm_text="Deactivate", variant="danger" ) }} {{ confirm_modal( id="delete", title="Delete User", message="Are you sure you want to permanently delete this user? This action cannot be undone.", confirm_text="Delete", variant="danger" ) }} {% endblock %}