{% extends "_layouts/cp" %} {% if CraftEdition == CraftPro and currentUser.can('editUsers') %} {% set crumbs = [ { label: "Users"|t('app'), url: url('users') } ] %} {% endif %} {% import "_includes/forms" as forms %} {% do view.registerTranslations('app', [ "Are you sure you want to delete this photo?", ]) %} {% do view.registerAssetBundle("craft\\web\\assets\\fileupload\\FileUploadAsset") %} {% do view.registerAssetBundle("craft\\web\\assets\\imageeditor\\ImageEditorAsset") %} {% set photoInput %} {% include 'users/_photo' with {account: account} only %} {% endset %} {% set saveUserButtons %}
{% if not currentUser.can('registerUsers') or CraftEdition != CraftPro %} {% else %}
{% endif %}
{% endset %} {% set requireEmailVerification = craft.app.systemSettings.getSettings('users').requireEmailVerification %} {% set hiddenInputs %} {{ csrfInput() }} {% if not isNewAccount -%} {%- endif %} {% endset %} {% hook "cp.users.edit" %} {% block main %}
{{ redirectInput(CraftEdition == CraftPro and currentUser.can('editUsers') ? 'users' : 'dashboard') }} {{ hiddenInputs }} {% include "_includes/tabs" %}
{% include "users/_accountfields" %} {% if isNewAccount %} {{ forms.textField({ label: "Email"|t('app'), instructions: (requireEmailVerification and not currentUser.admin ? 'A verification email will be sent automatically.'|t('app')), 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('app'), name: 'sendVerificationEmail', checked: true }) }} {% endif %} {% elseif account.getIsCurrent() or currentUser.admin or currentUser.can('changeUserEmails') %} {{ forms.textField({ label: "Email"|t('app'), instructions: (requireEmailVerification and not currentUser.admin ? 'New email addresses must be verified before taking effect.'|t('app')), id: 'email', name: 'email', value: account.email, required: true, errors: account.getErrors('email') }) }} {% if account.getIsCurrent() %} {{ forms.textField({ label: "New Password"|t('app'), 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('app'), name: 'passwordResetRequired', checked: account.passwordResetRequired }) }} {% endif %} {% endif %} {% if craft.app.getIsMultiSite() %} {% set languageInput %}
{% endset %} {{ forms.field({ id: 'preferred-language', label: "Preferred Language"|t('app') }, languageInput) }} {% endif %} {% if account.getIsCurrent() %} {{ forms.selectField({ label: "Week Start Day"|t('app'), id: 'weekStartDay', name: 'weekStartDay', options: craft.app.locale.getWeekDayNames(), value: account.getPreference('weekStartDay', craft.app.config.get('defaultWeekStartDay')) }) }} {% endif %} {% if account.admin %} {{ forms.checkboxField({ label: "Show the debug toolbar on the front end"|t('app'), name: 'enableDebugToolbarForSite', id: 'enableDebugToolbarForSite', checked: account.getPreference('enableDebugToolbarForSite') }) }} {{ forms.checkboxField({ label: "Show the debug toolbar on the Control Panel"|t('app'), name: 'enableDebugToolbarForCp', id: 'enableDebugToolbarForCp', checked: account.getPreference('enableDebugToolbarForCp') }) }} {% endif %} {{ saveUserButtons }}
{% if not isNewAccount or CraftEdition == CraftPro %} {% endif %} {% if CraftEdition >= CraftClient and currentUser.can('assignUserPermissions') %} {% endif %}
{% if CraftEdition >= CraftClient and not isNewAccount %}
{{ hiddenInputs }}
{{ "Account Status"|t('app') }}
{{ statusLabel }}
{% if actions|length %}
{% endif %}
{% if account.status == 'locked' and craft.app.config.get('cooldownDuration') %}
{{ "Cooldown Time Remaining"|t('app') }}

{{ account.remainingCooldownTime.humanDuration }}

{% endif %}
{{ "Registration Date"|t('app') }}

{{ account.dateCreated|datetime('short') }}

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

{% if account.lastLoginDate %}{{ account.lastLoginDate|datetime('short') }}{% else %}{{ "Never"|t('app') }}{% endif %}

{{ "Last Invalid Login Date"|t('app') }}

{% if account.lastInvalidLoginDate %}{{ account.lastInvalidLoginDate|datetime('short') }}{% else %}{{ "Never"|t('app') }}{% endif %}

{{ "Last Password Change Date"|t('app') }}

{% if account.lastPasswordChangeDate %}{{ account.lastPasswordChangeDate|datetime('short') }}{% else %}{{ "Never"|t('app') }}{% endif %}

{{ "Invalid Login Count"|t('app') }}

{% 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 %} {% js %} {% if account.getIsCurrent() %} 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)' ]); {% endjs %}