{# # --------------------------------------------------------------------- # # GLPI - Gestionnaire Libre de Parc Informatique # # http://glpi-project.org # # @copyright 2015-2024 Teclib' and contributors. # @copyright 2003-2014 by the INDEPNET Development Team. # @licence https://www.gnu.org/licenses/gpl-3.0.html # # --------------------------------------------------------------------- # # LICENSE # # This file is part of GLPI. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # --------------------------------------------------------------------- #} {% extends "pages/setup/general/base_form.html.twig" %} {% import 'components/form/fields_macros.html.twig' as fields %} {% set field_options = { 'field_class': 'col-12 col-xxl-6 col-sm-6', 'full_width': true, 'rand': rand|default(random()) } %} {% set inline_field_options = field_options|merge({ 'input_addclass': 'w-auto' }) %} {% block config_fields %} {{ fields.largeTitle(__('Password security policy'), 'ti ti-shield-lock') }} {{ fields.smallTitle(__('Security policy validation')) }} {{ fields.sliderField( 'use_password_security', config['use_password_security'], __('Force passwords to comply with security policy'), inline_field_options ) }} {% if config['use_password_security'] %} {{ fields.smallTitle(__('Security policy configuration')) }} {{ fields.numberField( 'password_min_length', config['password_min_length'], __('Password minimum length'), inline_field_options|merge({'min': 4}) ) }} {{ fields.sliderField( 'password_need_number', config['password_need_number'], __('Password need digit'), inline_field_options ) }} {{ fields.sliderField( 'password_need_letter', config['password_need_letter'], __('Password need lowercase character'), inline_field_options ) }} {{ fields.sliderField( 'password_need_caps', config['password_need_caps'], __('Password need uppercase character'), inline_field_options ) }} {{ fields.sliderField( 'password_need_symbol', config['password_need_symbol'], __('Password need symbol'), inline_field_options ) }} {% endif %} {{ fields.largeTitle(__('Password expiration policy'), 'ti ti-calendar-time') }} {{ fields.dropdownNumberField( 'password_expiration_delay', config['password_expiration_delay'], __('Password expiration delay (in days)'), inline_field_options|merge({ 'min': 15, 'max': 365, 'step': 5, 'toadd': {'-1': __('Never')}, 'width': 'auto' }) ) }} {{ fields.dropdownNumberField( 'password_expiration_notice', config['password_expiration_notice'], __('Password expiration notice time (in days)'), inline_field_options|merge({ 'min': 0, 'max': 30, 'step': 1, 'toadd': {'-1': __('Notification disabled')}, 'width': 'auto' }) ) }} {{ fields.dropdownNumberField( 'password_expiration_lock_delay', config['password_expiration_lock_delay'], __('Delay before account deactivation (in days)'), inline_field_options|merge({ 'min': 0, 'max': 30, 'step': 1, 'toadd': {'-1': __('Do not deactivate')}, 'width': 'auto' }) ) }} {{ fields.dropdownTimestampField( 'password_init_token_delay', config['password_init_token_delay'], __('Validity period of the password initialization token'), inline_field_options|merge({ 'min': constant('DAY_TIMESTAMP'), 'max': constant('MONTH_TIMESTAMP'), 'step': constant('DAY_TIMESTAMP'), 'width': 'auto' }) ) }} {{ fields.dropdownArrayField( 'non_reusable_passwords_count', config['non_reusable_passwords_count'], { '1': __('Last password'), '2': __('Last 2 passwords'), '3': __('Last 3 passwords'), '4': __('Last 4 passwords'), '5': __('Last 5 passwords') }, __('Prevent users from reusing previous passwords'), inline_field_options|merge({ 'width': 'auto' }) ) }} {{ fields.largeTitle(__('Two-factor authentication (2FA)'), 'ti ti-2fa') }} {{ fields.sliderField( '2fa_enforced', config['2fa_enforced'], __('Enforce 2FA'), inline_field_options ) }} {% if config['2fa_enforced'] %} {{ fields.numberField( '2fa_grace_days', config['2fa_grace_days'], __('2FA grace period (in days)'), inline_field_options|merge({ 'min': 0, 'max': 365, }) ) }} {% endif %} {% endblock %}