{% requirePackage 'Users' %} {% requirePermission 'administrateUsers' %} {% extends "users/_edit/layout" %} {% set selectedTab = 'admin' %} {% import "_includes/forms" as forms %} {% if account is not defined %} {% if craft.request.segment(1) == 'myaccount' %} {% set account = user %} {% elseif userId %} {% set account = craft.users.status('*').id(userId).first %} {% endif %} {% if not account %}{% exit 404 %}{% endif %} {% endif %} {% set isNewAccount = (account is not defined or not account.id) %} {% set content %}

{{ "User Groups"|t }}

{% set allGroups = craft.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', disabled: (isNewAccount or (user.admin or account.isCurrent) ? false : true), reverseToggle: true }) }}
{% include "_includes/permissions" with { userOrGroup: (account.admin ? null : account), groupPermissions: craft.userPermissions.getGroupPermissionsByUserId(account.id) } only %}

User Info

{% if account.status == 'locked' and craft.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 %}