{# # --------------------------------------------------------------------- # # 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 . # # --------------------------------------------------------------------- #} {% import 'components/form/fields_macros.html.twig' as fields %}
{{ include('components/form/header.html.twig') }} {% set rand = random() %} {% set params = params ?? [] %} {% set field_options = {} %}
{% block form_fields %} {{ fields.textField('name', item.fields['name'], __('Name')) }} {{ fields.dropdownArrayField('grants', null, { 'password': __("Password"), 'client_credentials': __("Client credentials"), 'authorization_code': __("Authorization code"), }, __('Grants'), { multiple: true, values: item.fields['grants']|default(['authorization_code']), }) }} {% if not item.isNewItem() %} {{ fields.textField('identifier', item.fields['identifier'], __('Client ID'), { readonly: true, is_copyable: true, }) }} {% endif %} {% if allowed_scopes is defined and allowed_scopes is not empty %} {{ fields.dropdownArrayField('scopes', null, allowed_scopes, __('Scopes'), { multiple: true, values: item.fields['scopes'], }) }} {% else %} {{ fields.nullField() }} {% endif %} {% if not item.isNewItem() %} {{ fields.passwordField('secret', item.fields['secret'], __('Client Secret'), { is_disclosable: true, readonly: true, }) }} {% endif %} {{ fields.textareaField( 'comment', item.fields['comment'], _n('Comment', 'Comments', get_plural_number()), field_options ) }} {{ fields.smallTitle(__('Authorized redirect URIs'), 'ti ti-forms', __('Only applies to Authorization Code grants')) }} {% set authorized_uri_field %} {% endset %} {{ fields.field('', authorized_uri_field, '', { no_label: true, field_class: 'col-12 d-flex', }) }}
{{ fields.smallTitle(__('IP Restrictions'), 'ti ti-network', __('Comma separated list of individual IPv4/IPv6 addresses or ranges in CIDR notation. An empty list indicates there are no restrictions.')) }} {{ fields.textField('allowed_ips', item.fields['allowed_ips'], null, { no_label: true, field_class: 'col-12 d-flex', }) }} {% endblock %}
{# .row #}
{# .row #}
{# .flex-row #}
{# .card-body #} {{ include('components/form/buttons.html.twig') }}