mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
entity i18n
Updated the user,group,host, hostgroup, netgroup, service, and all policy entities to use the newer framework functions, in order to replaced the old array style definitions which did not support i18n. update a few of the newer framerwork functions to get the lables from the meta data. Fixed the unit tests which were expecting a details facet for users, no longer automatically created
This commit is contained in:
parent
37f48c0019
commit
10f3c0825b
@ -338,7 +338,7 @@ function ipa_details_list_section(spec){
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Deprecated: Used for backward compatibility only.
|
// This is to allow declarative style programming for details
|
||||||
function input(spec){
|
function input(spec){
|
||||||
that.create_field(spec);
|
that.create_field(spec);
|
||||||
return that;
|
return that;
|
||||||
@ -349,7 +349,7 @@ function ipa_details_list_section(spec){
|
|||||||
return that;
|
return that;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Used for backward compatibility only.
|
// shorthand notation used for declarative definitions of details pages
|
||||||
function ipa_stanza(spec) {
|
function ipa_stanza(spec) {
|
||||||
return ipa_details_list_section(spec);
|
return ipa_details_list_section(spec);
|
||||||
}
|
}
|
||||||
|
@ -89,10 +89,14 @@ function ipa_group_add_dialog(spec) {
|
|||||||
|
|
||||||
that.add_dialog_init();
|
that.add_dialog_init();
|
||||||
|
|
||||||
that.add_field(ipa_text_widget({name:'cn', label:'Name', undo: false}));
|
that.add_field(ipa_text_widget({name:'cn', entity_name:'group',
|
||||||
that.add_field(ipa_text_widget({name:'description', label:'Description', undo: false}));
|
undo: false}));
|
||||||
that.add_field(ipa_checkbox_widget({name:'posix', label:'Is this a POSIX group?', undo: false}));
|
that.add_field(ipa_text_widget({name:'description',
|
||||||
that.add_field(ipa_text_widget({name:'gidnumber', label:'GID', undo: false}));
|
entity_name:'group', undo: false}));
|
||||||
|
that.add_field(ipa_checkbox_widget({name:'posix', entity_name:'group',
|
||||||
|
undo: false}));
|
||||||
|
that.add_field(ipa_text_widget({name:'gidnumber', entity_name:'group',
|
||||||
|
undo: false}));
|
||||||
};
|
};
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
@ -105,11 +109,9 @@ function ipa_group_search_facet(spec) {
|
|||||||
var that = ipa_search_facet(spec);
|
var that = ipa_search_facet(spec);
|
||||||
|
|
||||||
that.init = function() {
|
that.init = function() {
|
||||||
|
that.create_column({name:'cn'});
|
||||||
that.create_column({name:'cn', label:'Name'});
|
that.create_column({name:'gidnumber'});
|
||||||
that.create_column({name:'gidnumber', label:'GID'});
|
that.create_column({name:'description'});
|
||||||
that.create_column({name:'description', label:'Description'});
|
|
||||||
|
|
||||||
that.search_facet_init();
|
that.search_facet_init();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -130,20 +132,9 @@ function ipa_group_details_facet(spec) {
|
|||||||
});
|
});
|
||||||
that.add_section(section);
|
that.add_section(section);
|
||||||
|
|
||||||
section.create_field({
|
section.create_field({name: 'cn' });
|
||||||
name: 'cn',
|
section.create_field({name: 'description'});
|
||||||
label: 'Group Name'
|
section.create_field({name: 'gidnumber' });
|
||||||
});
|
|
||||||
|
|
||||||
section.create_field({
|
|
||||||
name: 'description',
|
|
||||||
label: 'Description'
|
|
||||||
});
|
|
||||||
|
|
||||||
section.create_field({
|
|
||||||
name: 'gidnumber',
|
|
||||||
label: 'Group ID'
|
|
||||||
});
|
|
||||||
|
|
||||||
that.details_facet_init();
|
that.details_facet_init();
|
||||||
};
|
};
|
||||||
|
@ -87,7 +87,7 @@ function ipa_host_add_dialog(spec) {
|
|||||||
|
|
||||||
that.add_field(ipa_text_widget({
|
that.add_field(ipa_text_widget({
|
||||||
'name': 'fqdn',
|
'name': 'fqdn',
|
||||||
'label': 'Name',
|
entity_name:'host',
|
||||||
'size': 40,
|
'size': 40,
|
||||||
'undo': false
|
'undo': false
|
||||||
}));
|
}));
|
||||||
@ -104,10 +104,11 @@ function ipa_host_search_facet(spec) {
|
|||||||
|
|
||||||
that.init = function() {
|
that.init = function() {
|
||||||
|
|
||||||
that.create_column({name:'fqdn', label:'Name'});
|
that.create_column({name:'fqdn'});
|
||||||
that.create_column({name:'description', label:'Description'});
|
that.create_column({name:'description'});
|
||||||
that.create_column({name:'enrolled', label:'Enrolled?'});
|
//TODO use the value of this field to set enrollment status
|
||||||
that.create_column({name:'manages', label:'Manages?'});
|
that.create_column({name:'krblastpwdchange', label:'Enrolled?'});
|
||||||
|
that.create_column({name:'nshostlocation'});
|
||||||
|
|
||||||
that.search_facet_init();
|
that.search_facet_init();
|
||||||
};
|
};
|
||||||
@ -129,25 +130,16 @@ function ipa_host_details_facet(spec) {
|
|||||||
});
|
});
|
||||||
that.add_section(section);
|
that.add_section(section);
|
||||||
|
|
||||||
section.create_field({
|
section.create_field({'name': 'fqdn'});
|
||||||
'name': 'fqdn',
|
section.create_field({'name': 'krbprincipalname'});
|
||||||
'label': 'Fully Qualified Domain Name'
|
|
||||||
});
|
|
||||||
|
|
||||||
section.create_field({
|
|
||||||
'name': 'krbprincipalname',
|
|
||||||
'label': 'Kerberos Principal'
|
|
||||||
});
|
|
||||||
|
|
||||||
|
//TODO add this to the host plugin
|
||||||
section.create_field({
|
section.create_field({
|
||||||
'name': 'serverhostname',
|
'name': 'serverhostname',
|
||||||
'label': 'Server Host Name'
|
'label': 'Server Host Name'
|
||||||
});
|
});
|
||||||
|
|
||||||
section.create_field({
|
section.create_field({'name': 'description'});
|
||||||
'name': 'description',
|
|
||||||
'label': 'Description'
|
|
||||||
});
|
|
||||||
|
|
||||||
section = ipa_details_list_section({
|
section = ipa_details_list_section({
|
||||||
'name': 'enrollment',
|
'name': 'enrollment',
|
||||||
@ -155,6 +147,7 @@ function ipa_host_details_facet(spec) {
|
|||||||
});
|
});
|
||||||
that.add_section(section);
|
that.add_section(section);
|
||||||
|
|
||||||
|
//TODO add label to messages
|
||||||
section.add_field(host_provisioning_status_widget({
|
section.add_field(host_provisioning_status_widget({
|
||||||
'name': 'provisioning_status',
|
'name': 'provisioning_status',
|
||||||
'label': 'Status',
|
'label': 'Status',
|
||||||
|
@ -20,23 +20,48 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
|
||||||
|
|
||||||
ipa_entity_set_search_definition('hostgroup', [
|
|
||||||
['cn', 'Name', null],
|
|
||||||
['description', 'Description', null]
|
|
||||||
]);
|
|
||||||
|
|
||||||
ipa_entity_set_add_definition('hostgroup', [
|
IPA.add_entity( function() {
|
||||||
'dialog-add-hostgroup', 'Add New Hostgroup', [
|
var that = ipa_entity({
|
||||||
['cn', 'Name', null],
|
'name': 'hostgroup'
|
||||||
['description', 'Description', null]
|
});
|
||||||
]
|
that.init = function() {
|
||||||
]);
|
var search_facet = ipa_search_facet({
|
||||||
|
name: 'search',
|
||||||
|
label: 'Search',
|
||||||
|
entity_name: that.name
|
||||||
|
});
|
||||||
|
search_facet.create_column({name:'cn'});
|
||||||
|
search_facet.create_column({name:'description'});
|
||||||
|
that.add_facet(search_facet);
|
||||||
|
|
||||||
|
that.add_facet(function() {
|
||||||
|
var that = ipa_details_facet({name:'details',label:'Details'});
|
||||||
|
that.add_section(
|
||||||
|
ipa_stanza({name:'identity', label:'Hostgroup Details'}).
|
||||||
|
input({name:'cn'}).
|
||||||
|
input({name: 'description'}));
|
||||||
|
return that;
|
||||||
|
}());
|
||||||
|
|
||||||
|
|
||||||
|
var dialog = ipa_add_dialog({
|
||||||
|
name: 'add',
|
||||||
|
title: 'Add Hostgroup',
|
||||||
|
entity_name:'hostgroup'
|
||||||
|
});
|
||||||
|
|
||||||
|
that.add_dialog(dialog);
|
||||||
|
dialog.init();
|
||||||
|
dialog.add_field(ipa_text_widget({ name: 'cn',
|
||||||
|
entity_name:'hostgroup'}));
|
||||||
|
dialog.add_field(ipa_text_widget({ name: 'description',
|
||||||
|
entity_name:'hostgroup' }));
|
||||||
|
that.create_association_facets();
|
||||||
|
that.entity_init();
|
||||||
|
}
|
||||||
|
return that;
|
||||||
|
}());
|
||||||
|
|
||||||
|
|
||||||
ipa_entity_set_details_definition('hostgroup', [
|
|
||||||
ipa_stanza({name:'identity', label:'Hostgroup Details'}).
|
|
||||||
input({name:'cn', label:'Name'}).
|
|
||||||
input({name: 'description', label:'Description'})
|
|
||||||
]);
|
|
||||||
|
|
||||||
ipa_entity_set_association_definition('hostgroup', {
|
|
||||||
});
|
|
||||||
|
@ -20,24 +20,48 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
|
||||||
|
|
||||||
ipa_entity_set_search_definition('netgroup', [
|
IPA.add_entity( function() {
|
||||||
['cn', 'Name', null],
|
var that = ipa_entity({
|
||||||
['description', 'Description', null]
|
'name': 'netgroup'
|
||||||
]);
|
});
|
||||||
|
that.init = function() {
|
||||||
|
var search_facet = ipa_search_facet({
|
||||||
|
name: 'search',
|
||||||
|
label: 'Search',
|
||||||
|
entity_name: that.name
|
||||||
|
});
|
||||||
|
search_facet.create_column({name:'cn'});
|
||||||
|
search_facet.create_column({name:'description'});
|
||||||
|
that.add_facet(search_facet);
|
||||||
|
|
||||||
|
that.add_facet(function() {
|
||||||
|
var that = ipa_details_facet({name:'details',label:'Details'});
|
||||||
|
that.add_section(
|
||||||
|
ipa_stanza({name:'identity', label:'Netgroup Details'}).
|
||||||
|
input({name:'cn'}).
|
||||||
|
input({name: 'description'}).
|
||||||
|
input({name:'nisdomainname'}));
|
||||||
|
return that;
|
||||||
|
}());
|
||||||
|
|
||||||
|
|
||||||
|
var dialog = ipa_add_dialog({
|
||||||
|
name: 'add',
|
||||||
|
title: 'Add Netgroup',
|
||||||
|
entity_name:'netgroup'
|
||||||
|
});
|
||||||
|
|
||||||
|
that.add_dialog(dialog);
|
||||||
|
dialog.init();
|
||||||
|
dialog.add_field(ipa_text_widget({ name: 'cn',
|
||||||
|
entity_name:'netgroup'}));
|
||||||
|
dialog.add_field(ipa_text_widget({ name: 'description',
|
||||||
|
entity_name:'netgroup' }));
|
||||||
|
that.create_association_facets();
|
||||||
|
that.entity_init();
|
||||||
|
}
|
||||||
|
return that;
|
||||||
|
}());
|
||||||
|
|
||||||
ipa_entity_set_add_definition('netgroup', [
|
|
||||||
'dialog-add-netgroup', 'Add New Netgroup', [
|
|
||||||
['cn', 'Name', null],
|
|
||||||
['description', 'Description', null]
|
|
||||||
]
|
|
||||||
]);
|
|
||||||
|
|
||||||
ipa_entity_set_details_definition('netgroup', [
|
|
||||||
ipa_stanza({name:'identity', label:'Netgroup Details'}).
|
|
||||||
input({name:'cn', label:'Name'}).
|
|
||||||
input({name:'description', label:'Description'}).
|
|
||||||
input({name:'nisdomainname', label:'NIS Domain'})
|
|
||||||
]);
|
|
||||||
|
|
||||||
ipa_entity_set_association_definition('netgroup', {
|
|
||||||
});
|
|
||||||
|
@ -21,46 +21,72 @@
|
|||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
|
||||||
|
|
||||||
/* DNS */
|
/* DNS */
|
||||||
ipa_entity_set_search_definition('dnszone', [
|
|
||||||
['idnsname', 'Zone Name', null]
|
IPA.add_entity(function (){
|
||||||
]);
|
var that = ipa_entity({
|
||||||
|
name: 'dnszone'
|
||||||
|
});
|
||||||
|
|
||||||
|
that.init = function() {
|
||||||
|
var search_facet = ipa_search_facet({
|
||||||
|
name: 'search',
|
||||||
|
label: 'Search',
|
||||||
|
entity_name: that.name
|
||||||
|
});
|
||||||
|
search_facet.create_column({name:'idnsname'});
|
||||||
|
that.add_facet(search_facet);
|
||||||
|
|
||||||
|
that.add_facet(function() {
|
||||||
|
var that = ipa_details_facet({name:'details',label:'Details'});
|
||||||
|
that.add_section(
|
||||||
|
ipa_stanza({name:'identity', label:'DNS Zone Details'}).
|
||||||
|
input({name:'idnsname'}).
|
||||||
|
input({name:'idnszoneactive'}).
|
||||||
|
input({name:'idnssoamname'}).
|
||||||
|
input({name:'idnssoarname'}).
|
||||||
|
input({name:'idnssoaserial'}).
|
||||||
|
input({name:'idnssoarefresh'}).
|
||||||
|
input({name:'idnssoaretry'}).
|
||||||
|
input({name:'idnssoaexpire'}).
|
||||||
|
input({name:'idnssoaminimum'}).
|
||||||
|
input({name:'dnsttl'}).
|
||||||
|
input({name:'dnsclass'}).
|
||||||
|
input({name:'idnsallowdynupdate'}).
|
||||||
|
input({name:'idnsupdatepolicy'}));
|
||||||
|
|
||||||
|
return that;
|
||||||
|
}());
|
||||||
|
|
||||||
|
that.add_facet( ipa_records_facet({
|
||||||
|
'name': 'records',
|
||||||
|
'label': IPA.metadata.dnsrecord.label
|
||||||
|
}));
|
||||||
|
|
||||||
|
var dialog = ipa_add_dialog({
|
||||||
|
name: 'add',
|
||||||
|
title: 'Add DNS Zone',
|
||||||
|
entity_name:'dnszone'
|
||||||
|
});
|
||||||
|
|
||||||
|
that.add_dialog(dialog);
|
||||||
|
dialog.init();
|
||||||
|
|
||||||
|
dialog.add_field(ipa_text_widget({ name: 'idnsname',
|
||||||
|
entity_name:'dnszone'}));
|
||||||
|
dialog.add_field(ipa_text_widget({ name: 'idnssoamname',
|
||||||
|
entity_name:'dnszone'}));
|
||||||
|
dialog.add_field(ipa_text_widget({ name: 'idnssoarname',
|
||||||
|
entity_name:'dnszone'}));
|
||||||
|
|
||||||
|
that.create_association_facets();
|
||||||
|
that.entity_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ipa_entity_set_add_definition('dnszone', [
|
return that;
|
||||||
'dialog-add-dns', 'Add New Zone', [
|
}());
|
||||||
['idnsname', 'Name', null],
|
|
||||||
['idnssoamname', 'Authoritative name server'],
|
|
||||||
['idnssoarname','administrator e-mail address']
|
|
||||||
]
|
|
||||||
]);
|
|
||||||
|
|
||||||
ipa_entity_set_details_definition('dnszone', [
|
|
||||||
ipa_stanza({name:'identity', label:'DNS Zone Details'}).
|
|
||||||
input({name:'idnsname', label:'DNS Name'}).
|
|
||||||
input({name:'idnszoneactive', label:'Zone Active'}).
|
|
||||||
input({name:'idnssoamname', label:'Authoritative name server'}).
|
|
||||||
input({name:'idnssoarname', label:'administrator e-mail address'}).
|
|
||||||
input({name:'idnssoaserial', label:'SOA serial'}).
|
|
||||||
input({name:'idnssoarefresh', label:'SOA refresh'}).
|
|
||||||
input({name:'idnssoaretry', label:'SOA retry'}).
|
|
||||||
input({name:'idnssoaexpire', label:'SOA expire'}).
|
|
||||||
input({name:'idnssoaminimum', label:'SOA minimum'}).
|
|
||||||
input({name:'dnsttl', label:'SOA time to live'}).
|
|
||||||
input({name:'dnsclass', label:'SOA class'}).
|
|
||||||
input({name:'idnsallowdynupdate', label:'allow dynamic update?'}).
|
|
||||||
input({name:'idnsupdatepolicy', label:'BIND update policy'})
|
|
||||||
]);
|
|
||||||
|
|
||||||
ipa_entity_set_association_definition('dnszone', {
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
ipa_entity_set_facet_definition('dnszone', [
|
|
||||||
ipa_records_facet({
|
|
||||||
'name': 'records',
|
|
||||||
'label': 'Records'
|
|
||||||
})]
|
|
||||||
);
|
|
||||||
|
|
||||||
function ipa_records_facet(spec){
|
function ipa_records_facet(spec){
|
||||||
|
|
||||||
@ -256,7 +282,6 @@ function ipa_records_facet(spec){
|
|||||||
};
|
};
|
||||||
|
|
||||||
function create(container) {
|
function create(container) {
|
||||||
// that.setup_views(container);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup(container){
|
function setup(container){
|
||||||
@ -322,9 +347,6 @@ function ipa_records_facet(spec){
|
|||||||
'click': function(){delete_records(records_table);}
|
'click': function(){delete_records(records_table);}
|
||||||
}).appendTo(action_controls);
|
}).appendTo(action_controls);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
div.append('<span class="records-buttons"></span>');
|
div.append('<span class="records-buttons"></span>');
|
||||||
|
|
||||||
var records_results = $('<div/>', {
|
var records_results = $('<div/>', {
|
||||||
@ -349,8 +371,9 @@ function ipa_records_facet(spec){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
));
|
));
|
||||||
tr.append($('<th>Resource</th>'));
|
tr.append($('<th/>',{
|
||||||
tr.append($('<th>Record Type</th>'));
|
text: ipa_get_param_info("dnsrecord", "idnsname").label }));
|
||||||
|
tr.append($('<th>Record Type</th>'));
|
||||||
tr.append($('<th>Data</th>'));
|
tr.append($('<th>Data</th>'));
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
@ -472,50 +495,97 @@ function ipa_records_facet(spec){
|
|||||||
|
|
||||||
/**Automount*/
|
/**Automount*/
|
||||||
|
|
||||||
ipa_entity_set_search_definition('automountlocation', [
|
IPA.add_entity(function (){
|
||||||
['cn', 'Name', null]
|
var that = ipa_entity({
|
||||||
]);
|
name: 'automountlocation'
|
||||||
|
});
|
||||||
|
|
||||||
ipa_entity_set_add_definition('automountlocation', [
|
|
||||||
'dialog-add-location', 'Add New Location', [
|
|
||||||
['cn', 'Name', null]
|
|
||||||
]
|
|
||||||
]);
|
|
||||||
|
|
||||||
ipa_entity_set_details_definition('automountlocation', [
|
var search_facet = ipa_search_facet({
|
||||||
ipa_stanza({name:'identity', label:'Automount Location Details'}).
|
name: 'search',
|
||||||
input({name:'cn', label:'Automount Location'})
|
label: 'Search',
|
||||||
]);
|
entity_name: that.name
|
||||||
|
});
|
||||||
|
that.init = function() {
|
||||||
|
search_facet.create_column({name:'cn'});
|
||||||
|
that.add_facet(search_facet);
|
||||||
|
|
||||||
ipa_entity_set_association_definition('automountlocation', {
|
|
||||||
});
|
that.add_facet(function() {
|
||||||
|
var that = ipa_details_facet({name:'details',label:'Details'});
|
||||||
|
that.add_section(
|
||||||
|
ipa_stanza({name:'identity', label:'Automount Location Details'}).
|
||||||
|
input({name:'cn'}));
|
||||||
|
return that;
|
||||||
|
}());
|
||||||
|
|
||||||
|
var dialog = ipa_add_dialog({
|
||||||
|
name: 'add',
|
||||||
|
title: 'Add Automount Location',
|
||||||
|
entity_name:'automountlocation'
|
||||||
|
});
|
||||||
|
|
||||||
|
that.add_dialog(dialog);
|
||||||
|
dialog.init();
|
||||||
|
dialog.add_field(ipa_text_widget({ name: 'cn',
|
||||||
|
entity_name:'automountlocation'}));
|
||||||
|
that.create_association_facets();
|
||||||
|
that.entity_init();
|
||||||
|
|
||||||
|
}
|
||||||
|
return that;
|
||||||
|
}());
|
||||||
|
|
||||||
|
|
||||||
/**pwpolicy*/
|
/**pwpolicy*/
|
||||||
|
|
||||||
ipa_entity_set_search_definition('pwpolicy', [
|
|
||||||
['cn', 'Name', null]
|
|
||||||
|
|
||||||
]);
|
IPA.add_entity(function (){
|
||||||
|
var that = ipa_entity({
|
||||||
|
name: 'pwpolicy'
|
||||||
|
});
|
||||||
|
|
||||||
ipa_entity_set_add_definition('pwpolicy', [
|
|
||||||
'dialog-add-dns', 'Add New Location', [
|
|
||||||
['cn', 'Name', null]
|
|
||||||
]
|
|
||||||
]);
|
|
||||||
|
|
||||||
ipa_entity_set_details_definition('pwpolicy', [
|
var search_facet = ipa_search_facet({
|
||||||
ipa_stanza({name:'identity', label:'Password Policy'}).
|
name: 'search',
|
||||||
input({name:'krbmaxpwdlife',label:'Max Password Life'}).
|
label: 'Search',
|
||||||
input({name:'krbminpwdlife',label:'Min Password Life'}).
|
entity_name: that.name
|
||||||
input({name:'krbpwdhistorylength',label:'Password History Length'}).
|
});
|
||||||
input({name:'krbpwdmindiffchars',
|
that.init = function() {
|
||||||
label:'Min Different Characters'}).
|
search_facet.create_column({name:'cn'});
|
||||||
input({name:'krbpwdminlength', label:'Password Minimum Length'})
|
that.add_facet(search_facet);
|
||||||
]);
|
|
||||||
|
|
||||||
|
that.add_facet(function() {
|
||||||
|
var that = ipa_details_facet({name:'details',label:'Details'});
|
||||||
|
that.add_section(
|
||||||
|
|
||||||
|
ipa_stanza({name:'identity', label:'Password Policy'}).
|
||||||
|
input({name:'krbmaxpwdlife'}).
|
||||||
|
input({name:'krbminpwdlife'}).
|
||||||
|
input({name:'krbpwdhistorylength'}).
|
||||||
|
input({name:'krbpwdmindiffchars'}).
|
||||||
|
input({name:'krbpwdminlength'}));
|
||||||
|
return that;
|
||||||
|
}());
|
||||||
|
|
||||||
|
var dialog = ipa_add_dialog({
|
||||||
|
name: 'add',
|
||||||
|
title: 'Add Password Policy',
|
||||||
|
entity_name:'pwpolicy'
|
||||||
|
});
|
||||||
|
|
||||||
|
that.add_dialog(dialog);
|
||||||
|
dialog.init();
|
||||||
|
dialog.add_field(ipa_text_widget({ name: 'cn',
|
||||||
|
entity_name:'pwpolicy'}));
|
||||||
|
that.create_association_facets();
|
||||||
|
that.entity_init();
|
||||||
|
|
||||||
|
}
|
||||||
|
return that;
|
||||||
|
}());
|
||||||
|
|
||||||
ipa_entity_set_association_definition('pwpolicy', {
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -525,9 +595,9 @@ ipa_entity_set_association_definition('pwpolicy', {
|
|||||||
|
|
||||||
ipa_entity_set_details_definition('krbtpolicy', [
|
ipa_entity_set_details_definition('krbtpolicy', [
|
||||||
ipa_stanza({name:'identity', label:'Krbtpolicy Location Details'}).
|
ipa_stanza({name:'identity', label:'Krbtpolicy Location Details'}).
|
||||||
input({name:'cn', label:'Krbtpolicy Location'}).
|
input({name:'cn'}).
|
||||||
input({name:'krbmaxrenewableage', label:'Max Renewable Age'}).
|
input({name:'krbmaxrenewableage'}).
|
||||||
input({name:'krbmaxticketlife', label:'Max Ticket Life'})
|
input({name:'krbmaxticketlife'})
|
||||||
]);
|
]);
|
||||||
|
|
||||||
IPA.get_entity('krbtpolicy').default_facet = 'details';
|
IPA.get_entity('krbtpolicy').default_facet = 'details';
|
||||||
|
@ -285,6 +285,13 @@ function ipa_search_facet(spec) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
that.create_column = function(spec) {
|
that.create_column = function(spec) {
|
||||||
|
if (!spec.label){
|
||||||
|
var param_info = ipa_get_param_info(this.entity_name, spec.name);
|
||||||
|
if (param_info){
|
||||||
|
spec.label = param_info.label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var column = ipa_column(spec);
|
var column = ipa_column(spec);
|
||||||
that.add_column(column);
|
that.add_column(column);
|
||||||
return column;
|
return column;
|
||||||
|
@ -80,7 +80,6 @@ function ipa_service_add_dialog(spec) {
|
|||||||
|
|
||||||
that.add_field(ipa_widget({
|
that.add_field(ipa_widget({
|
||||||
name: 'krbprincipalname',
|
name: 'krbprincipalname',
|
||||||
label: 'Principal'
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
that.add_field(ipa_text_widget({
|
that.add_field(ipa_text_widget({
|
||||||
@ -159,7 +158,7 @@ function ipa_service_search_facet(spec) {
|
|||||||
|
|
||||||
that.init = function() {
|
that.init = function() {
|
||||||
|
|
||||||
that.create_column({name:'krbprincipalname', label:'Principal'});
|
that.create_column({name:'krbprincipalname'});
|
||||||
that.search_facet_init();
|
that.search_facet_init();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -181,8 +180,7 @@ function ipa_service_details_facet(spec) {
|
|||||||
that.add_section(section);
|
that.add_section(section);
|
||||||
|
|
||||||
section.create_field({
|
section.create_field({
|
||||||
name: 'krbprincipalname',
|
name: 'krbprincipalname'
|
||||||
label: 'Principal'
|
|
||||||
});
|
});
|
||||||
|
|
||||||
section.create_field({
|
section.create_field({
|
||||||
|
@ -109,8 +109,12 @@ test('Testing ipa_facet_setup_views().', function() {
|
|||||||
|
|
||||||
var views = ul.children();
|
var views = ul.children();
|
||||||
|
|
||||||
|
/*5 Views:
|
||||||
|
one for each of 3 associations
|
||||||
|
one for search
|
||||||
|
a blank one for the action controls*/
|
||||||
equals(
|
equals(
|
||||||
views.length, 6,
|
views.length, 5,
|
||||||
'Checking number of views'
|
'Checking number of views'
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -142,7 +146,8 @@ test('Testing ipa_facet_setup_views().', function() {
|
|||||||
var search_facets = $('li.search-facet', action_panel);
|
var search_facets = $('li.search-facet', action_panel);
|
||||||
equals(search_facets.length,1,'one search facet in action panel');
|
equals(search_facets.length,1,'one search facet in action panel');
|
||||||
var entity_facets = $('li.entity-facet', action_panel);
|
var entity_facets = $('li.entity-facet', action_panel);
|
||||||
equals(entity_facets.length,4,'4 entity facets in action panel');
|
/*No longer automatically adding details, so ony the assoc. facets */
|
||||||
|
equals(entity_facets.length,3,'3 entity facets in action panel');
|
||||||
|
|
||||||
|
|
||||||
for ( var entity_facet = entity_facets.first();
|
for ( var entity_facet = entity_facets.first();
|
||||||
|
@ -20,71 +20,99 @@
|
|||||||
|
|
||||||
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
|
||||||
|
|
||||||
ipa_entity_set_search_definition('user', [
|
function ipa_user(){
|
||||||
['cn', 'Name', null],
|
var that = ipa_entity({
|
||||||
['uid', 'Login', null],
|
name: 'user'
|
||||||
['uidnumber', 'UID', null],
|
});
|
||||||
['mail', 'EMAIL', null],
|
that.init = function() {
|
||||||
['telephonenumber', 'Phone', null],
|
var search_facet = ipa_search_facet({
|
||||||
['title', 'Job Title', null]
|
'name': 'search',
|
||||||
]);
|
'label': 'Search',
|
||||||
|
entity_name: that.name
|
||||||
ipa_entity_set_add_definition('user', [
|
});
|
||||||
'dialog-add-user', 'Add New User', [
|
search_facet.create_column({name:'cn'});
|
||||||
['uid', 'Login', null],
|
search_facet.create_column({name:'uid'});
|
||||||
['givenname', 'First Name', null],
|
search_facet.create_column({name:'uidnumber'});
|
||||||
['sn', 'Last Name', null]
|
search_facet.create_column({name:'mail'});
|
||||||
]
|
search_facet.create_column({name:'telephonenumber'});
|
||||||
]);
|
search_facet.create_column({name:'title'});
|
||||||
|
that.add_facet(search_facet);
|
||||||
|
|
||||||
|
|
||||||
ipa_entity_set_details_definition('user', [
|
that.add_facet(details_facet({name:'details',label:'Details'}));
|
||||||
ipa_stanza({name:'identity', label:'Identity Details'}).
|
|
||||||
input({name:'title', label: 'Title'}).
|
var dialog = ipa_add_dialog({
|
||||||
input({name:'givenname'}).
|
'name': 'add',
|
||||||
input({name:'sn'}).
|
'title': 'Add User'
|
||||||
input({name:'cn', label:'Full Name'}).
|
});
|
||||||
input({name:'displayname', label:'Display Name'}).
|
|
||||||
input({name:'initials', label:'Initials'}),
|
that.add_dialog(dialog);
|
||||||
ipa_stanza({name:'account', label:'Account Details'}).
|
dialog.init();
|
||||||
input({name:'nsaccountlock', label:'Account Status',
|
dialog.add_field(ipa_text_widget({ name: 'uid',entity_name:'user' }));
|
||||||
load:user_status_load}).
|
dialog.add_field(ipa_text_widget({ name: 'givenname',
|
||||||
input({name:'uid'}).
|
entity_name:'user' }));
|
||||||
input({name:'userpassword',
|
dialog.add_field(ipa_text_widget({ name: 'sn',entity_name:'user' }));
|
||||||
load: user_password_load}).
|
|
||||||
input({name:'uidnumber'}).
|
/*eventually, we need to call
|
||||||
input({name:'gidnumber', label:'GID'}).
|
entity.create_association_facets();
|
||||||
input({name:'loginshell'}).
|
but we are currently defining the associator using the global
|
||||||
input({name:'homedirectory'}),
|
function after the registration of the entity */
|
||||||
ipa_stanza({name:'contact', label:'Contact Details'}).
|
|
||||||
input({name:'mail'}).
|
|
||||||
input({name:'telephonenumber'}).
|
that.entity_init();
|
||||||
input({name:'pager'}).
|
}
|
||||||
input({name:'mobile'}).
|
|
||||||
input({name:'facsimiletelephonenumber'}),
|
function details_facet(spec) {
|
||||||
ipa_stanza({name:'address', label:'Mailing Address'}).
|
spec = spec || {};
|
||||||
input({name:'street'}).
|
var that = ipa_details_facet(spec);
|
||||||
input({name:'location', label:'City'}).
|
|
||||||
input({name:'state', label:'State', load:user_state_load}).
|
var sections =[
|
||||||
input({name:'postalcode', label:'ZIP'}),
|
ipa_stanza({name:'identity', label:'Identity Details'}).
|
||||||
ipa_stanza({name:'employee', label:'Employee Information'}).
|
input({name:'title'}).
|
||||||
input({name:'ou', label:'Org. Unit'}).
|
input({name:'givenname'}).
|
||||||
input({name:'manager', label:'Manager'}),
|
input({name:'sn'}).
|
||||||
ipa_stanza({name:'misc', label:'Misc. Information'}).
|
input({name:'cn'}).
|
||||||
input({name:'carlicense', label:'Car License'})
|
input({name:'displayname'}).
|
||||||
]);
|
input({name:'initials'}),
|
||||||
|
ipa_stanza({name:'account', label:'Account Details'}).
|
||||||
|
input({name:'nsaccountlock', load:user_status_load}).
|
||||||
|
input({name:'uid'}).
|
||||||
|
input({name:'userpassword', load: user_password_load}).
|
||||||
|
input({name:'uidnumber'}).
|
||||||
|
input({name:'gidnumber'}).
|
||||||
|
input({name:'loginshell'}).
|
||||||
|
input({name:'homedirectory'}),
|
||||||
|
ipa_stanza({name:'contact', label:'Contact Details'}).
|
||||||
|
input({name:'mail'}).
|
||||||
|
input({name:'telephonenumber'}).
|
||||||
|
input({name:'pager'}).
|
||||||
|
input({name:'mobile'}).
|
||||||
|
input({name:'facsimiletelephonenumber'}),
|
||||||
|
ipa_stanza({name:'address', label:'Mailing Address'}).
|
||||||
|
input({name:'street'}).
|
||||||
|
input({name:'location'}).
|
||||||
|
input({name:'state', load:user_state_load}).
|
||||||
|
input({name:'postalcode'}),
|
||||||
|
ipa_stanza({name:'employee', label:'Employee Information'}).
|
||||||
|
input({name:'ou', label:'Org. Unit'}).
|
||||||
|
input({name:'manager'}),
|
||||||
|
ipa_stanza({name:'misc', label:'Misc. Information'}).
|
||||||
|
input({name:'carlicense'})
|
||||||
|
];
|
||||||
|
for (var i = 0; i < sections.length; i += 1){
|
||||||
|
that.add_section(sections[i]);
|
||||||
|
}
|
||||||
|
return that;
|
||||||
|
}
|
||||||
|
return that;
|
||||||
|
}
|
||||||
|
IPA.add_entity(ipa_user());
|
||||||
|
|
||||||
ipa_entity_set_association_definition('user', {
|
ipa_entity_set_association_definition('user', {
|
||||||
'group': { associator: 'serial' },
|
'group': { associator: 'serial' },
|
||||||
'netgroup': { associator: 'serial' },
|
'netgroup': { associator: 'serial' },
|
||||||
'rolegroup': { associator: 'serial' },
|
|
||||||
'taskgroup': { associator: 'serial' }
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ATTRIBUTE CALLBACKS */
|
/* ATTRIBUTE CALLBACKS */
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,10 +28,18 @@ function ipa_widget(spec) {
|
|||||||
|
|
||||||
that.id = spec.id;
|
that.id = spec.id;
|
||||||
that.name = spec.name;
|
that.name = spec.name;
|
||||||
that.label = spec.label;
|
that.label = spec.label ;
|
||||||
that.read_only = spec.read_only;
|
that.read_only = spec.read_only;
|
||||||
that._entity_name = spec.entity_name;
|
that._entity_name = spec.entity_name;
|
||||||
|
|
||||||
|
if (spec.entity_name && ! spec.label){
|
||||||
|
var param_info = ipa_get_param_info(spec.entity_name, spec.name);
|
||||||
|
if (param_info){
|
||||||
|
that.label = param_info.label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
that.width = spec.width;
|
that.width = spec.width;
|
||||||
that.height = spec.height;
|
that.height = spec.height;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user