{% requirePermission 'administrateUsers' %} {% extends "users/_edit/layout" %} {% import "_includes/forms" as forms %} {% set pageTitle = "Administration"|t %} {% if account is not defined %} {% if blx.request.segment(1) == 'myaccount' %} {% set account = user %} {% elseif userId %} {% set account = blx.users.status('*').id(userId).first %} {% endif %} {% if not account %}{% exit 404 %}{% endif %} {% endif %} {% set content %}

{{ "User Groups"|t }}

{% set allGroups = blx.userGroups.getAllGroups %} {% set userGroups = account.getGroups('id') %} {% if allGroups %} {% else %}

{{ "No user groups exist yet."|t }}

{% endif %}

{{ "Permissions"|t }}

{{ forms.checkbox({ label: '' ~ "Admin"|t ~ '', name: 'admin', checked: account.admin, toggle: 'permissions', reverseToggle: true }) }}
{% include "_includes/permissions" with { userOrGroup: (account.admin ? null : account), groupPermissions: blx.userPermissions.getGroupPermissionsByUserId(account.id) } only %}

User Info

{% if account.status == 'locked' and blx.config.cooldownDuration %} {% endif %} {% if account.status != 'pending' %} {% endif %}
{{ "Account Status"|t }} {% if account.status == 'pending' %}
{{ "Unverified"|t }}  {% elseif account.status == 'locked' %}
{{ "Locked"|t }}  {% elseif account.status == 'suspended' %}
{{ "Suspended"|t }}  {% else %}
{{ "Active"|t }} {% endif %}
{{ "Cooldown Time Remaining"|t }} {{ account.remainingCooldownTime.humanDuration }}
{{ "Registration Date" }} {{ account.dateCreated.nice }}
{{ "Last Login Date"|t }} {% if account.lastLoginDate %}{{ account.lastLoginDate.nice }}{% else %}{{ "Never"|t }}{% endif %}
{{ "Last Invalid Login Date"|t }} {% if account.lastInvalidLoginDate %}{{ account.lastInvalidLoginDate.nice }}{% else %}{{ "Never"|t }}{% endif %}
{{ "Last Password Change Date"|t }} {% if account.lastPasswordChangeDate %}{{ account.lastPasswordChangeDate.nice }}{% else %}{{ "Never"|t }}{% endif %}
{{ "Invalid Login Count"|t }} {% if account.invalidLoginCount %}{{ account.invalidLoginCount }}{% else %}0{% endif %}
{% if not account.isCurrent %}
{% if account.status != 'suspended' %} {% endif %} {% endif %}
{% endset %}