扩展LDAP和FreeIPA

我正在使用FreeIPA,并且已经成功扩展了它的属性,但是注意到Python插件中添加到FreeIPA中的validationfunction仅适用于通过命令行input的值。 通过networking用户界面input的值按原样存储,无需validation。

因此,我想知道将下列修改添加到服务器:

  1. 启用FreeIPA Web UI以在存储属性值之前validation属性值。
  2. 创build一个由LDAP使用的新语法types(如血型的语法)。
  3. 将Web UI中的属性文本框更改为下拉列表。

  1. 为了使WebUI能够validation用户input,这是不需要的,因为validation可以通过FreeIPA Python插件中的validationfunction完成(我只需要重启我的服务器以使更改生效)。
  2. 我不需要创build一个新的语法,我希望它作为validation过程的替代品,并且因为它正在工作,所以不是必需的。
  3. 要更改属性字段types,您需要在javascript文件中创build新属性字段时添加“$ type”:

创build一个文本区域:

section.fields.push({ $type:'textarea', name: 'ldap_attribute_name', label: 'some label name' }); 

创build一个下拉菜单:

 section.fields.push({ $type:'entity_select', other_entity:'user', // get the users list other_field:'uid', // get the user IDs and display them in the list name: 'ldap_attribute_name', label: 'some label name' }); 

创build一个单选button:

 section.fields.push({ $type:'radio', options:[ // create the new radio buttons {label:'first button label',value:'first button value'}, {label:'second button label',value:'second button value'} ], name: 'ldap_attribute_name', label: 'some label name' }); 

您可以通过挖掘/usr/share/ipa/ui/js/freeipa/app.js文件来检查更多选项。