Skip to content

Commit

Permalink
Add ordered and grouped parameters support
Browse files Browse the repository at this point in the history
  • Loading branch information
fdaugan committed Mar 3, 2024
1 parent 0c15d2c commit af4192a
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,49 @@ define(function () {
current.registerIdParentGroupSelect2(configuration, $container, 'service:id:parent-group');
current.registerIdGroupSelect2(configuration, $container, 'service:id:group');
current.registerIdOuSelect2(configuration, $container, 'service:id:ou');
if (current.$super('isNodeMode')($container)){
current.$super('layoutParameters')(configuration, [
{'section': 'server'},
'service:id:ldap:url',
'service:id:ldap:user-dn',
'service:id:ldap:password',
'service:id:ldap:base-dn',

{'section': 'authentication'},
'service:id:ldap:clear-password',
'service:id:ldap:local-id-attribute',
'service:id:ldap:locked-attribute',
'service:id:ldap:referral',
'service:id:ldap:locked-value',
'service:id:uid-pattern',
'service:id:ldap:self-search',
'service:id:ldap:department-attribute',
'service:id:ldap:login-attributes',
'service:id:ldap:uid-attribute',

{'section': 'people'},
'service:id:ldap:people-dn',
'service:id:ldap:people-internal-dn',
'service:id:ldap:quarantine-dn',
'service:id:ldap:people-class',
'service:id:ldap:people-class-create',
'service:id:ldap:people-custom-attributes',

{'section': 'groups'},
'service:id:ldap:groups-dn',
'service:id:ldap:groups-class',
'service:id:ldap:groups-class-create',
'service:id:ldap:groups-member-attribute',

{'section': 'companies'},
'service:id:ldap:companies-dn',
'service:id:ldap:company-pattern',
'service:id:ldap:companies-class',
'service:id:ldap:companies-class-create',
]);
} else {
current.$super('layoutParameters')(configuration, ['service:id:ou', 'service:id:parent-group','service:id:group']);
}
},

/**
Expand Down Expand Up @@ -64,13 +107,16 @@ define(function () {
const parentParameter = $.extend({}, parameter);
parentParameter.description = null;
const $fieldset = previousProvider(parentParameter, container, $input).parent();
$input.attr('readonly', 'readonly');
$input.attr('readonly', 'readonly').removeAttr('required').attr('disabled', 'disabled');
$input.attr('placeholder', current.$messages ['service:id:ldap:group-create'])
$input.closest('.form-group').removeClass('required');

// Create the input corresponding to the last part of the final group name
const $simpleInput = $('<input class="form-control" type="text" id="' + simpleGroupId + '" required autocomplete="off">');
cProviders.standard({
id: simpleGroupId,
mandatory: true
mandatory: true,
layout: 'prepend',
}, $fieldset, $simpleInput);
};
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,26 @@ define({
'service:id:ldap:companies-dn': 'DN des sociétés',
'service:id:ldap:companies-class': 'Classes des sociétés',
'service:id:ldap:companies-class-description': 'Classes LDAP des sociétés à rechercher. Séparées pas des espaces ou virgules.',
'service:id:ldap:companies-class-create': 'Classes des sociétés (creation)',
'service:id:ldap:companies-class-create': 'Classes des sociétés (création)',
'service:id:ldap:companies-class-create-description': 'Classes LDAP des sociétés à créer. Séparées pas des espaces ou virgules. Si vide, la première des classes de recherches est utilisée.',
'service:id:ldap:company-pattern': 'Pattern de capture de l\'identifiant de société dans un DN',
'service:id:ldap:department-attribute': 'Attribut de département',
'service:id:ldap:group-create': 'Nom du groupe (calculé)',
'service:id:ldap:groups-dn': 'DN des groupes',
'service:id:ldap:groups-class': 'Classes des groupes',
'service:id:ldap:groups-class-description':'Classes LDAP des groupes à rechercher. Séparées pas des espaces ou virgules.',
'service:id:ldap:groups-class-create': 'Classes des groupes (creation)',
'service:id:ldap:groups-class-create': 'Classes des groupes (création)',
'service:id:ldap:groups-class-create-description': 'Classes LDAP des groupes à créer. Séparées pas des espaces ou virgules. Si vide, la première des classes de recherches est utilisée.',
'service:id:ldap:groups-member-attribute': 'Attribut des membres',
'service:id:ldap:local-id-attribute': 'Attribut d\'identifiant local',
'service:id:ldap:locked-attribute': 'Attribut de verrouillage',
'service:id:ldap:locked-value': 'Valeur de verrouillage',
'service:id:ldap:login-attributes': 'Attributs de login',
'service:id:ldap:login-attributes-description': 'Attributs LDAP authorisés pour l\'authentification. Utiliser des virgules et des espaces commes séparateurs. Ignoré lorsque `service:id:ldap:self-search` est `false`',
'service:id:ldap:login-attributes-description': 'Attributs LDAP authorisés pour l\'authentification. Utiliser des virgules et des espaces comes séparateurs. Ignoré lorsque `service:id:ldap:self-search` est `false`',
'service:id:ldap:password': 'Mot de passe de connexion',
'service:id:ldap:people-class': 'Classes des personnes',
'service:id:ldap:people-class-description': 'Classes LDAP des personnes à rechercher. Séparées pas des espaces ou virgules.',
'service:id:ldap:people-class-create': 'Classes des personnes (creation)',
'service:id:ldap:people-class-create': 'Classes des personnes (création)',
'service:id:ldap:people-class-create-description': 'Classes LDAP des personnes à créer. Séparées pas des espaces ou virgules. Si vide, la première des classes de recherches est utilisée.',
'service:id:ldap:people-custom-attributes': 'Attributs personnalisés',
'service:id:ldap:people-custom-attributes-description': 'Liste d\'attributs LDAP obligatoires pour les utilisateurs. Séparées pas des espaces ou virgules.',
Expand All @@ -34,8 +35,13 @@ define({
'service:id:ldap:quarantine-dn': 'DN de quarantaine',
'service:id:ldap:referral': 'Mode referral',
'service:id:ldap:referral-description': 'Si renseigné, les instructions données de suivi seront exécutées.',
'service:id:ldap:section-server': 'Serveur',
'service:id:ldap:section-authentication': 'Authentification',
'service:id:ldap:section-people': 'Personnes',
'service:id:ldap:section-groups': 'Groupes',
'service:id:ldap:section-companies': 'Sociétés',
'service:id:ldap:self-search': 'Utilisateurs peuvent rechercher',
'service:id:ldap:self-search-description': 'Lorsque coché, au oment de l\'authentification le DN est récupéré par une recherche en utilisant les secrets de l\'utilisateur. Sinon, le DN est calculé à partir du cache de données et seule une authentification est effectuée.',
'service:id:ldap:self-search-description': 'Lorsque coché, au moment de l\'authentification le DN est récupéré par une recherche en utilisant les secrets de l\'utilisateur. Sinon, le DN est calculé à partir du cache de données et seule une authentification est effectuée.',
'service:id:ldap:uid-attribute': 'Attribut UID',
'service:id:ldap:url': 'URL de connexion',
'service:id:ldap:user-dn': 'Utilisateur de connexion',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ define({
'service:id:ldap:companies-dn': 'Companies DN',
'service:id:ldap:companies-class': 'Companies classes',
'service:id:ldap:companies-class-description': 'LDAP object classes of users for search. Comma or space separated values.',
'service:id:ldap:companies-class-create': 'Companies class (create)',
'service:id:ldap:companies-class-create': 'Companies classes (create)',
'service:id:ldap:companies-class-create-description': 'LDAP object classes of companies for the creation. Comma or space separated values. When empty, use the first of search classes.',
'service:id:ldap:company-pattern': 'Company pattern capture id from DN',
'service:id:ldap:department-attribute': 'Comma or space separated values.',
'service:id:ldap:group-create': 'Group name (computed)',
'service:id:ldap:groups-dn': 'Groups DN',
'service:id:ldap:groups-class': 'Groups classes',
'service:id:ldap:groups-class-description':'LDAP object classes of groups for search. Comma or space separated values.',
'service:id:ldap:groups-class-create': 'Groups class (create)',
'service:id:ldap:groups-class-create': 'Groups classes (create)',
'service:id:ldap:groups-class-create-description': 'LDAP object classes of groups for the creation. Comma or space separated values. When empty, use the first of search classes.',
'service:id:ldap:groups-member-attribute': 'Group member attribute',
'service:id:ldap:local-id-attribute': 'Local ID attribute',
Expand All @@ -25,7 +26,7 @@ define({
'service:id:ldap:password': 'Connection password',
'service:id:ldap:people-class': 'People classes',
'service:id:ldap:people-class-description': 'LDAP object classes of users for search. Comma or space separated values',
'service:id:ldap:people-class-create': 'People class (create)',
'service:id:ldap:people-class-create': 'People classes (create)',
'service:id:ldap:people-class-create-description': 'LDAP object classes of users for the creation. Comma or spaceComma or space separated values. When empty, use the first of search classes.',
'service:id:ldap:people-custom-attributes': 'Custom attributes',
'service:id:ldap:people-custom-attributes-description': 'List of custom user LDAP attribute names. Comma or space separated values',
Expand All @@ -34,8 +35,13 @@ define({
'service:id:ldap:quarantine-dn': 'Quarantine DN',
'service:id:ldap:referral': 'Referral mode',
'service:id:ldap:referral-description': 'When provided, the given referrals instruction are followed.',
'service:id:ldap:section-server': 'Server',
'service:id:ldap:section-authentication': 'Authentication',
'service:id:ldap:section-people': 'People',
'service:id:ldap:section-groups': 'Groups',
'service:id:ldap:section-companies': 'Companies',
'service:id:ldap:self-search': 'Users can search',
'service:id:ldap:self-search-description': 'When checked, at authentication time the DN is retrieved from the LDAP server with a search using the provided user credentials. Otherwise, the DN is computed from the cache database and a single bind is executed.',
'service:id:ldap:self-search-description': 'When checked, at authentication time the DN is retrieved from the LDAP server with a search using the provided user\'s credentials. Otherwise, the DN is computed from the cache database and a single bind is executed.',
'service:id:ldap:uid-attribute': 'UID attribute',
'service:id:ldap:url': 'Connection URL',
'service:id:ldap:user-dn': 'Connection user',
Expand Down

0 comments on commit af4192a

Please sign in to comment.