summaryrefslogtreecommitdiffstats
path: root/install/ui/aci.js
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2011-01-28 15:52:26 -0500
committerAdam Young <ayoung@redhat.com>2011-01-28 17:01:19 -0500
commitfd1d0857b5b559425668f38d85a7d607d0f35767 (patch)
tree771d613acb5bada684bbf766228aa0579d07ab18 /install/ui/aci.js
parent3625a1e88afd26e3694d33f3a491824ba0d1f9e3 (diff)
downloadfreeipa-fd1d0857b5b559425668f38d85a7d607d0f35767.tar.gz
freeipa-fd1d0857b5b559425668f38d85a7d607d0f35767.tar.xz
freeipa-fd1d0857b5b559425668f38d85a7d607d0f35767.zip
unmatched aciattrs
instead of reporting an error on unmatched aciattrs, append them to the table.
Diffstat (limited to 'install/ui/aci.js')
-rw-r--r--install/ui/aci.js26
1 files changed, 23 insertions, 3 deletions
diff --git a/install/ui/aci.js b/install/ui/aci.js
index 92440dfa5..3f56cbed6 100644
--- a/install/ui/aci.js
+++ b/install/ui/aci.js
@@ -78,6 +78,7 @@ IPA.attribute_table_widget= function (spec){
append('<th class="aci-attribute-column">Attribute</th>');
IPA.populate_attribute_table(table, object_type);
+ that.table = table;
};
that.save = function(){
@@ -402,10 +403,10 @@ IPA.target_section = function () {
}));
}
- var attribute_table = IPA.attribute_table_widget(
+ that.attribute_table = IPA.attribute_table_widget(
{name:'aci_attributes_table',object_type:'user'});
- attribute_table.create(dl);
+ that.attribute_table.create(dl);
}
@@ -534,13 +535,32 @@ IPA.target_section = function () {
IPA.populate_attribute_table($('#aci_attributes_table'),
result.type);
if (result.attrs){
+ var unmatched = [];
+
for (var a = 0; a < result.attrs.length; a += 1){
var cb = $('#aciattr-'+result.attrs[a]);
if (!cb.length){
- alert('unmatched:'+result.attrs[a]);
+ unmatched.push(result.attrs[a]);
}
cb.attr('checked',true);
}
+ if (unmatched.length > 0){
+ var tbody = $('tbody',that.attribute_table.table);
+ var td;
+ for (var u = 0; u < unmatched.length ; u += 1){
+ var aci_tr = $('<tr/>').appendTo(tbody);
+ td = $('<td/>').appendTo(aci_tr);
+ td.append($('<input/>',{
+ type:"checkbox",
+ checked: true,
+ id:'aciattr-'+unmatched[u].toLowerCase(),
+ "class":'aci-attribute'
+ }));
+ td = $('<td/>').appendTo(aci_tr);
+ td.append($('<label/>',{
+ text:unmatched[u].toLowerCase()}));
+ }
+ }
}
}else if (result.targetgroup){
var segments = result.targetgroup.split(/,/);