{% requireAdmin %} {% extends "settings/users/_layout" %} {% set selectedNavItem = 'settings' %} {% import "_includes/forms" as forms %} {% if settings is not defined %} {% set settings = craft.app.systemSettings.getSettings('users') %} {% endif %} {% set allVolumes = craft.app.volumes.getAllVolumes() %} {% set volumeList = [] %} {% for volume in allVolumes %} {% set volumeList = volumeList|merge([{'value': volume.id, 'label': volume.name}]) %} {% endfor %} {% macro assetLocationInput(volumeOptions, volumeId, subpath) %} {% from "_includes/forms" import select, text %}
{{ select({ id: 'photoVolumeId', name: 'photoVolumeId', options: volumeOptions, value: volumeId, }) }}
{{ text({ id: 'photoSubpath', class: 'ltr', name: 'photoSubpath', value: subpath, placeholder: "path/to/subfolder"|t('app') }) }}
{% endmacro %} {% from _self import assetLocationInput %} {% block content %}
{{ csrfInput() }} {% if volumeList %} {{ forms.field({ first: true, label: "User Photo Location"|t('app'), instructions: "Where do you want to store user photos? Note that the subfolder path can contain variables like {username}."|t('app') }, assetLocationInput(volumeList, settings.photoVolumeId, settings.photoSubpath)) }} {% else %} {{ forms.field({ first: true, label: "User Photo Volume"|t('app') }, '

' ~ "No volumes exist yet."|t('app') ~ '

') }} {% endif %} {% if CraftEdition == CraftPro %} {{ forms.checkboxField({ label: "Verify email addresses?"|t('app'), instructions: "Should new email addresses be verified before getting saved to user accounts? (This also affects new user registration.)"|t('app'), name: 'requireEmailVerification', checked: settings.requireEmailVerification, }) }} {{ forms.checkboxField({ label: "Allow public registration?"|t('app'), name: 'allowPublicRegistration', checked: settings.allowPublicRegistration, toggle: 'publicRegistrationSettings' }) }}
{% set groups = [{ label: "None"|t('app'), value: '' }] %} {% for group in craft.app.userGroups.getAllGroups() %} {% set groups = groups|merge([{ label: group.name, value: group.id }]) %} {% endfor %} {{ forms.selectField({ label: "Default User Group"|t('app'), instructions: "Choose a user group that publicly-registered members will be added to by default."|t('app'), name: 'defaultGroup', options: groups, value: settings.defaultGroup }) }}
{% endif %}
{% endblock %}