On Срд, 25 кас 2023, Ales Rozmarin via FreeIPA-users wrote:
Maybe I should add plugin.
here is test.py
from ipaserver.plugins.user import user from ipalib.parameters import Str from ipalib.text import _ from ipaserver.plugins.internal import i18n_messages
user.takes_params += ( Str('host*', cli_name='host', label=_('Test host'), ), )
You named attribute 'testHost' but here you have 'host'. It is all but different attribute name for both IPA and LDAP server.
user.default_attributes.append('host')
and test.js
define([ 'freeipa/phases', 'freeipa/user'], function(phases, user_mod) { // helper function function get_item(array, attr, value) { for (var i=0,l=array.length; i<l; i++) { if (array[i][attr] === value) return array[i]; } return null; } var emp_plugin = {}; // adds 'host' field into user details facet emp_plugin.add_emp_number_pre_op = function() { var facet = get_item(user_mod.entity_spec.facets, '$type', 'details'); var section = get_item(facet.sections, 'name', 'identity'); section.fields.push({ $type: 'multivalued', name: 'host', label: 'Test host' });
return true; }; phases.on('customization', emp_plugin.add_emp_number_pre_op); return emp_plugin; }); _______________________________________________ FreeIPA-users mailing list -- freeipa-users@lists.fedorahosted.org To unsubscribe send an email to freeipa-users-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/freeipa-users@lists.fedorahoste... Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue