{% extends "_layouts/cp" %} {% if CraftEdition == CraftPro and currentUser.can('editUsers') %} {% set crumbs = [ { label: "Users"|t, url: url('users') } ] %} {% endif %} {% import "_includes/forms" as forms %} {% includeTranslations "Are you sure you want to delete this photo?" %} {% includejsresource "lib/fileupload/jquery.fileupload.js" %} {% includejsresource "lib/jcrop/jquery.Jcrop.min.js" %} {% includejsresource "js/profile.js" %} {% includecssresource "lib/jcrop/jquery.Jcrop.min.css" %} {% includecssresource "css/profile.css" %} {% set requireEmailVerification = craft.systemSettings.users.requireEmailVerification %} {% set hiddenInputs %} {{ getCsrfInput() }} {% if not isNewAccount -%} {%- endif %} {% endset %} {% hook "cp.users.edit" %} {% block main %}
{{ hiddenInputs }} {% include "_includes/tabs" %}
{% include "users/_accountfields" %} {% if not isNewAccount %} {{ forms.field({ label: "Photo"|t }, include('users/_userphoto', {account: account}, with_context = false)) }} {% endif %}
{% if isNewAccount %} {{ forms.textField({ label: "Email"|t, instructions: (requireEmailVerification and not currentUser.admin ? 'A verification email will be sent automatically.'|t), id: 'email', name: 'email', value: account.email, required: true, errors: account.getErrors('email') }) }} {% if requireEmailVerification and currentUser.admin %} {{ forms.checkboxField({ label: "Send an activation email now?"|t, name: 'sendVerificationEmail', checked: true }) }} {% endif %} {% elseif account.isCurrent() or currentUser.admin or currentUser.can('changeUserEmails') %} {{ forms.textField({ label: "Email"|t, instructions: (requireEmailVerification and not currentUser.admin ? 'New email addresses must be verified before taking effect.'|t), id: 'email', name: 'email', value: account.email, required: true, errors: account.getErrors('email') }) }} {% if account.isCurrent() %} {{ forms.textField({ label: "New Password"|t, id: 'newPassword', name: 'newPassword', type: 'password', errors: account.getErrors('newPassword') }) }} {% endif %} {% if currentUser.admin %} {{ forms.checkboxField({ label: "Require a password reset on next login"|t, name: 'passwordResetRequired', checked: account.passwordResetRequired }) }} {% endif %} {% endif %} {% if craft.isLocalized() %} {% set localeInput %}
{% endset %} {{ forms.field({ id: 'preferredLocale', label: "Preferred Locale"|t }, localeInput) }} {% endif %} {% if account.isCurrent() %} {{ forms.selectField({ label: "Week Start Day"|t, id: 'weekStartDay', name: 'weekStartDay', options: craft.i18n.getLocaleData().getWeekDayNames(), value: account.weekStartDay }) }} {% endif %}
{% if CraftEdition == CraftPro %} {% for tab in account.getFieldLayout().getTabs() %} {% endfor %} {% endif %} {% if CraftEdition >= CraftClient and (currentUser.can('assignUserGroups') or currentUser.can('assignUserPermissions')) %} {% endif %}
{% if not currentUser.can('registerUsers') or CraftEdition != CraftPro %} {% else %} {% endif %}
{% if CraftEdition >= CraftClient and not isNewAccount %}
{{ hiddenInputs }}
{{ "Account Status"|t }}
{{ statusLabel }}
{% if actions|length %}
{% endif %}
{% if account.status == 'locked' and craft.config.cooldownDuration and account.remainingCooldownTime %}
{{ "Cooldown Time Remaining"|t }}

{{ account.remainingCooldownTime.humanDuration() }}

{% endif %}
{{ "Registration Date"|t }}

{{ account.dateCreated.localeDate() }} {{ account.dateCreated.localeTime() }}

{% if account.status != 'pending' %}
{{ "Last Login Date"|t }}

{% if account.lastLoginDate %}{{ account.lastLoginDate.localeDate() }} {{ account.lastLoginDate.localeTime() }}{% else %}{{ "Never"|t }}{% endif %}

{{ "Last Invalid Login Date"|t }}

{% if account.lastInvalidLoginDate %}{{ account.lastInvalidLoginDate.localeDate() }} {{ account.lastInvalidLoginDate.localeTime() }}{% else %}{{ "Never"|t }}{% endif %}

{{ "Last Password Change Date"|t }}

{% if account.lastPasswordChangeDate %}{{ account.lastPasswordChangeDate.localeDate() }} {{ account.lastPasswordChangeDate.localeTime() }}{% else %}{{ "Never"|t }}{% endif %}

{{ "Invalid Login Count"|t }}

{% if account.invalidLoginCount %}{{ account.invalidLoginCount }}{% else %}0{% endif %}

{% endif %}
{# Give plugins a chance to add other panes here #} {% hook "cp.users.edit.right-pane" %}
{% endif %}
{% endblock %} {% includejs %} {% if account.isCurrent() %} var changeSidebarPicture = true; {% else %} var changeSidebarPicture = false; {% endif %} new Craft.ElevatedSessionForm('#userform', [ '#email', '#newPassword', '#admin:not(:checked)', '#user-groups input[type="checkbox"]:not(:checked)', '#permissions input[type="checkbox"]:not(:checked)' ]); {% endincludejs %}