diff options
Diffstat (limited to 'install')
30 files changed, 662 insertions, 681 deletions
diff --git a/install/static/aci.js b/install/static/aci.js index 02b9c4be0..9d3ee546f 100644 --- a/install/static/aci.js +++ b/install/static/aci.js @@ -47,7 +47,7 @@ IPA.populate_attribute_table = function (table, entity){ IPA.attribute_table_widget= function (spec){ var id = spec.name; - var that = ipa_widget(spec); + var that = IPA.widget(spec); var object_type = spec.objecttype || 'user'; var table; @@ -116,7 +116,7 @@ IPA.attribute_table_widget= function (spec){ IPA.entity_select_widget = function(spec){ - var that = ipa_widget(spec); + var that = IPA.widget(spec); var entity = spec.entity || 'group'; function populate_select(value){ @@ -137,7 +137,7 @@ IPA.entity_select_widget = function(spec){ } function find_error(err){ } - ipa_command({ + IPA.command({ method: entity+'_find', args:[that.entity_filter.val()], options:{}, @@ -199,7 +199,7 @@ IPA.entity_select_widget = function(spec){ IPA.rights_widget = function(spec){ var rights = ['write','add','delete']; - var that = ipa_widget({name:'permissions',label:'Permissions'}); + var that = IPA.widget({name:'permissions',label:'Permissions'}); that.id = spec.id; that.create = function(container){ @@ -259,7 +259,7 @@ IPA.rights_widget = function(spec){ IPA.hidden_widget = function(spec){ spec.label = ''; - var that = ipa_widget(spec); + var that = IPA.widget(spec); that.id = spec.id; var value = spec.value || ''; that.create = function(container){ @@ -280,24 +280,24 @@ IPA.hidden_widget = function(spec){ return that; }; -function ipa_rights_section() { +IPA.rights_section = function () { var spec = { 'name':'rights', 'label': 'Rights' }; - var that = ipa_details_section(spec); + var that = IPA.details_section(spec); that.add_field(IPA.rights_widget({name:'permissions'})); return that; } -function ipa_target_section() { +IPA.target_section = function () { var spec = { 'name':'target', 'label': 'Target' }; - var that = ipa_details_section(spec); + var that = IPA.details_section(spec); var groupings = ['aci_by_type', 'aci_by_query', 'aci_by_group', 'aci_by_filter' ]; var inputs = ['input', 'select', 'textarea']; @@ -364,7 +364,7 @@ function ipa_target_section() { attribute_table, this.options[this.selectedIndex].value); } }).appendTo(dd); - var type_params=ipa_get_param_info("permission","type"); + var type_params=IPA.get_param_info("permission","type"); for (var pc =0; pc < type_params.values.length; pc += 1){ type_select.append($('<option/>',{ value: type_params.values[pc], @@ -413,7 +413,7 @@ function ipa_target_section() { } $('option', that.group_select).remove(); - ipa_command({ + IPA.command({ method:'group_find', args:[that.group_filter.val()], options:{}, @@ -561,15 +561,15 @@ function ipa_target_section() { -function ipa_permission() { +IPA.permission = function () { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'permission' }); that.init = function() { - var dialog = ipa_permission_add_dialog({ + var dialog = IPA.permission_add_dialog({ name: 'add', title: 'Add New Permission', entity_name: 'permission' @@ -577,13 +577,13 @@ function ipa_permission() { that.add_dialog(dialog); dialog.init(); - var facet = ipa_permission_search_facet({ + var facet = IPA.permission_search_facet({ name: 'search', label: 'Search' }); that.add_facet(facet); - facet = ipa_permission_details_facet(); + facet = IPA.permission_details_facet(); that.add_facet(facet); that.entity_init(); @@ -592,24 +592,24 @@ function ipa_permission() { return that; } -IPA.add_entity(ipa_permission()); +IPA.add_entity(IPA.permission()); -function ipa_permission_add_dialog(spec) { +IPA.permission_add_dialog = function (spec) { spec = spec || {}; - var that = ipa_add_dialog(spec); + var that = IPA.add_dialog(spec); that.init = function() { - that.add_field(ipa_text_widget({ + that.add_field(IPA.text_widget({ name: 'cn', undo: false })); - that.add_field(ipa_text_widget({ + that.add_field(IPA.text_widget({ name: 'description', undo: false })); @@ -624,10 +624,10 @@ function ipa_permission_add_dialog(spec) { } -function ipa_permission_search_facet(spec) { +IPA.permission_search_facet = function (spec) { spec = spec || {}; - var that = ipa_search_facet(spec); + var that = IPA.search_facet(spec); that.init = function() { that.create_column({name:'cn'}); that.create_column({name:'description'}); @@ -637,25 +637,25 @@ function ipa_permission_search_facet(spec) { } -function ipa_permission_details_facet() { +IPA.permission_details_facet = function () { var spec = { name: 'details', label: 'Details' }; - var that = ipa_details_facet(spec); + var that = IPA.details_facet(spec); that.init = function() { - var section = that.add_section(ipa_details_list_section({ + var section = that.add_section(IPA.details_list_section({ name:'identity',label:'Identity' })); section.create_field({ name: 'cn', 'read_only': true }); section.create_field({ name: 'description'}); - that.rights_section = ipa_rights_section(); + that.rights_section = IPA.rights_section(); that.add_section(that.rights_section); - that.target_section = ipa_target_section(); + that.target_section = IPA.target_section(); that.add_section(that.target_section); that.details_facet_init(); @@ -675,12 +675,12 @@ function ipa_permission_details_facet() { } IPA.add_entity( function() { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'privilege' }); that.init = function() { - var search_facet = ipa_search_facet({ + var search_facet = IPA.search_facet({ name: 'search', label: 'Search', entity_name: that.name @@ -690,24 +690,24 @@ IPA.add_entity( function() { that.add_facet(search_facet); that.add_facet(function() { - var that = ipa_details_facet({name:'details',label:'Details'}); + var that = IPA.details_facet({name:'details',label:'Details'}); that.add_section( - ipa_stanza({name:'identity', label:'Privilege Details'}). + IPA.stanza({name:'identity', label:'Privilege Details'}). input({name:'cn'}). input({name: 'description'})); return that; }()); - var dialog = ipa_add_dialog({ + var dialog = IPA.add_dialog({ name: 'add', title: 'Add Privilege', entity_name: that.entity }); that.add_dialog(dialog); - dialog.add_field(ipa_text_widget({ name: 'cn', undo: false})); - dialog.add_field(ipa_text_widget({ name: 'description', undo: false})); + dialog.add_field(IPA.text_widget({ name: 'cn', undo: false})); + dialog.add_field(IPA.text_widget({ name: 'description', undo: false})); dialog.init(); that.create_association_facets(); @@ -718,11 +718,11 @@ IPA.add_entity( function() { IPA.add_entity( function() { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'role' }); that.init = function() { - var search_facet = ipa_search_facet({ + var search_facet = IPA.search_facet({ name: 'search', label: 'Search', entity_name: that.name @@ -732,22 +732,22 @@ IPA.add_entity( function() { that.add_facet(search_facet); that.add_facet(function() { - var that = ipa_details_facet({name:'details',label:'Details'}); + var that = IPA.details_facet({name:'details',label:'Details'}); that.add_section( - ipa_stanza({name:'identity', label:'Role Details'}). + IPA.stanza({name:'identity', label:'Role Details'}). input({name:'cn'}). input({name: 'description'})); return that; }()); - var dialog = ipa_add_dialog({ + var dialog = IPA.add_dialog({ name: 'add', title: 'Add Role' }); that.add_dialog(dialog); - dialog.add_field(ipa_text_widget({ name: 'cn', undo: false})); - dialog.add_field(ipa_text_widget({ name: 'description', undo: false})); + dialog.add_field(IPA.text_widget({ name: 'cn', undo: false})); + dialog.add_field(IPA.text_widget({ name: 'description', undo: false})); dialog.init(); that.create_association_facets(); @@ -759,7 +759,7 @@ IPA.add_entity( function() { IPA.add_entity( function() { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'selfservice' }); @@ -768,7 +768,7 @@ IPA.add_entity( function() { name: 'search', label: 'Search' }; - var that = ipa_search_facet(spec); + var that = IPA.search_facet(spec); that.init = function() { that.create_column({name:'aciname'}); that.search_facet_init(); @@ -778,11 +778,11 @@ IPA.add_entity( function() { that.add_facet(function(){ - var that = ipa_details_facet({'name':'details',label:'Details'}); + var that = IPA.details_facet({'name':'details',label:'Details'}); that.init = function() { that.add_section( - ipa_stanza({name:'general', label:'General'}). + IPA.stanza({name:'general', label:'General'}). input({name:'aciname'}). custom_input(IPA.attribute_table_widget({ object_type:'user', @@ -796,12 +796,12 @@ IPA.add_entity( function() { that.parent_init = that.init; that.init = function(){ that.parent_init(); - var dialog = ipa_add_dialog({ + var dialog = IPA.add_dialog({ name: 'add', title: 'Add Self Service Definition' }); that.add_dialog(dialog); - dialog.add_field(ipa_text_widget({ name: 'aciname', undo: false})); + dialog.add_field(IPA.text_widget({ name: 'aciname', undo: false})); dialog.add_field(IPA.attribute_table_widget({ object_type:'user', name:'attrs' @@ -813,7 +813,7 @@ IPA.add_entity( function() { IPA.add_entity( function() { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'delegation' }); @@ -822,7 +822,7 @@ IPA.add_entity( function() { name: 'search', label: 'Search' }; - var that = ipa_search_facet(spec); + var that = IPA.search_facet(spec); that.init = function() { that.create_column({name:'aciname'}); that.search_facet_init(); @@ -830,9 +830,9 @@ IPA.add_entity( function() { return that; }()); that.add_facet(function(){ - var that = ipa_details_facet({'name':'details',label:'Details'}); + var that = IPA.details_facet({'name':'details',label:'Details'}); var section = - ipa_stanza({name:'general', label:'General'}). + IPA.stanza({name:'general', label:'General'}). input({name:'aciname'}). custom_input(IPA.entity_select_widget( {name:'group', entity:'group'})). @@ -851,13 +851,13 @@ IPA.add_entity( function() { that.super_init = that.init; that.init = function(){ that.super_init(); - var dialog = ipa_add_dialog({ + var dialog = IPA.add_dialog({ name: 'add', title: 'Add Delegation', entity_name: that.entity }); that.add_dialog(dialog); - dialog.add_field(ipa_text_widget({ name: 'aciname', undo: false})); + dialog.add_field(IPA.text_widget({ name: 'aciname', undo: false})); dialog.add_field(IPA.entity_select_widget({name:'group', entity:'group'})); dialog.add_field(IPA.entity_select_widget({name:'memberof', diff --git a/install/static/add.js b/install/static/add.js index 0acf78589..fd3f6055e 100644 --- a/install/static/add.js +++ b/install/static/add.js @@ -21,11 +21,11 @@ /* REQUIRES: ipa.js */ -function ipa_add_dialog(spec) { +IPA.add_dialog = function (spec) { spec = spec || {}; - var that = ipa_dialog(spec); + var that = IPA.dialog(spec); that.name = spec.name; that.title = spec.title; @@ -109,7 +109,7 @@ function ipa_add_dialog(spec) { save_field(that.fields[i], record, args, options); } - ipa_cmd('add', args, options, on_success, on_error, that.entity_name); + IPA.cmd('add', args, options, on_success, on_error, that.entity_name); }; that.add_dialog_init = that.init; diff --git a/install/static/associate.js b/install/static/associate.js index d4e263531..bcf81a13b 100644 --- a/install/static/associate.js +++ b/install/static/associate.js @@ -22,7 +22,7 @@ /* CURRENTLY ALSO REQUIRES search.js, because it reuses it's code to create * the AssociationList elements; IT NEEDS IT'S OWN CODE! */ -function ipa_associator(spec) { +IPA.associator = function (spec) { spec = spec || {}; @@ -52,7 +52,7 @@ function serial_associator(spec) { spec = spec || {}; - var that = ipa_associator(spec); + var that = IPA.associator(spec); that.execute = function() { @@ -71,7 +71,7 @@ function serial_associator(spec) { var options = {}; options[that.entity_name] = that.pkey; - ipa_cmd( + IPA.cmd( that.method, args, options, @@ -91,7 +91,7 @@ function bulk_associator(spec) { spec = spec || {}; - var that = ipa_associator(spec); + var that = IPA.associator(spec); that.execute = function() { @@ -114,7 +114,7 @@ function bulk_associator(spec) { var options = { 'all': true }; options[that.other_entity] = value; - ipa_cmd( + IPA.cmd( that.method, args, options, @@ -129,11 +129,11 @@ function bulk_associator(spec) { /** * This dialog is used for adding associations between two entities. */ -function ipa_association_adder_dialog(spec) { +IPA.association_adder_dialog = function (spec) { spec = spec || {}; - var that = ipa_adder_dialog(spec); + var that = IPA.adder_dialog(spec); that.entity_name = spec.entity_name; that.pkey = spec.pkey; @@ -195,7 +195,7 @@ function ipa_association_adder_dialog(spec) { } } - ipa_cmd('find', [that.get_filter()], options, on_success, null, that.other_entity); + IPA.cmd('find', [that.get_filter()], options, on_success, null, that.other_entity); }; that.association_adder_dialog_init = that.init; @@ -207,11 +207,11 @@ function ipa_association_adder_dialog(spec) { /** * This dialog is used for removing associations between two entities. */ -function ipa_association_deleter_dialog(spec) { +IPA.association_deleter_dialog = function (spec) { spec = spec || {}; - var that = ipa_deleter_dialog(spec); + var that = IPA.deleter_dialog(spec); that.entity_name = spec.entity_name; that.pkey = spec.pkey; @@ -242,7 +242,7 @@ function ipa_association_deleter_dialog(spec) { return that; } -function ipa_association_config(spec) { +IPA.association_config = function (spec) { spec = spec || {}; @@ -256,11 +256,11 @@ function ipa_association_config(spec) { return that; } -function ipa_association_table_widget(spec) { +IPA.association_table_widget = function (spec) { spec = spec || {}; - var that = ipa_table_widget(spec); + var that = IPA.table_widget(spec); that.other_entity = spec.other_entity; that.attribute_member = spec.attribute_member; @@ -282,7 +282,7 @@ function ipa_association_table_widget(spec) { }; that.create_adder_column = function(spec) { - var column = ipa_column(spec); + var column = IPA.column(spec); that.add_adder_column(column); return column; }; @@ -384,7 +384,7 @@ function ipa_association_table_widget(spec) { if (!that.values.length) return; - var batch = ipa_batch_command({ + var batch = IPA.batch_command({ 'name': that.entity_name+'_'+that.name, 'on_success': on_success, 'on_error': on_error @@ -393,7 +393,7 @@ function ipa_association_table_widget(spec) { for (var i=0; i<that.values.length; i++) { var value = that.values[i]; - var command = ipa_command({ + var command = IPA.command({ 'method': that.other_entity+'_show', 'args': [value], 'options': { @@ -443,7 +443,7 @@ function ipa_association_table_widget(spec) { var label = IPA.metadata[that.other_entity].label; var title = 'Add '+label+' to '+that.entity_name+' '+pkey; - return ipa_association_adder_dialog({ + return IPA.association_adder_dialog({ 'title': title, 'entity_name': that.entity_name, 'pkey': pkey, @@ -483,7 +483,7 @@ function ipa_association_table_widget(spec) { var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || ''; - var command = ipa_command({ + var command = IPA.command({ 'method': that.entity_name+'_'+that.add_method, 'args': [pkey], 'on_success': on_success, @@ -507,7 +507,7 @@ function ipa_association_table_widget(spec) { var label = IPA.metadata[that.other_entity].label; var title = 'Remove '+label+' from '+that.entity_name+' '+pkey; - var dialog = ipa_association_deleter_dialog({ + var dialog = IPA.association_deleter_dialog({ 'title': title, 'entity_name': that.entity_name, 'pkey': pkey, @@ -538,7 +538,7 @@ function ipa_association_table_widget(spec) { var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || ''; - var command = ipa_command({ + var command = IPA.command({ 'method': that.entity_name+'_'+that.remove_method, 'args': [pkey], 'on_success': on_success, @@ -556,11 +556,11 @@ function ipa_association_table_widget(spec) { return that; } -function ipa_association_facet(spec) { +IPA.association_facet = function (spec) { spec = spec || {}; - var that = ipa_facet(spec); + var that = IPA.facet(spec); that.other_entity = spec.other_entity; that.facet_group = spec.facet_group; @@ -586,7 +586,7 @@ function ipa_association_facet(spec) { }; that.create_column = function(spec) { - var column = ipa_column(spec); + var column = IPA.column(spec); that.add_column(column); return column; }; @@ -601,7 +601,7 @@ function ipa_association_facet(spec) { }; that.create_adder_column = function(spec) { - var column = ipa_column(spec); + var column = IPA.column(spec); that.add_adder_column(column); return column; }; @@ -627,7 +627,7 @@ function ipa_association_facet(spec) { var label = IPA.metadata[that.other_entity] ? IPA.metadata[that.other_entity].label : that.other_entity; var pkey_name = IPA.metadata[that.other_entity].primary_key; - that.table = ipa_table_widget({ + that.table = IPA.table_widget({ 'id': that.entity_name+'-'+that.other_entity, 'name': pkey_name, 'label': label, @@ -742,7 +742,7 @@ function ipa_association_facet(spec) { that.table.setup(span); - // replacing generic buttons with ipa_button and setting click handler + // replacing generic buttons with IPA.button and setting click handler var action_panel = that.get_action_panel(); var button = $('input[name=remove]', action_panel); @@ -766,7 +766,7 @@ function ipa_association_facet(spec) { var label = IPA.metadata[that.other_entity] ? IPA.metadata[that.other_entity].label : that.other_entity; var title = 'Enroll ' + label + ' in ' + that.entity_name + ' ' + pkey; - var dialog = ipa_association_adder_dialog({ + var dialog = IPA.association_adder_dialog({ 'title': title, 'entity_name': that.entity_name, 'pkey': pkey, @@ -819,7 +819,7 @@ function ipa_association_facet(spec) { var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || ''; var title = 'Remove '+label+' from '+that.entity_name+' '+pkey; - var dialog = ipa_association_deleter_dialog({ + var dialog = IPA.association_deleter_dialog({ 'title': title, 'entity_name': that.entity_name, 'pkey': pkey, @@ -846,7 +846,7 @@ function ipa_association_facet(spec) { if (!pkeys.length) return; - var batch = ipa_batch_command({ + var batch = IPA.batch_command({ 'name': that.entity_name+'_'+that.name, 'on_success': on_success, 'on_error': on_error @@ -855,7 +855,7 @@ function ipa_association_facet(spec) { for (var i=0; i<pkeys.length; i++) { var pkey = pkeys[i]; - var command = ipa_command({ + var command = IPA.command({ 'method': that.other_entity+'_show', 'args': [pkey], 'options': { @@ -909,7 +909,7 @@ function ipa_association_facet(spec) { } var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || ''; - ipa_cmd('show', [pkey], {'rights': true}, on_success, on_error, that.entity_name); + IPA.cmd('show', [pkey], {'rights': true}, on_success, on_error, that.entity_name); }; that.association_facet_init = that.init; @@ -917,7 +917,7 @@ function ipa_association_facet(spec) { return that; } -function ipa_deleter_dialog_setup() { +IPA.deleter_dialog_setup = function () { var that = this; diff --git a/install/static/certificate.js b/install/static/certificate.js index 5d4313ef1..3325fb485 100755..100644 --- a/install/static/certificate.js +++ b/install/static/certificate.js @@ -392,7 +392,7 @@ function certificate_status_widget(spec) { spec = spec || {}; - var that = ipa_widget(spec); + var that = IPA.widget(spec); that.entity_label = spec.entity_label || that.entity_name; @@ -497,10 +497,10 @@ function certificate_status_widget(spec) { that.missing = $('.status-missing', that.container); var button = $('input[name=get]', that.container); - that.get_button = ipa_button({ + that.get_button = IPA.button({ 'label': 'Get', 'click': function() { - ipa_cmd(that.entity_name+'_show', [that.pkey], {}, + IPA.cmd(that.entity_name+'_show', [that.pkey], {}, function(data, text_status, xhr) { get_certificate(data.result.result); } @@ -510,10 +510,10 @@ function certificate_status_widget(spec) { button.replaceWith(that.get_button); button = $('input[name=revoke]', that.container); - that.revoke_button = ipa_button({ + that.revoke_button = IPA.button({ 'label': 'Revoke', 'click': function() { - ipa_cmd(that.entity_name+'_show', [that.pkey], {}, + IPA.cmd(that.entity_name+'_show', [that.pkey], {}, function(data, text_status, xhr) { revoke_certificate(data.result.result); } @@ -523,10 +523,10 @@ function certificate_status_widget(spec) { button.replaceWith(that.revoke_button); button = $('input[name=view]', that.container); - that.view_button = ipa_button({ + that.view_button = IPA.button({ 'label': 'View', 'click': function() { - ipa_cmd(that.entity_name+'_show', [that.pkey], {}, + IPA.cmd(that.entity_name+'_show', [that.pkey], {}, function(data, text_status, xhr) { view_certificate(data.result.result); } @@ -538,10 +538,10 @@ function certificate_status_widget(spec) { that.revocation_reason = $('span[name=revocation_reason]', that.container); button = $('input[name=restore]', that.container); - that.restore_button = ipa_button({ + that.restore_button = IPA.button({ 'label': 'Restore', 'click': function() { - ipa_cmd(that.entity_name+'_show', [that.pkey], {}, + IPA.cmd(that.entity_name+'_show', [that.pkey], {}, function(data, text_status, xhr) { restore_certificate(data.result.result); } @@ -551,7 +551,7 @@ function certificate_status_widget(spec) { button.replaceWith(that.restore_button); button = $('input[name=create]', that.container); - that.create_button = ipa_button({ + that.create_button = IPA.button({ 'label': 'New Certificate', 'click': function() { request_certificate(that.result); @@ -595,7 +595,7 @@ function certificate_status_widget(spec) { return; } - ipa_cmd( + IPA.cmd( 'cert_show', [serial_number], { }, @@ -662,7 +662,7 @@ function certificate_status_widget(spec) { 'request': function(values) { var request = values['request']; - ipa_cmd( + IPA.cmd( 'cert_request', [request], { @@ -694,7 +694,7 @@ function certificate_status_widget(spec) { 'revoke': function(values) { var reason = values['reason']; - ipa_cmd( + IPA.cmd( 'cert_revoke', [serial_number], { @@ -724,7 +724,7 @@ function certificate_status_widget(spec) { var dialog = certificate_restore_dialog({ 'title': 'Restore Certificate for '+that.entity_label+' '+entity_name, 'restore': function(values) { - ipa_cmd( + IPA.cmd( 'cert_remove_hold', [serial_number], { }, diff --git a/install/static/details.js b/install/static/details.js index b2dd26330..84dbe8b52 100644 --- a/install/static/details.js +++ b/install/static/details.js @@ -34,11 +34,11 @@ IPA.is_field_writable = function(rights){ return rights.indexOf('w') > -1; }; -function ipa_details_field(spec) { +IPA.details_field = function (spec) { spec = spec || {}; - var that = ipa_widget(spec); + var that = IPA.widget(spec); that.load = spec.load || load; that.save = spec.save || save; @@ -60,7 +60,7 @@ function ipa_details_field(spec) { var hint_span = null; var dd; - var param_info = ipa_get_param_info(that.entity_name, that.name); + var param_info = IPA.get_param_info(that.entity_name, that.name); if (param_info) { if (param_info['multivalue'] || param_info['class'] == 'List') multivalue = true; @@ -87,31 +87,30 @@ function ipa_details_field(spec) { that.values = [that.values]; } - - dd = ipa_create_first_dd(that.name); + dd = IPA.create_first_dd(that.name); dd.append(that.create_value(that.values[0], hint_span, rights, 0)); dd.appendTo(that.container); for (var i = 1; i < that.values.length; ++i) { - dd = ipa_create_other_dd(that.name); + dd = IPA.create_other_dd(that.name); dd.append(that.create_value(that.values[i], hint_span, rights, i)); dd.appendTo(that.container); } if (multivalue && IPA.is_field_writable(rights) ) { - dd = ipa_create_other_dd(that.name); - dd.append(ipa_details_field_create_add_link.call(that, that.name, rights, that.values.length)); + dd = IPA.create_other_dd(that.name); + dd.append(IPA.details_field_create_add_link.call(that, that.name, rights, that.values.length)); dd.appendTo(that.container); } } else { if (multivalue && IPA.is_field_writable(rights)) { - dd = ipa_create_first_dd(that.name); - dd.append(ipa_details_field_create_add_link.call(that, that.name, rights, 0)); + dd = IPA.create_first_dd(that.name); + dd.append(IPA.details_field_create_add_link.call(that, that.name, rights, 0)); dd.appendTo(that.container); } else { - dd = ipa_create_first_dd(that.name); + dd = IPA.create_first_dd(that.name); dd.append(that.create_value('', hint_span, rights, 0)); dd.appendTo(that.container); } @@ -130,7 +129,7 @@ function ipa_details_field(spec) { if (!IPA.is_field_writable(rights)) return label; - var param_info = ipa_get_param_info(that.entity_name, that.name); + var param_info = IPA.get_param_info(that.entity_name, that.name); if (param_info) { if (param_info['primary_key']) return label; if ('no_update' in param_info['flags']) return label; @@ -241,7 +240,7 @@ function ipa_details_field(spec) { return that; } -function ipa_details_section(spec){ +IPA.details_section = function (spec){ spec = spec || {}; @@ -280,34 +279,33 @@ function ipa_details_section(spec){ that.create_field = function(spec) { - //TODO: replace ipa_details_field with class-specific implementation + //TODO: replace IPA.details_field with class-specific implementation //Valid field classes: Str, IA5Str, Int, Bool and List - - var field = ipa_details_field(spec); + var field = IPA.details_field(spec); that.add_field(field); return field; }; that.create_text = function(spec) { - var field = ipa_text_widget(spec); + var field = IPA.text_widget(spec); that.add_field(field); return field; }; that.create_radio = function(spec) { - var field = ipa_radio_widget(spec); + var field = IPA.radio_widget(spec); that.add_field(field); return field; }; that.create_textarea = function(spec) { - var field = ipa_textarea_widget(spec); + var field = IPA.textarea_widget(spec); that.add_field(field); return field; }; that.create_button = function(spec) { - var field = ipa_button_widget(spec); + var field = IPA.button_widget(spec); that.add_field(field); return field; }; @@ -415,11 +413,11 @@ function ipa_details_section(spec){ * * </dl> */ -function ipa_details_list_section(spec){ +IPA.details_list_section = function (spec){ spec = spec || {}; - var that = ipa_details_section(spec); + var that = IPA.details_section(spec); that.create = function(container) { @@ -458,11 +456,11 @@ function ipa_details_list_section(spec){ } // shorthand notation used for declarative definitions of details pages -function ipa_stanza(spec) { +IPA.stanza = function (spec) { spec = spec || {}; - var that = ipa_details_list_section(spec); + var that = IPA.details_list_section(spec); // This is to allow declarative style programming for details that.input = function(spec) { @@ -478,19 +476,19 @@ function ipa_stanza(spec) { return that; } -function ipa_details_facet(spec) { +IPA.details_facet = function (spec) { spec = spec || {}; - var that = ipa_facet(spec); + var that = IPA.facet(spec); that.is_dirty = spec.is_dirty || is_dirty; that.create = spec.create || create; that.setup = spec.setup || setup; that.load = spec.load || load; - that.update = spec.update || ipa_details_update; + that.update = spec.update || IPA.details_update; that.reset = spec.reset || reset; - that.refresh = spec.refresh || ipa_details_refresh; + that.refresh = spec.refresh || IPA.details_refresh; that.sections = []; that.sections_by_name = {}; @@ -519,7 +517,7 @@ function ipa_details_facet(spec) { }; that.create_section = function(spec) { - var section = ipa_details_section(spec); + var section = IPA.details_section(spec); that.add_section(section); return section; }; @@ -675,12 +673,12 @@ function ipa_details_facet(spec) { } IPA.action_button = function(spec) { - var button = ipa_button(spec); + var button = IPA.button(spec); button.removeClass("ui-state-default").addClass("action-button"); return button; }; -function ipa_button(spec) { +IPA.button = function(spec) { spec = spec || {}; @@ -698,7 +696,7 @@ function ipa_button(spec) { return button; } -function ipa_details_refresh() { +IPA.details_refresh = function () { var that = this; @@ -718,11 +716,11 @@ function ipa_details_refresh() { var params = []; if (that.pkey) params.push(that.pkey); - ipa_cmd( 'show', params, {all: true, rights: true}, on_success, on_failure, + IPA.cmd( 'show', params, {all: true, rights: true}, on_success, on_failure, that.entity_name ); } -function ipa_details_update(on_win, on_fail) +IPA.details_update = function (on_win, on_fail) { var that = this; var entity_name = that.entity_name; @@ -772,7 +770,7 @@ function ipa_details_update(on_win, on_fail) values = field.save(); if (!values) continue; - var param_info = ipa_get_param_info(entity_name, field.name); + var param_info = IPA.get_param_info(entity_name, field.name); if (param_info) { if (param_info['primary_key']) continue; if (values.length === 1) { @@ -796,17 +794,11 @@ function ipa_details_update(on_win, on_fail) } } - ipa_cmd('mod', [pkey], modlist, update_on_win, null, entity_name); + IPA.cmd('mod', [pkey], modlist, update_on_win, null, entity_name); } -/* HTML templates for ipa_details_display() */ -var _ipa_span_doc_template = '<span class="attrhint">Hint: D</span>'; -var _ipa_span_hint_template = '<span class="attrhint">Hint: D</span>'; - - - -function ipa_create_first_dd(field_name, content){ +IPA.create_first_dd = function (field_name, content){ var dd = $('<dd/>', { 'class': 'first', 'title': field_name @@ -815,24 +807,13 @@ function ipa_create_first_dd(field_name, content){ return dd; } -function ipa_create_other_dd(field_name, content){ +IPA.create_other_dd = function (field_name, content){ return $('<dd/>', { 'class': 'other', 'title': field_name }).append(content); } -function ipa_insert_first_dd(jobj, content){ - ipa_insert_dd(jobj, content, "first"); -} - -function ipa_insert_dd(jobj, content, dd_class){ - jobj.after( $('<dd/>',{ - "class": dd_class - }).append(content)); -} - - /* creates a Remove link for deleting attribute values */ function _ipa_create_remove_link(attr, param_info) @@ -853,8 +834,7 @@ function _ipa_create_remove_link(attr, param_info) } - -function ipa_details_field_create_add_link(title, rights, index) { +IPA.details_field_create_add_link = function (title, rights, index) { var that = this; @@ -864,14 +844,14 @@ function ipa_details_field_create_add_link(title, rights, index) { 'html': 'Add', 'click': function () { - var param_info = ipa_get_param_info(that.entity_name, ''); + var param_info = IPA.get_param_info(that.entity_name, ''); var input = that.create_input('', param_info, rights, index); link.replaceWith(input); input.focus(); - var dd = ipa_create_other_dd(that.name); - dd.append(ipa_details_field_create_add_link.call(that, that.name, rights, index+1)); + var dd = IPA.create_other_dd(that.name); + dd.append(IPA.details_field_create_add_link.call(that, that.name, rights, index+1)); dd.appendTo(that.container); return false; diff --git a/install/static/entity.js b/install/static/entity.js index d45858fe2..38ce47ed7 100644 --- a/install/static/entity.js +++ b/install/static/entity.js @@ -22,7 +22,7 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js */ -function ipa_facet(spec) { +IPA.facet = function (spec) { spec = spec || {}; @@ -45,7 +45,7 @@ function ipa_facet(spec) { that._entity_name = entity_name; }); - that.create_action_panel = ipa_facet_create_action_panel; + that.create_action_panel = IPA.facet_create_action_panel; function init() { } @@ -75,7 +75,7 @@ function ipa_facet(spec) { return that; } -function ipa_entity(spec) { +IPA.entity = function (spec) { spec = spec || {}; @@ -83,7 +83,7 @@ function ipa_entity(spec) { that.name = spec.name; that.label = spec.label; - that.setup = spec.setup || ipa_entity_setup; + that.setup = spec.setup || IPA.entity_setup; that.dialogs = []; that.dialogs_by_name = {}; @@ -132,7 +132,7 @@ function ipa_entity(spec) { }; that.create_association = function(spec) { - var config = ipa_association_config(spec); + var config = IPA.association_config(spec); that.add_association(config); return config; }; @@ -140,11 +140,11 @@ function ipa_entity(spec) { that.create_association_facet = function(attribute_member, other_entity, label, facet_group) { if (!attribute_member) { - attribute_member = ipa_get_member_attribute( + attribute_member = IPA.get_member_attribute( that.entity_name, other_entity); } - return ipa_association_facet({ + return IPA.association_facet({ 'name': attribute_member+'_'+other_entity, 'label': label, 'other_entity': other_entity, @@ -212,12 +212,13 @@ function ipa_entity(spec) { /* use this to track individual changes between two hashchange events */ var window_hash_cache = {}; -function ipa_get_entity(entity_name) { +/*renamed to avoid clash with IPA.get_entity*/ +IPA.fetch_entity = function (entity_name) { var entity = IPA.get_entity(entity_name); if (entity) return entity; - entity = ipa_entity({ + entity = IPA.entity({ 'name': entity_name }); @@ -225,14 +226,14 @@ function ipa_get_entity(entity_name) { return entity; } -function ipa_entity_get_search_facet(entity_name) { +IPA.entity_get_search_facet = function (entity_name) { - var entity = ipa_get_entity(entity_name); + var entity = IPA.fetch_entity(entity_name); var facet = entity.get_facet('search'); if (facet) return facet; - facet = ipa_search_facet({ + facet = IPA.search_facet({ 'name': 'search', 'label': 'Search' }); @@ -241,9 +242,9 @@ function ipa_entity_get_search_facet(entity_name) { return facet; } -function ipa_entity_set_search_definition(entity_name, data) { +IPA.entity_set_search_definition = function (entity_name, data) { - var facet = ipa_entity_get_search_facet(entity_name); + var facet = IPA.entity_get_search_facet(entity_name); for (var i=0; i<data.length; i++) { var defn = data[i]; @@ -255,11 +256,11 @@ function ipa_entity_set_search_definition(entity_name, data) { } } -function ipa_entity_set_add_definition(entity_name, data) { +IPA.entity_set_add_definition = function (entity_name, data) { - var entity = ipa_get_entity(entity_name); + var entity = IPA.fetch_entity(entity_name); - var dialog = ipa_add_dialog({ + var dialog = IPA.add_dialog({ 'name': 'add', 'title': data[1] }); @@ -267,7 +268,7 @@ function ipa_entity_set_add_definition(entity_name, data) { for (var i=0; i<data[2].length; i++) { var field = data[2][i]; - dialog.add_field(ipa_text_widget({ + dialog.add_field(IPA.text_widget({ name: field[0], label: field[1], setup: field[2], @@ -278,20 +279,20 @@ function ipa_entity_set_add_definition(entity_name, data) { dialog.init(); } -function ipa_entity_get_add_dialog(entity_name) { +IPA.entity_get_add_dialog = function (entity_name) { - var entity = ipa_get_entity(entity_name); + var entity = IPA.fetch_entity(entity_name); return entity.get_add_dialog(); } -function ipa_entity_get_details_facet(entity_name) { +IPA.entity_get_details_facet = function (entity_name) { - var entity = ipa_get_entity(entity_name); + var entity = IPA.fetch_entity(entity_name); var facet = entity.get_facet('details'); if (facet) return facet; - facet = ipa_details_facet({ + facet = IPA.details_facet({ 'name': 'details', 'label': 'Details' }); @@ -300,9 +301,9 @@ function ipa_entity_get_details_facet(entity_name) { return facet; } -function ipa_entity_set_details_definition(entity_name, sections) { +IPA.entity_set_details_definition = function (entity_name, sections) { - var facet = ipa_entity_get_details_facet(entity_name); + var facet = IPA.entity_get_details_facet(entity_name); for (var i=0; i<sections.length; i++) { var section = sections[i]; @@ -310,9 +311,9 @@ function ipa_entity_set_details_definition(entity_name, sections) { } } -function ipa_entity_set_association_definition(entity_name, data) { +IPA.entity_set_association_definition = function (entity_name, data) { - var entity = ipa_get_entity(entity_name); + var entity = IPA.fetch_entity(entity_name); entity.autogenerate_associations = true; @@ -327,9 +328,9 @@ function ipa_entity_set_association_definition(entity_name, data) { } } -function ipa_entity_set_facet_definition(entity_name, list) { +IPA.entity_set_facet_definition = function (entity_name, list) { - var entity = ipa_get_entity(entity_name); + var entity = IPA.fetch_entity(entity_name); for (var i=0; i<list.length; i++) { var facet = list[i]; @@ -337,7 +338,7 @@ function ipa_entity_set_facet_definition(entity_name, list) { } } -function ipa_current_facet(entity){ +IPA.current_facet = function (entity){ var facet_name = $.bbq.getState(entity.name + '-facet', true); if (!facet_name && entity.facets.length) { facet_name = entity.facets[0].name; @@ -345,11 +346,11 @@ function ipa_current_facet(entity){ return facet_name; } -function ipa_entity_setup(container) { +IPA.entity_setup = function (container) { var entity = this; - var facet_name = ipa_current_facet(entity); + var facet_name = IPA.current_facet(entity); var facet = entity.get_facet(facet_name); @@ -433,9 +434,7 @@ IPA.nested_tabs = function(entity_name){ return siblings; }; - - -function ipa_facet_create_action_panel(container) { +IPA. facet_create_action_panel = function(container) { var that = this; var entity_name = that.entity_name; @@ -474,7 +473,7 @@ function ipa_facet_create_action_panel(container) { }).appendTo(action_panel); var ul = $('<ul/>', {'class': 'action'}).appendTo(action_panel); var entity = IPA.get_entity(entity_name); - var facet_name = ipa_current_facet(entity); + var facet_name = IPA.current_facet(entity); var other_facet = entity.facets[0]; var other_facet_name = other_facet.name; var nested_tabs = IPA.nested_tabs(entity_name); @@ -486,7 +485,7 @@ function ipa_facet_create_action_panel(container) { /*assume for now that entities with only a single facet do not have search*/ if (entity.facets.length > 0 ){ - if ( entity.facets[0].name === ipa_current_facet( entity)){ + if ( entity.facets[0].name === IPA.current_facet( entity)){ main_facet.text( IPA.metadata[entity_name].label); main_facet.appendTo(ul); ul.append($('<li><span class="action-controls"/></li>')); @@ -528,7 +527,7 @@ function ipa_facet_create_action_panel(container) { If we are on the current facet, we make the text black, non-clickable, add an icon and make suer the action controls are positioned underneath it. */ - if ( other_facet.name === ipa_current_facet( entity)){ + if ( other_facet.name === IPA.current_facet( entity)){ var text = link.text(); link.text(''); link.append($('<ul>'). @@ -548,7 +547,7 @@ function ipa_facet_create_action_panel(container) { } else { var innerlist = $('<ul/>').appendTo(ul); innerlist.append(build_link(other_facet, other_facet.label)); - if ( other_facet.name === ipa_current_facet( entity)){ + if ( other_facet.name === IPA.current_facet( entity)){ innerlist.append($('<li class="entity-facet"><span class="action-controls" /></li>')); } } diff --git a/install/static/group.js b/install/static/group.js index 6d11bd564..aef5ca000 100644 --- a/install/static/group.js +++ b/install/static/group.js @@ -20,9 +20,9 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ -function ipa_group() { +IPA.group = function () { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'group' }); @@ -43,20 +43,20 @@ function ipa_group() { associator: 'serial' }); - var dialog = ipa_group_add_dialog({ + var dialog = IPA.group_add_dialog({ 'name': 'add', 'title': 'Add New Group' }); that.add_dialog(dialog); dialog.init(); - var facet = ipa_group_search_facet({ + var facet = IPA.group_search_facet({ 'name': 'search', 'label': 'Search' }); that.add_facet(facet); - facet = ipa_group_details_facet({ + facet = IPA.group_details_facet({ 'name': 'details', 'label': 'Details' }); @@ -70,25 +70,25 @@ function ipa_group() { return that; } -IPA.add_entity(ipa_group()); +IPA.add_entity(IPA.group()); -function ipa_group_add_dialog(spec) { +IPA.group_add_dialog = function (spec) { spec = spec || {}; - var that = ipa_add_dialog(spec); + var that = IPA.add_dialog(spec); that.init = function() { - that.add_field(ipa_text_widget({name:'cn', undo: false})); - that.add_field(ipa_text_widget({name:'description', undo: false})); + that.add_field(IPA.text_widget({name:'cn', undo: false})); + that.add_field(IPA.text_widget({name:'description', undo: false})); // TODO: Replace with i18n label - that.add_field(ipa_checkbox_widget({ + that.add_field(IPA.checkbox_widget({ name:'posix', label:'Is this a POSIX group?', undo: false, checked:'checked'})); - that.add_field(ipa_text_widget({name:'gidnumber', undo: false})); + that.add_field(IPA.text_widget({name:'gidnumber', undo: false})); that.add_dialog_init(); }; @@ -96,11 +96,11 @@ function ipa_group_add_dialog(spec) { return that; } -function ipa_group_search_facet(spec) { +IPA.group_search_facet = function (spec) { spec = spec || {}; - var that = ipa_search_facet(spec); + var that = IPA.search_facet(spec); that.init = function() { that.create_column({name:'cn'}); @@ -112,15 +112,15 @@ function ipa_group_search_facet(spec) { return that; } -function ipa_group_details_facet(spec) { +IPA.group_details_facet = function (spec) { spec = spec || {}; - var that = ipa_details_facet(spec); + var that = IPA.details_facet(spec); that.init = function() { - var section = ipa_details_list_section({ + var section = IPA.details_list_section({ name: 'details', label: 'Group Details' }); @@ -136,11 +136,11 @@ function ipa_group_details_facet(spec) { return that; } -function ipa_group_member_user_facet(spec) { +IPA.group_member_user_facet = function (spec) { spec = spec || {}; - var that = ipa_association_facet(spec); + var that = IPA.association_facet(spec); that.init = function() { diff --git a/install/static/hbacrule.js b/install/static/hbacrule.js index d1b402388..70c4eba9f 100755..100644 --- a/install/static/hbacrule.js +++ b/install/static/hbacrule.js @@ -20,28 +20,28 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ -function ipa_hbacrule() { +IPA.hbacrule = function () { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'hbacrule' }); that.init = function() { - var dialog = ipa_hbacrule_add_dialog({ + var dialog = IPA.hbacrule_add_dialog({ 'name': 'add', 'title': 'Add New Rule' }); that.add_dialog(dialog); dialog.init(); - var facet = ipa_hbacrule_search_facet({ + var facet = IPA.hbacrule_search_facet({ 'name': 'search', 'label': 'Search' }); that.add_facet(facet); - facet = ipa_hbacrule_details_facet({ + facet = IPA.hbacrule_details_facet({ 'name': 'details', 'label': 'Details' }); @@ -53,22 +53,22 @@ function ipa_hbacrule() { return that; } -IPA.add_entity(ipa_hbacrule()); +IPA.add_entity(IPA.hbacrule()); -function ipa_hbacrule_add_dialog(spec) { +IPA.hbacrule_add_dialog = function (spec) { spec = spec || {}; - var that = ipa_add_dialog(spec); + var that = IPA.add_dialog(spec); that.init = function() { - that.add_field(ipa_text_widget({ + that.add_field(IPA.text_widget({ 'name': 'cn', 'undo': false })); - that.add_field(ipa_radio_widget({ + that.add_field(IPA.radio_widget({ 'name': 'accessruletype', 'options': [ { 'value': 'allow', 'label': 'Allow' }, @@ -83,11 +83,11 @@ function ipa_hbacrule_add_dialog(spec) { return that; } -function ipa_hbacrule_search_facet(spec) { +IPA.hbacrule_search_facet = function (spec) { spec = spec || {}; - var that = ipa_search_facet(spec); + var that = IPA.search_facet(spec); that.init = function() { @@ -110,11 +110,11 @@ function ipa_hbacrule_search_facet(spec) { 'style': 'float: left;' }).appendTo(container); - left_buttons.append(ipa_button({ + left_buttons.append(IPA.button({ 'label': 'Troubleshoot Rules' })); - left_buttons.append(ipa_button({ + left_buttons.append(IPA.button({ 'label': 'Cull Disabled Rules' })); */ @@ -126,11 +126,11 @@ function ipa_hbacrule_search_facet(spec) { return that; } -function ipa_hbacrule_details_facet(spec) { +IPA.hbacrule_details_facet = function (spec) { spec = spec || {}; - var that = ipa_details_facet(spec); + var that = IPA.details_facet(spec); that.init = function() { @@ -144,7 +144,7 @@ function ipa_hbacrule_details_facet(spec) { }); } else { - section = ipa_hbacrule_details_general_section({ + section = IPA.hbacrule_details_general_section({ 'name': 'general', 'label': 'General' }); @@ -164,7 +164,7 @@ function ipa_hbacrule_details_facet(spec) { }); } else { - section = ipa_rule_details_section({ + section = IPA.rule_details_section({ 'name': 'user', 'label': 'Who', 'text': 'Rule applies when access is requested by:', @@ -182,12 +182,12 @@ function ipa_hbacrule_details_facet(spec) { } var category = section.create_radio({ name: 'usercategory', label: 'User category' }); - section.add_field(ipa_rule_association_table_widget({ + section.add_field(IPA.rule_association_table_widget({ 'id': that.entity_name+'-memberuser_user', 'name': 'memberuser_user', 'label': 'Users', 'category': category, 'other_entity': 'user', 'add_method': 'add_user', 'remove_method': 'remove_user' })); - section.add_field(ipa_rule_association_table_widget({ + section.add_field(IPA.rule_association_table_widget({ 'id': that.entity_name+'-memberuser_group', 'name': 'memberuser_group', 'label': 'Groups', 'category': category, 'other_entity': 'group', 'add_method': 'add_user', 'remove_method': 'remove_user' @@ -201,7 +201,7 @@ function ipa_hbacrule_details_facet(spec) { }); } else { - section = ipa_rule_details_section({ + section = IPA.rule_details_section({ 'name': 'host', 'label': 'Accessing', 'text': 'Rule applies when access is requested to:', @@ -219,12 +219,12 @@ function ipa_hbacrule_details_facet(spec) { } category = section.create_radio({ 'name': 'hostcategory', 'label': 'Host category' }); - section.add_field(ipa_rule_association_table_widget({ + section.add_field(IPA.rule_association_table_widget({ 'id': that.entity_name+'-memberhost_host', 'name': 'memberhost_host', 'label': 'Hosts', 'category': category, 'other_entity': 'host', 'add_method': 'add_host', 'remove_method': 'remove_host' })); - section.add_field(ipa_rule_association_table_widget({ + section.add_field(IPA.rule_association_table_widget({ 'id': that.entity_name+'-memberhost_hostgroup', 'name': 'memberhost_hostgroup', 'label': 'Host Groups', 'category': category, 'other_entity': 'hostgroup', 'add_method': 'add_host', 'remove_method': 'remove_host' @@ -238,7 +238,7 @@ function ipa_hbacrule_details_facet(spec) { }); } else { - section = ipa_rule_details_section({ + section = IPA.rule_details_section({ 'name': 'service', 'label': 'Via Service', 'text': 'Rule applies when access is requested via:', @@ -256,12 +256,12 @@ function ipa_hbacrule_details_facet(spec) { } category = section.create_radio({ 'name': 'servicecategory', 'label': 'Service category' }); - section.add_field(ipa_rule_association_table_widget({ + section.add_field(IPA.rule_association_table_widget({ 'id': that.entity_name+'-memberservice_hbacsvc', 'name': 'memberservice_hbacsvc', 'label': 'Services', 'category': category, 'other_entity': 'hbacsvc', 'add_method': 'add_service', 'remove_method': 'remove_service' })); - section.add_field(ipa_rule_association_table_widget({ + section.add_field(IPA.rule_association_table_widget({ 'id': that.entity_name+'-memberservice_hbacsvcgroup', 'name': 'memberservice_hbacsvcgroup', 'label': 'Service Groups', 'category': category, 'other_entity': 'hbacsvcgroup', 'add_method': 'add_service', 'remove_method': 'remove_service' @@ -275,7 +275,7 @@ function ipa_hbacrule_details_facet(spec) { }); } else { - section = ipa_rule_details_section({ + section = IPA.rule_details_section({ 'name': 'sourcehost', 'label': 'From', 'text': 'Rule applies when access is being initiated from:', @@ -293,12 +293,12 @@ function ipa_hbacrule_details_facet(spec) { } category = section.create_radio({ 'name': 'sourcehostcategory', 'label': 'Source host category' }); - section.add_field(ipa_rule_association_table_widget({ + section.add_field(IPA.rule_association_table_widget({ 'id': that.entity_name+'-sourcehost_host', 'name': 'sourcehost_host', 'label': 'Host', 'category': category, 'other_entity': 'host', 'add_method': 'add_sourcehost', 'remove_method': 'remove_sourcehost' })); - section.add_field(ipa_rule_association_table_widget({ + section.add_field(IPA.rule_association_table_widget({ 'id': that.entity_name+'-sourcehost_hostgroup', 'name': 'sourcehost_hostgroup', 'label': 'Host Groups', 'category': category, 'other_entity': 'hostgroup', 'add_method': 'add_sourcehost', 'remove_method': 'remove_sourcehost' @@ -337,7 +337,7 @@ function ipa_hbacrule_details_facet(spec) { var modify_operation = { 'execute': false, - 'command': ipa_command({ + 'command': IPA.command({ 'method': that.entity_name+'_mod', 'args': [pkey], 'options': {'all': true, 'rights': true} @@ -345,7 +345,7 @@ function ipa_hbacrule_details_facet(spec) { }; var remove_accesstime = { - 'template': ipa_command({ + 'template': IPA.command({ 'method': that.entity_name+'_remove_accesstime', 'args': [pkey], 'options': {'all': true, 'rights': true} @@ -372,7 +372,7 @@ function ipa_hbacrule_details_facet(spec) { 'memberuser': { 'category': 'usercategory', 'has_values': false, - 'command': ipa_command({ + 'command': IPA.command({ 'method': that.entity_name+'_remove_user', 'args': [pkey], 'options': {'all': true, 'rights': true} @@ -381,7 +381,7 @@ function ipa_hbacrule_details_facet(spec) { 'memberhost': { 'category': 'hostcategory', 'has_values': false, - 'command': ipa_command({ + 'command': IPA.command({ 'method': that.entity_name+'_remove_host', 'args': [pkey], 'options': {'all': true, 'rights': true} @@ -390,7 +390,7 @@ function ipa_hbacrule_details_facet(spec) { 'memberservice': { 'category': 'servicecategory', 'has_values': false, - 'command': ipa_command({ + 'command': IPA.command({ 'method': that.entity_name+'_remove_service', 'args': [pkey], 'options': {'all': true, 'rights': true} @@ -399,7 +399,7 @@ function ipa_hbacrule_details_facet(spec) { 'sourcehost': { 'category': 'sourcehostcategory', 'has_values': false, - 'command': ipa_command({ + 'command': IPA.command({ 'method': that.entity_name+'_remove_sourcehost', 'args': [pkey], 'options': {'all': true, 'rights': true} @@ -409,7 +409,7 @@ function ipa_hbacrule_details_facet(spec) { var enable_operation = { 'execute': false, - 'command': ipa_command({ + 'command': IPA.command({ 'method': that.entity_name+'_enable', 'args': [pkey], 'options': {'all': true, 'rights': true} @@ -428,7 +428,7 @@ function ipa_hbacrule_details_facet(spec) { var values = field.save(); if (!values) continue; - var param_info = ipa_get_param_info(that.entity_name, field.name); + var param_info = IPA.get_param_info(that.entity_name, field.name); // skip primary key if (param_info && param_info['primary_key']) continue; @@ -460,7 +460,7 @@ function ipa_hbacrule_details_facet(spec) { // if accesstime is dirty, it means 'Any Time' is selected, // so existing values have to be removed for (var k=0; k<field.values.length; k++) { - var command = ipa_command(remove_accesstime.template); + var command = IPA.command(remove_accesstime.template); command.set_option(field.name, field.values[k]); remove_accesstime.commands.push(command); } @@ -494,7 +494,7 @@ function ipa_hbacrule_details_facet(spec) { } } - var batch = ipa_batch_command({ + var batch = IPA.batch_command({ 'name': 'hbac_details_update', 'on_success': function(data, text_status, xhr) { that.refresh(); @@ -537,11 +537,11 @@ function ipa_hbacrule_details_facet(spec) { return that; } -function ipa_hbacrule_details_general_section(spec){ +IPA.hbacrule_details_general_section = function (spec){ spec = spec || {}; - var that = ipa_details_section(spec); + var that = IPA.details_section(spec); that.create = function(container) { @@ -678,11 +678,11 @@ function ipa_hbacrule_details_general_section(spec){ return that; } -function ipa_hbacrule_accesstime_widget(spec) { +IPA.hbacrule_accesstime_widget = function (spec) { spec = spec || {}; - var that = ipa_widget(spec); + var that = IPA.widget(spec); that.text = spec.text; that.options = spec.options || []; @@ -691,7 +691,7 @@ function ipa_hbacrule_accesstime_widget(spec) { that.widget_init(); - that.table = ipa_table_widget({ + that.table = IPA.table_widget({ 'id': 'accesstime-table', 'name': 'table', 'label': that.label }); @@ -763,14 +763,14 @@ function ipa_hbacrule_accesstime_widget(spec) { that.table.setup(span); var button = $('input[name=remove]', span); - button.replaceWith(ipa_button({ + button.replaceWith(IPA.button({ 'label': button.val(), 'icon': 'ui-icon-trash', 'click': function() { that.remove(that.container); } })); button = $('input[name=add]', span); - button.replaceWith(ipa_button({ + button.replaceWith(IPA.button({ 'label': button.val(), 'icon': 'ui-icon-plus', 'click': function() { that.add(that.container); } @@ -823,11 +823,11 @@ function ipa_hbacrule_accesstime_widget(spec) { var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || ''; var title = 'Add '+that.label+' to '+that.entity_name+' '+pkey; - var dialog = ipa_dialog({ + var dialog = IPA.dialog({ 'title': title }); - dialog.add_field(ipa_text_widget({ + dialog.add_field(IPA.text_widget({ 'name': that.name, 'label': that.label })); @@ -873,7 +873,7 @@ function ipa_hbacrule_accesstime_widget(spec) { var field = dialog.get_field(that.name); var value = field.save()[0]; - var command = ipa_command({ + var command = IPA.command({ 'method': that.entity_name+'_add_'+that.name, 'args': [pkey], 'on_success': function() { @@ -925,14 +925,14 @@ function ipa_hbacrule_accesstime_widget(spec) { var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || ''; var title = 'Remove '+that.label+' from '+that.entity_name+' '+pkey; - var dialog = ipa_deleter_dialog({ + var dialog = IPA.deleter_dialog({ 'title': title, 'values': values }); dialog.remove = function() { - var batch = ipa_batch_command({ + var batch = IPA.batch_command({ 'on_success': function() { that.refresh(); dialog.close(); @@ -944,7 +944,7 @@ function ipa_hbacrule_accesstime_widget(spec) { }); for (var i=0; i<values.length; i++) { - var command = ipa_command({ + var command = IPA.command({ 'method': that.entity_name+'_remove_'+that.name, 'args': [pkey] }); @@ -976,7 +976,7 @@ function ipa_hbacrule_accesstime_widget(spec) { } var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || ''; - ipa_cmd('show', [pkey], {'rights': true}, on_success, on_error, that.entity_name); + IPA.cmd('show', [pkey], {'rights': true}, on_success, on_error, that.entity_name); }; return that; diff --git a/install/static/hbacsvc.js b/install/static/hbacsvc.js index dd2efee80..b8340dc4f 100755..100644 --- a/install/static/hbacsvc.js +++ b/install/static/hbacsvc.js @@ -20,28 +20,28 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ -function ipa_hbacsvc() { +IPA.hbacsvc = function () { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'hbacsvc' }); that.init = function() { - var dialog = ipa_hbacsvc_add_dialog({ + var dialog = IPA.hbacsvc_add_dialog({ 'name': 'add', 'title': 'Add New HBAC Service' }); that.add_dialog(dialog); dialog.init(); - var facet = ipa_hbacsvc_search_facet({ + var facet = IPA.hbacsvc_search_facet({ 'name': 'search', 'label': 'Search' }); that.add_facet(facet); - facet = ipa_hbacsvc_details_facet({ + facet = IPA.hbacsvc_details_facet({ 'name': 'details', 'label': 'Details' }); @@ -53,18 +53,18 @@ function ipa_hbacsvc() { return that; } -IPA.add_entity(ipa_hbacsvc()); +IPA.add_entity(IPA.hbacsvc()); -function ipa_hbacsvc_add_dialog(spec) { +IPA.hbacsvc_add_dialog = function (spec) { spec = spec || {}; - var that = ipa_add_dialog(spec); + var that = IPA.add_dialog(spec); that.init = function() { - that.add_field(ipa_text_widget({name:'cn', undo: false})); - that.add_field(ipa_text_widget({name:'description', undo: false})); + that.add_field(IPA.text_widget({name:'cn', undo: false})); + that.add_field(IPA.text_widget({name:'description', undo: false})); that.add_dialog_init(); }; @@ -72,11 +72,11 @@ function ipa_hbacsvc_add_dialog(spec) { return that; } -function ipa_hbacsvc_search_facet(spec) { +IPA.hbacsvc_search_facet = function (spec) { spec = spec || {}; - var that = ipa_search_facet(spec); + var that = IPA.search_facet(spec); that.init = function() { @@ -90,15 +90,15 @@ function ipa_hbacsvc_search_facet(spec) { } -function ipa_hbacsvc_details_facet(spec) { +IPA.hbacsvc_details_facet = function (spec) { spec = spec || {}; - var that = ipa_details_facet(spec); + var that = IPA.details_facet(spec); that.init = function() { - var section = ipa_details_list_section({ + var section = IPA.details_list_section({ 'name': 'general', 'label': 'General' }); diff --git a/install/static/hbacsvcgroup.js b/install/static/hbacsvcgroup.js index 6afc58e07..1d8b832ce 100755..100644 --- a/install/static/hbacsvcgroup.js +++ b/install/static/hbacsvcgroup.js @@ -20,9 +20,9 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ -function ipa_hbacsvcgroup() { +IPA.hbacsvcgroup = function () { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'hbacsvcgroup' }); @@ -34,20 +34,20 @@ function ipa_hbacsvcgroup() { 'remove_method': 'remove_member' }); - var dialog = ipa_hbacsvcgroup_add_dialog({ + var dialog = IPA.hbacsvcgroup_add_dialog({ 'name': 'add', 'title': 'Add New HBAC Service Group' }); that.add_dialog(dialog); dialog.init(); - var facet = ipa_hbacsvcgroup_search_facet({ + var facet = IPA.hbacsvcgroup_search_facet({ 'name': 'search', 'label': 'Search' }); that.add_facet(facet); - facet = ipa_hbacsvcgroup_details_facet({ + facet = IPA.hbacsvcgroup_details_facet({ 'name': 'details', 'label': 'Details' }); @@ -59,18 +59,18 @@ function ipa_hbacsvcgroup() { return that; } -IPA.add_entity(ipa_hbacsvcgroup()); +IPA.add_entity(IPA.hbacsvcgroup()); -function ipa_hbacsvcgroup_add_dialog(spec) { +IPA.hbacsvcgroup_add_dialog = function (spec) { spec = spec || {}; - var that = ipa_add_dialog(spec); + var that = IPA.add_dialog(spec); that.init = function() { - that.add_field(ipa_text_widget({name:'cn', undo: false})); - that.add_field(ipa_text_widget({name:'description', undo: false})); + that.add_field(IPA.text_widget({name:'cn', undo: false})); + that.add_field(IPA.text_widget({name:'description', undo: false})); that.add_dialog_init(); }; @@ -78,11 +78,11 @@ function ipa_hbacsvcgroup_add_dialog(spec) { return that; } -function ipa_hbacsvcgroup_search_facet(spec) { +IPA.hbacsvcgroup_search_facet = function (spec) { spec = spec || {}; - var that = ipa_search_facet(spec); + var that = IPA.search_facet(spec); that.init = function() { @@ -97,15 +97,15 @@ function ipa_hbacsvcgroup_search_facet(spec) { } -function ipa_hbacsvcgroup_details_facet(spec) { +IPA.hbacsvcgroup_details_facet = function (spec) { spec = spec || {}; - var that = ipa_details_facet(spec); + var that = IPA.details_facet(spec); that.init = function() { - var section = ipa_details_list_section({ + var section = IPA.details_list_section({ 'name': 'general', 'label': 'General' }); @@ -114,13 +114,13 @@ function ipa_hbacsvcgroup_details_facet(spec) { section.create_field({'name': 'cn'}); section.create_field({'name': 'description'}); - section = ipa_details_section({ + section = IPA.details_section({ 'name': 'services', 'label': 'Services' }); that.add_section(section); - var field = ipa_hbacsvcgroup_member_hbacsvc_table_widget({ + var field = IPA.hbacsvcgroup_member_hbacsvc_table_widget({ 'name': 'member_hbacsvc', 'label': 'Services', 'other_entity': 'hbacsvc', @@ -134,11 +134,11 @@ function ipa_hbacsvcgroup_details_facet(spec) { return that; } -function ipa_hbacsvcgroup_member_hbacsvc_table_widget(spec) { +IPA.hbacsvcgroup_member_hbacsvc_table_widget = function (spec) { spec = spec || {}; - var that = ipa_association_table_widget(spec); + var that = IPA.association_table_widget(spec); that.init = function() { diff --git a/install/static/host.js b/install/static/host.js index be96d79a9..6cd6f7bcf 100644 --- a/install/static/host.js +++ b/install/static/host.js @@ -21,9 +21,9 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ -function ipa_host() { +IPA.host = function () { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'host' }); @@ -39,26 +39,26 @@ function ipa_host() { 'associator': 'serial' }); - var dialog = ipa_host_add_dialog({ + var dialog = IPA.host_add_dialog({ 'name': 'add', 'title': 'Add New Host' }); that.add_dialog(dialog); dialog.init(); - var facet = ipa_host_search_facet({ + var facet = IPA.host_search_facet({ 'name': 'search', 'label': 'Search' }); that.add_facet(facet); - facet = ipa_host_details_facet({ + facet = IPA.host_details_facet({ 'name': 'details', 'label': 'Details' }); that.add_facet(facet); - facet = ipa_host_managedby_host_facet({ + facet = IPA.host_managedby_host_facet({ 'name': 'managedby_host', 'label': IPA.messages.association.managedby+' '+IPA.metadata['host'].label, 'other_entity': 'host' @@ -73,17 +73,17 @@ function ipa_host() { return that; } -IPA.add_entity(ipa_host()); +IPA.add_entity(IPA.host()); -function ipa_host_add_dialog(spec) { +IPA.host_add_dialog = function (spec) { spec = spec || {}; - var that = ipa_add_dialog(spec); + var that = IPA.add_dialog(spec); that.init = function() { - that.add_field(ipa_text_widget({ + that.add_field(IPA.text_widget({ 'name': 'fqdn', 'size': 40, 'undo': false @@ -95,11 +95,11 @@ function ipa_host_add_dialog(spec) { return that; } -function ipa_host_search_facet(spec) { +IPA.host_search_facet = function (spec) { spec = spec || {}; - var that = ipa_search_facet(spec); + var that = IPA.search_facet(spec); that.init = function() { @@ -115,15 +115,15 @@ function ipa_host_search_facet(spec) { return that; } -function ipa_host_details_facet(spec) { +IPA.host_details_facet = function (spec) { spec = spec || {}; - var that = ipa_details_facet(spec); + var that = IPA.details_facet(spec); that.init = function() { - var section = ipa_details_list_section({ + var section = IPA.details_list_section({ 'name': 'details', 'label': 'Host Details' }); @@ -147,7 +147,7 @@ function ipa_host_details_facet(spec) { section.create_field({'name': 'description'}); //TODO: use i18n labels - section = ipa_details_list_section({ + section = IPA.details_list_section({ 'name': 'enrollment', 'label': 'Enrollment' }); @@ -160,7 +160,7 @@ function ipa_host_details_facet(spec) { 'facet': that })); - section = ipa_details_list_section({ + section = IPA.details_list_section({ 'name': 'certificate', 'label': 'Host Certificate' }); @@ -178,7 +178,7 @@ function ipa_host_details_facet(spec) { var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || ''; - var command = ipa_command({ + var command = IPA.command({ 'name': that.entity_name+'_show_'+pkey, 'method': that.entity_name+'_show', 'args': [pkey], @@ -206,7 +206,7 @@ function host_provisioning_status_widget(spec) { spec = spec || {}; - var that = ipa_widget(spec); + var that = IPA.widget(spec); that.facet = spec.facet; @@ -276,7 +276,7 @@ function host_provisioning_status_widget(spec) { that.missing = $('.status-missing', that.container); var button = $('input[name=unprovision]', that.container); - that.unprovision_button = ipa_button({ + that.unprovision_button = IPA.button({ 'label': 'Delete Key, Unprovision', 'click': that.show_unprovision_dialog }); @@ -285,7 +285,7 @@ function host_provisioning_status_widget(spec) { that.otp_input = $('input[name=otp]', that.container); that.enroll_button = $('input[name=enroll]', that.container); - button = ipa_button({ + button = IPA.button({ 'label': 'Set OTP', 'click': that.set_otp }); @@ -297,7 +297,7 @@ function host_provisioning_status_widget(spec) { that.show_unprovision_dialog = function() { var label = IPA.metadata[that.entity_name].label; - var dialog = ipa_dialog({ + var dialog = IPA.dialog({ 'title': 'Unprovisioning '+label }); @@ -334,7 +334,7 @@ function host_provisioning_status_widget(spec) { var pkey = that.facet.get_primary_key(); - var command = ipa_command({ + var command = IPA.command({ 'name': that.entity_name+'_disable_'+pkey, 'method': that.entity_name+'_disable', 'args': [pkey], @@ -352,7 +352,7 @@ function host_provisioning_status_widget(spec) { var otp = that.otp_input.val(); that.otp_input.val(''); - var command = ipa_command({ + var command = IPA.command({ 'method': that.entity_name+'_mod', 'args': [pkey], 'options': { @@ -419,11 +419,11 @@ function host_certificate_status_widget(spec) { return that; } -function ipa_host_managedby_host_facet(spec) { +IPA.host_managedby_host_facet = function (spec) { spec = spec || {}; - var that = ipa_association_facet(spec); + var that = IPA.association_facet(spec); that.add_method = 'add_managedby'; that.remove_method = 'remove_managedby'; diff --git a/install/static/hostgroup.js b/install/static/hostgroup.js index 30383013c..6e5095098 100644 --- a/install/static/hostgroup.js +++ b/install/static/hostgroup.js @@ -22,11 +22,11 @@ IPA.add_entity( function() { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'hostgroup' }); that.init = function() { - var search_facet = ipa_search_facet({ + var search_facet = IPA.search_facet({ name: 'search', label: 'Search', entity_name: that.name @@ -36,23 +36,23 @@ IPA.add_entity( function() { that.add_facet(search_facet); that.add_facet(function() { - var that = ipa_details_facet({name:'details',label:'Details'}); + var that = IPA.details_facet({name:'details',label:'Details'}); that.add_section( - ipa_stanza({name:'identity', label:'Hostgroup Details'}). + IPA.stanza({name:'identity', label:'Hostgroup Details'}). input({name:'cn'}). input({name: 'description'})); return that; }()); - var dialog = ipa_add_dialog({ + var dialog = IPA.add_dialog({ name: 'add', title: 'Add Hostgroup' }); that.add_dialog(dialog); - dialog.add_field(ipa_text_widget({name: 'cn', undo: false})); - dialog.add_field(ipa_text_widget({name: 'description', undo: false})); + dialog.add_field(IPA.text_widget({name: 'cn', undo: false})); + dialog.add_field(IPA.text_widget({name: 'description', undo: false})); dialog.init(); that.create_association_facets(); diff --git a/install/static/ipa.js b/install/static/ipa.js index 296df05a7..f84028b89 100644 --- a/install/static/ipa.js +++ b/install/static/ipa.js @@ -86,7 +86,7 @@ var IPA = ( function () { ]; - ipa_cmd('batch', startup_batch, {}, + IPA.cmd('batch', startup_batch, {}, function (data, text_status, xhr) { that.metadata = data.result.results[0].metadata; that.messages = data.result.results[1].messages; @@ -136,7 +136,7 @@ var IPA = ( function () { return that; }()); -function ipa_command(spec) { +IPA.command = function (spec) { spec = spec || {}; @@ -164,7 +164,7 @@ function ipa_command(spec) { }; that.execute = function() { - ipa_cmd( + IPA.cmd( that.method, that.args, that.options, @@ -202,14 +202,13 @@ function ipa_command(spec) { return that; } - -function ipa_batch_command(spec) { +IPA.batch_command = function (spec) { spec = spec || {}; spec.method = 'batch'; - var that = ipa_command(spec); + var that = IPA.command(spec); that.commands = []; @@ -225,7 +224,7 @@ function ipa_batch_command(spec) { }; that.execute = function() { - ipa_cmd( + IPA.cmd( that.method, that.args, that.options, @@ -280,7 +279,7 @@ function ipa_batch_command(spec) { * win_callback - function to call if the JSON request succeeds * fail_callback - function to call if the JSON request fails * objname - name of an IPA object (optional) */ -function ipa_cmd(name, args, options, win_callback, fail_callback, objname, command_name) +IPA.cmd = function (name, args, options, win_callback, fail_callback, objname, command_name) { var default_json_url = '/ipa/json'; @@ -293,7 +292,7 @@ function ipa_cmd(name, args, options, win_callback, fail_callback, objname, comm buttons: { 'Retry': function () { IPA.error_dialog.dialog('close'); - ipa_cmd(name, args, options, win_callback, fail_callback, objname, command_name); + IPA.cmd(name, args, options, win_callback, fail_callback, objname, command_name); }, 'Cancel': function () { IPA.error_dialog.dialog('close'); @@ -350,7 +349,7 @@ function ipa_cmd(name, args, options, win_callback, fail_callback, objname, comm dialog_open.call(this, xhr, text_status, error_thrown); } - function ipa_error_handler(xhr, text_status, error_thrown) { + function error_handler(xhr, text_status, error_thrown) { IPA.error_dialog.empty(); IPA.error_dialog.attr('title', error_thrown.title); @@ -369,7 +368,7 @@ function ipa_cmd(name, args, options, win_callback, fail_callback, objname, comm http_error_handler.call(this, xhr, text_status, error_thrown); } else if (data.error) { - ipa_error_handler.call(this, xhr, text_status, /* error_thrown */ { + error_handler.call(this, xhr, text_status, /* error_thrown */ { title: 'IPA Error '+data.error.code, message: data.error.message }); @@ -417,14 +416,14 @@ function ipa_cmd(name, args, options, win_callback, fail_callback, objname, comm /* helper function used to retrieve information about an attribute */ -function ipa_get_param_info(obj_name, attr) +IPA.get_param_info = function(obj_name, attr) { - var ipa_obj = IPA.metadata[obj_name]; - if (!ipa_obj) { + var obj = IPA.metadata[obj_name]; + if (!obj) { return null; } - var takes_params = ipa_obj.takes_params; + var takes_params = obj.takes_params; if (!takes_params) { return (null); @@ -439,13 +438,13 @@ function ipa_get_param_info(obj_name, attr) } /* helper function used to retrieve attr name with members of type `member` */ -function ipa_get_member_attribute(obj_name, member) +IPA.get_member_attribute = function (obj_name, member) { - var ipa_obj = IPA.metadata[obj_name]; - if (!ipa_obj) { + var obj = IPA.metadata[obj_name]; + if (!obj) { return null; } - var attribute_members = ipa_obj.attribute_members; + var attribute_members = obj.attribute_members; for (var a in attribute_members) { var objs = attribute_members[a]; for (var i = 0; i < objs.length; i += 1) { diff --git a/install/static/netgroup.js b/install/static/netgroup.js index 098c65bab..ab69c1b3f 100644 --- a/install/static/netgroup.js +++ b/install/static/netgroup.js @@ -21,11 +21,11 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ IPA.add_entity( function() { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'netgroup' }); that.init = function() { - var search_facet = ipa_search_facet({ + var search_facet = IPA.search_facet({ name: 'search', label: 'Search', entity_name: that.name @@ -35,9 +35,9 @@ IPA.add_entity( function() { that.add_facet(search_facet); that.add_facet(function() { - var that = ipa_details_facet({name:'details',label:'Details'}); + var that = IPA.details_facet({name:'details',label:'Details'}); that.add_section( - ipa_stanza({name:'identity', label:'Netgroup Details'}). + IPA.stanza({name:'identity', label:'Netgroup Details'}). input({name:'cn'}). input({name: 'description'}). input({name:'nisdomainname'})); @@ -45,14 +45,14 @@ IPA.add_entity( function() { }()); - var dialog = ipa_add_dialog({ + var dialog = IPA.add_dialog({ name: 'add', title: 'Add Netgroup' }); that.add_dialog(dialog); - dialog.add_field(ipa_text_widget({ name: 'cn', undo: false})); - dialog.add_field(ipa_text_widget({ name: 'description', undo: false})); + dialog.add_field(IPA.text_widget({ name: 'cn', undo: false})); + dialog.add_field(IPA.text_widget({ name: 'description', undo: false})); dialog.init(); that.create_association_facets(); diff --git a/install/static/policy.js b/install/static/policy.js index 011b6addc..f8d8a9634 100644 --- a/install/static/policy.js +++ b/install/static/policy.js @@ -23,12 +23,12 @@ /* DNS */ IPA.add_entity(function (){ - var that = ipa_entity({ + var that = IPA.entity({ name: 'dnszone' }); that.init = function() { - var search_facet = ipa_search_facet({ + var search_facet = IPA.search_facet({ name: 'search', label: 'Search', entity_name: that.name @@ -37,9 +37,9 @@ IPA.add_entity(function (){ that.add_facet(search_facet); that.add_facet(function() { - var that = ipa_details_facet({name:'details',label:'Details'}); + var that = IPA.details_facet({name:'details',label:'Details'}); that.add_section( - ipa_stanza({name:'identity', label:'DNS Zone Details'}). + IPA.stanza({name:'identity', label:'DNS Zone Details'}). input({name:'idnsname'}). input({name:'idnszoneactive'}). input({name:'idnssoamname'}). @@ -57,20 +57,20 @@ IPA.add_entity(function (){ return that; }()); - that.add_facet( ipa_records_facet({ + that.add_facet( IPA.records_facet({ 'name': 'records', 'label': IPA.metadata.dnsrecord.label })); - var dialog = ipa_add_dialog({ + var dialog = IPA.add_dialog({ name: 'add', title: 'Add DNS Zone' }); that.add_dialog(dialog); - dialog.add_field(ipa_text_widget({ name: 'idnsname', undo: false})); - dialog.add_field(ipa_text_widget({ name: 'idnssoamname', undo: false})); - dialog.add_field(ipa_text_widget({ name: 'idnssoarname', undo: false})); + dialog.add_field(IPA.text_widget({ name: 'idnsname', undo: false})); + dialog.add_field(IPA.text_widget({ name: 'idnssoamname', undo: false})); + dialog.add_field(IPA.text_widget({ name: 'idnssoarname', undo: false})); dialog.init(); that.create_association_facets(); @@ -82,12 +82,11 @@ IPA.add_entity(function (){ }()); - -function ipa_records_facet(spec){ +IPA.records_facet = function (spec){ spec = spec || {}; - var that = ipa_facet(spec); + var that = IPA.facet(spec); that.record = null; @@ -161,7 +160,7 @@ function ipa_records_facet(spec){ options[key] = value; - ipa_cmd('dnsrecord_add', params, options, add_win, add_fail); + IPA.cmd('dnsrecord_add', params, options, add_win, add_fail); //add_dialog.dialog('close'); } @@ -242,7 +241,7 @@ function ipa_records_facet(spec){ delete_dialog.dialog('close'); } - ipa_cmd('batch', delete_list, {}, + IPA.cmd('batch', delete_list, {}, delete_complete,delete_complete); } @@ -319,7 +318,7 @@ function ipa_records_facet(spec){ //})); - ipa_button({ + IPA.button({ 'label': IPA.messages.button.find, 'icon': 'ui-icon-search', 'click': function(){refresh();} @@ -331,13 +330,13 @@ function ipa_records_facet(spec){ "class":"action-controls"}).appendTo(action_panel_ul); - ipa_button({ + IPA.button({ 'label': IPA.messages.button.add, 'icon': 'ui-icon-plus', 'click': add_click }).appendTo(action_controls); - ipa_button({ + IPA.button({ 'label': IPA.messages.button.remove, 'icon': 'ui-icon-trash', 'click': function(){delete_records(records_table);} @@ -367,7 +366,7 @@ function ipa_records_facet(spec){ } }))); tr.append($('<th/>',{ - text: ipa_get_param_info("dnsrecord", "idnsname").label })); + text: IPA.get_param_info("dnsrecord", "idnsname").label })); tr.append($('<th>Record Type</th>')); tr.append($('<th>Data</th>')); @@ -410,7 +409,7 @@ function ipa_records_facet(spec){ var pkey = $.bbq.getState(that.entity_name + '-pkey', true); - ipa_cmd('dnsrecord_find',[pkey],options,load_on_win, load_on_fail); + IPA.cmd('dnsrecord_find',[pkey],options,load_on_win, load_on_fail); } @@ -490,12 +489,12 @@ function ipa_records_facet(spec){ /**Automount*/ IPA.add_entity(function (){ - var that = ipa_entity({ + var that = IPA.entity({ name: 'automountlocation' }); - var search_facet = ipa_search_facet({ + var search_facet = IPA.search_facet({ name: 'search', label: 'Search', entity_name: that.name @@ -506,20 +505,20 @@ IPA.add_entity(function (){ that.add_facet(function() { - var that = ipa_details_facet({name:'details',label:'Details'}); + var that = IPA.details_facet({name:'details',label:'Details'}); that.add_section( - ipa_stanza({name:'identity', label:'Automount Location Details'}). + IPA.stanza({name:'identity', label:'Automount Location Details'}). input({name:'cn'})); return that; }()); - var dialog = ipa_add_dialog({ + var dialog = IPA.add_dialog({ name: 'add', title: 'Add Automount Location' }); that.add_dialog(dialog); - dialog.add_field(ipa_text_widget({ name: 'cn', undo: false})); + dialog.add_field(IPA.text_widget({ name: 'cn', undo: false})); dialog.init(); that.create_association_facets(); @@ -534,12 +533,12 @@ IPA.add_entity(function (){ IPA.add_entity(function (){ - var that = ipa_entity({ + var that = IPA.entity({ name: 'pwpolicy' }); - var search_facet = ipa_search_facet({ + var search_facet = IPA.search_facet({ name: 'search', label: 'Search', entity_name: that.name @@ -550,10 +549,10 @@ IPA.add_entity(function (){ that.add_facet(function() { - var that = ipa_details_facet({name:'details',label:'Details'}); + var that = IPA.details_facet({name:'details',label:'Details'}); that.add_section( - ipa_stanza({name:'identity', label:'Password Policy'}). + IPA.stanza({name:'identity', label:'Password Policy'}). input({name:'krbmaxpwdlife'}). input({name:'krbminpwdlife'}). input({name:'krbpwdhistorylength'}). @@ -562,14 +561,14 @@ IPA.add_entity(function (){ return that; }()); - var dialog = ipa_add_dialog({ + var dialog = IPA.add_dialog({ name: 'add', title: 'Add Password Policy', entity_name:'pwpolicy' }); that.add_dialog(dialog); - dialog.add_field(ipa_text_widget({ name: 'cn', undo: false})); + dialog.add_field(IPA.text_widget({ name: 'cn', undo: false})); dialog.init(); that.create_association_facets(); @@ -586,12 +585,12 @@ IPA.add_entity(function (){ Does not have search */ -ipa_entity_set_details_definition('krbtpolicy', [ - ipa_stanza({name:'identity', label:'Kerberos ticket policy'}). +IPA.entity_set_details_definition('krbtpolicy', [ + IPA.stanza({name:'identity', label:'Kerberos ticket policy'}). //input({name:'uid',label:' '}). input({name:'krbmaxrenewableage'}). input({name:'krbmaxticketlife'}) ]); -ipa_entity_set_association_definition('krbtpolicy', { +IPA.entity_set_association_definition('krbtpolicy', { }); diff --git a/install/static/rule.js b/install/static/rule.js index 5abb08a99..e54aa27ef 100755..100644 --- a/install/static/rule.js +++ b/install/static/rule.js @@ -20,11 +20,11 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ -function ipa_rule_details_section(spec){ +IPA.rule_details_section = function (spec){ spec = spec || {}; - var that = ipa_details_section(spec); + var that = IPA.details_section(spec); that.text = spec.text; that.field_name = spec.field_name; @@ -38,7 +38,7 @@ function ipa_rule_details_section(spec){ if (that.text) container.append(that.text); - var param_info = ipa_get_param_info(that.entity_name, that.field_name); + var param_info = IPA.get_param_info(that.entity_name, that.field_name); var span = $('<span/>', { name: that.field_name, @@ -73,7 +73,7 @@ function ipa_rule_details_section(spec){ for (var j=0; j<that.tables.length; j++) { var table = that.tables[j]; - param_info = ipa_get_param_info(that.entity_name, table.field_name); + param_info = IPA.get_param_info(that.entity_name, table.field_name); var table_span = $('<span/>', { name: table.field_name, @@ -123,11 +123,11 @@ function ipa_rule_details_section(spec){ return that; } -function ipa_rule_association_table_widget(spec) { +IPA.rule_association_table_widget = function (spec) { spec = spec || {}; - var that = ipa_association_table_widget(spec); + var that = IPA.association_table_widget(spec); that.category = spec.category; @@ -135,7 +135,7 @@ function ipa_rule_association_table_widget(spec) { var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || ''; - var batch = ipa_batch_command({ + var batch = IPA.batch_command({ 'on_success': on_success, 'on_error': on_error }); @@ -143,7 +143,7 @@ function ipa_rule_association_table_widget(spec) { var command; if (that.category) { - command = ipa_command({ + command = IPA.command({ 'method': that.entity_name+'_mod', 'args': [pkey], 'options': {'all': true, 'rights': true}, @@ -157,7 +157,7 @@ function ipa_rule_association_table_widget(spec) { batch.add_command(command); } - command = ipa_command({ + command = IPA.command({ 'method': that.entity_name+'_'+that.add_method, 'args': [pkey] }); diff --git a/install/static/search.js b/install/static/search.js index 2fb4be13e..d449a8e19 100644 --- a/install/static/search.js +++ b/install/static/search.js @@ -22,11 +22,11 @@ /* REQUIRES: ipa.js */ -function ipa_search_widget(spec) { +IPA.search_widget = function (spec) { spec = spec || {}; - var that = ipa_table_widget(spec); + var that = IPA.table_widget(spec); that.facet = spec.facet; @@ -85,7 +85,7 @@ function ipa_search_widget(spec) { var search_filter = $('span[name=search-filter]', that.container); var button = $('input[name=find]', search_filter); - that.find_button = ipa_button({ + that.find_button = IPA.button({ 'label': IPA.messages.button.find, 'icon': 'ui-icon-search', 'click': function() { that.find(that.container); } @@ -167,7 +167,7 @@ function ipa_search_widget(spec) { var title = 'Remove '+that.label; - var dialog = ipa_deleter_dialog({ + var dialog = IPA.deleter_dialog({ 'title': title, 'parent': that.container, 'values': values @@ -175,7 +175,7 @@ function ipa_search_widget(spec) { dialog.remove = function() { - var batch = ipa_batch_command({ + var batch = IPA.batch_command({ 'on_success': function() { that.refresh(); dialog.close(); @@ -187,7 +187,7 @@ function ipa_search_widget(spec) { }); for (var i=0; i<values.length; i++) { - var command = ipa_command({ + var command = IPA.command({ 'method': that.entity_name+'_del' }); command.add_arg(values[i]); @@ -238,7 +238,7 @@ function ipa_search_widget(spec) { } var filter = $.bbq.getState(that.entity_name + '-filter', true) || ''; - ipa_cmd( + IPA.cmd( 'find', [filter], {all: true}, on_success, on_error, that.entity_name); }; @@ -246,13 +246,13 @@ function ipa_search_widget(spec) { return that; } -function ipa_search_facet(spec) { +IPA.search_facet = function (spec) { spec = spec || {}; spec.display_class = 'search-facet'; - var that = ipa_facet(spec); + var that = IPA.facet(spec); that.init = spec.init || init; that.create = spec.create || create; @@ -289,7 +289,7 @@ function ipa_search_facet(spec) { }; that.create_column = function(spec) { - var column = ipa_column(spec); + var column = IPA.column(spec); that.add_column(column); return column; }; @@ -321,7 +321,7 @@ function ipa_search_facet(spec) { that.facet_init(); - that.table = ipa_search_widget({ + that.table = IPA.search_widget({ 'id': that.entity_name+'-search', 'name': 'search', 'label': IPA.metadata[that.entity_name].label, 'entity_name': that.entity_name, @@ -331,7 +331,7 @@ function ipa_search_facet(spec) { for (var i=0; i<that.columns.length; i++) { var column = that.columns[i]; - var param_info = ipa_get_param_info(that.entity_name, column.name); + var param_info = IPA.get_param_info(that.entity_name, column.name); column.primary_key = param_info && param_info['primary_key']; if (column.primary_key) { @@ -450,7 +450,7 @@ function search_generate_td(tr, attr, value, entry_attrs) { var obj_name = tr.closest('.entity-container').attr('title'); - var param_info = ipa_get_param_info(obj_name, attr); + var param_info = IPA.get_param_info(obj_name, attr); if (param_info && param_info['primary_key']) value = _search_a_pkey_template.replace('V', value); diff --git a/install/static/serverconfig.js b/install/static/serverconfig.js index d1f0c6e90..f33a8e987 100644 --- a/install/static/serverconfig.js +++ b/install/static/serverconfig.js @@ -24,9 +24,9 @@ /* Configuration */ -ipa_entity_set_details_definition('config',[ +IPA.entity_set_details_definition('config',[ - ipa_stanza({name:'ipaserver', label:'Configuration'}). + IPA.stanza({name:'ipaserver', label:'Configuration'}). input({name:'cn', label:'Name'}). input({name:'ipacertificatesubjectbase'}). input({name:'ipadefaultloginshell'}). diff --git a/install/static/service.js b/install/static/service.js index 12387b3f1..39c7ae2fd 100644 --- a/install/static/service.js +++ b/install/static/service.js @@ -20,9 +20,9 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ -function ipa_service() { +IPA.service = function () { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'service' }); @@ -34,26 +34,26 @@ function ipa_service() { 'remove_method': 'remove_host' }); - var dialog = ipa_service_add_dialog({ + var dialog = IPA.service_add_dialog({ 'name': 'add', 'title': 'Add New Service' }); that.add_dialog(dialog); dialog.init(); - var facet = ipa_service_search_facet({ + var facet = IPA.service_search_facet({ 'name': 'search', 'label': 'Search' }); that.add_facet(facet); - facet = ipa_service_details_facet({ + facet = IPA.service_details_facet({ 'name': 'details', 'label': 'Details' }); that.add_facet(facet); - facet = ipa_service_managedby_host_facet({ + facet = IPA.service_managedby_host_facet({ 'name': 'managedby_host', 'label': IPA.messages.association.managedby+' '+IPA.metadata['host'].label, 'other_entity': 'host' @@ -66,22 +66,22 @@ function ipa_service() { return that; } -IPA.add_entity(ipa_service()); +IPA.add_entity(IPA.service()); -function ipa_service_add_dialog(spec) { +IPA.service_add_dialog = function (spec) { spec = spec || {}; - var that = ipa_add_dialog(spec); + var that = IPA.add_dialog(spec); that.init = function() { - that.add_field(ipa_widget({ + that.add_field(IPA.widget({ name: 'krbprincipalname' })); // TODO: Replace with i18n label - that.add_field(ipa_text_widget({ + that.add_field(IPA.text_widget({ 'name': 'service', 'label': 'Service', 'size': 20, @@ -89,7 +89,7 @@ function ipa_service_add_dialog(spec) { })); // TODO: Replace with i18n label - that.add_field(ipa_text_widget({ + that.add_field(IPA.text_widget({ 'name': 'host', 'label': 'Host Name', 'size': 40, @@ -153,11 +153,11 @@ function ipa_service_add_dialog(spec) { return that; } -function ipa_service_search_facet(spec) { +IPA.service_search_facet = function (spec) { spec = spec || {}; - var that = ipa_search_facet(spec); + var that = IPA.search_facet(spec); that.init = function() { @@ -168,15 +168,15 @@ function ipa_service_search_facet(spec) { return that; } -function ipa_service_details_facet(spec) { +IPA.service_details_facet = function (spec) { spec = spec || {}; - var that = ipa_details_facet(spec); + var that = IPA.details_facet(spec); that.init = function() { - var section = ipa_details_list_section({ + var section = IPA.details_list_section({ name: 'details', label: 'Service Details' }); @@ -200,7 +200,7 @@ function ipa_service_details_facet(spec) { load: service_host_load }); - section = ipa_details_list_section({ + section = IPA.details_list_section({ name: 'provisioning', label: 'Provisioning' }); @@ -211,7 +211,7 @@ function ipa_service_details_facet(spec) { label: 'Status' })); - section = ipa_details_list_section({ + section = IPA.details_list_section({ name: 'certificate', label: 'Service Certificate' }); @@ -234,7 +234,7 @@ function service_service_load(result) { $('dd', that.container).remove(); - var dd = ipa_create_first_dd(this.name); + var dd = IPA.create_first_dd(this.name); dd.appendTo(that.container); var krbprincipalname = result['krbprincipalname'][0]; @@ -248,7 +248,7 @@ function service_host_load(result) { $('dd', that.container).remove(); - var dd = ipa_create_first_dd(this.name); + var dd = IPA.create_first_dd(this.name); dd.appendTo(that.container); var krbprincipalname = result['krbprincipalname'][0]; @@ -260,7 +260,7 @@ function service_provisioning_status_widget(spec) { spec = spec || {}; - var that = ipa_widget(spec); + var that = IPA.widget(spec); that.create = function(container) { @@ -305,7 +305,7 @@ function service_provisioning_status_widget(spec) { that.missing = $('.status-missing', that.container); var button = $('input[name=unprovision]', that.container); - that.unprovision_button = ipa_button({ + that.unprovision_button = IPA.button({ 'label': 'Delete Key, Unprovision', 'click': that.unprovision }); @@ -315,7 +315,7 @@ function service_provisioning_status_widget(spec) { that.unprovision = function() { var label = IPA.metadata[that.entity_name].label; - var dialog = ipa_dialog({ + var dialog = IPA.dialog({ 'title': 'Unprovisioning '+label }); @@ -327,7 +327,7 @@ function service_provisioning_status_widget(spec) { dialog.add_button('Unprovision', function() { var pkey = that.result['krbprincipalname'][0]; - ipa_cmd(that.entity_name+'_disable', [pkey], {}, + IPA.cmd(that.entity_name+'_disable', [pkey], {}, function(data, text_status, xhr) { set_status('missing'); dialog.close(); @@ -398,11 +398,11 @@ function service_certificate_status_widget(spec) { return that; } -function ipa_service_managedby_host_facet(spec) { +IPA.service_managedby_host_facet = function (spec) { spec = spec || {}; - var that = ipa_association_facet(spec); + var that = IPA.association_facet(spec); that.init = function() { diff --git a/install/static/sudocmd.js b/install/static/sudocmd.js index ef3c24e5e..d4f981ad4 100755..100644 --- a/install/static/sudocmd.js +++ b/install/static/sudocmd.js @@ -20,28 +20,28 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ -function ipa_sudocmd() { +IPA.sudocmd = function () { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'sudocmd' }); that.init = function() { - var dialog = ipa_sudocmd_add_dialog({ + var dialog = IPA.sudocmd_add_dialog({ 'name': 'add', 'title': 'Add New SUDO Command' }); that.add_dialog(dialog); dialog.init(); - var facet = ipa_sudocmd_search_facet({ + var facet = IPA.sudocmd_search_facet({ 'name': 'search', 'label': 'Search' }); that.add_facet(facet); - facet = ipa_sudocmd_details_facet({ + facet = IPA.sudocmd_details_facet({ 'name': 'details', 'label': 'Details' }); @@ -53,18 +53,18 @@ function ipa_sudocmd() { return that; } -IPA.add_entity(ipa_sudocmd()); +IPA.add_entity(IPA.sudocmd()); -function ipa_sudocmd_add_dialog(spec) { +IPA.sudocmd_add_dialog = function (spec) { spec = spec || {}; - var that = ipa_add_dialog(spec); + var that = IPA.add_dialog(spec); that.init = function() { - that.add_field(ipa_text_widget({name:'sudocmd', undo: false})); - that.add_field(ipa_text_widget({name:'description', undo: false})); + that.add_field(IPA.text_widget({name:'sudocmd', undo: false})); + that.add_field(IPA.text_widget({name:'description', undo: false})); that.add_dialog_init(); }; @@ -72,11 +72,11 @@ function ipa_sudocmd_add_dialog(spec) { return that; } -function ipa_sudocmd_search_facet(spec) { +IPA.sudocmd_search_facet = function (spec) { spec = spec || {}; - var that = ipa_search_facet(spec); + var that = IPA.search_facet(spec); that.init = function() { @@ -90,15 +90,15 @@ function ipa_sudocmd_search_facet(spec) { } -function ipa_sudocmd_details_facet(spec) { +IPA.sudocmd_details_facet = function (spec) { spec = spec || {}; - var that = ipa_details_facet(spec); + var that = IPA.details_facet(spec); that.init = function() { - var section = ipa_details_list_section({ + var section = IPA.details_list_section({ 'name': 'general', 'label': 'General' }); @@ -107,13 +107,13 @@ function ipa_sudocmd_details_facet(spec) { section.create_field({'name': 'sudocmd'}); section.create_field({'name': 'description'}); - section = ipa_details_section({ + section = IPA.details_section({ 'name': 'groups', 'label': 'Groups' }); that.add_section(section); - var field = ipa_sudocmd_member_sudocmdgroup_table_widget({ + var field = IPA.sudocmd_member_sudocmdgroup_table_widget({ 'name': 'memberof', 'label': 'Groups', 'other_entity': 'sudocmdgroup', @@ -127,11 +127,11 @@ function ipa_sudocmd_details_facet(spec) { return that; } -function ipa_sudocmd_member_sudocmdgroup_table_widget(spec) { +IPA.sudocmd_member_sudocmdgroup_table_widget = function (spec) { spec = spec || {}; - var that = ipa_association_table_widget(spec); + var that = IPA.association_table_widget(spec); that.init = function() { @@ -186,7 +186,7 @@ function ipa_sudocmd_member_sudocmdgroup_table_widget(spec) { if (!that.values.length) return; - var batch = ipa_batch_command({ + var batch = IPA.batch_command({ 'name': that.entity_name+'_'+that.name+'_show', 'on_success': on_success, 'on_error': on_error @@ -198,7 +198,7 @@ function ipa_sudocmd_member_sudocmdgroup_table_widget(spec) { var k = dn.indexOf(','); var value = dn.substring(j+1, k); - var command = ipa_command({ + var command = IPA.command({ 'method': that.other_entity+'_show', 'args': [value], 'options': { @@ -217,7 +217,7 @@ function ipa_sudocmd_member_sudocmdgroup_table_widget(spec) { if (!values.length) return; - var batch = ipa_batch_command({ + var batch = IPA.batch_command({ 'name': that.entity_name+'_'+that.name+'_add', 'on_success': on_success, 'on_error': on_error @@ -228,7 +228,7 @@ function ipa_sudocmd_member_sudocmdgroup_table_widget(spec) { for (var i=0; i<values.length; i++) { var value = values[i]; - var command = ipa_command({ + var command = IPA.command({ 'method': that.other_entity+'_add_member', 'args': [value] }); @@ -245,7 +245,7 @@ function ipa_sudocmd_member_sudocmdgroup_table_widget(spec) { if (!values.length) return; - var batch = ipa_batch_command({ + var batch = IPA.batch_command({ 'name': that.entity_name+'_'+that.name+'_remove', 'on_success': on_success, 'on_error': on_error @@ -256,7 +256,7 @@ function ipa_sudocmd_member_sudocmdgroup_table_widget(spec) { for (var i=0; i<values.length; i++) { var value = values[i]; - var command = ipa_command({ + var command = IPA.command({ 'method': that.other_entity+'_remove_member', 'args': [value] }); diff --git a/install/static/sudocmdgroup.js b/install/static/sudocmdgroup.js index 121c8b855..256b8fc55 100755..100644 --- a/install/static/sudocmdgroup.js +++ b/install/static/sudocmdgroup.js @@ -20,9 +20,9 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ -function ipa_sudocmdgroup() { +IPA.sudocmdgroup = function () { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'sudocmdgroup' }); @@ -34,20 +34,20 @@ function ipa_sudocmdgroup() { 'remove_method': 'remove_member' }); - var dialog = ipa_sudocmdgroup_add_dialog({ + var dialog = IPA.sudocmdgroup_add_dialog({ 'name': 'add', 'title': 'Add New SUDO Command Group' }); that.add_dialog(dialog); dialog.init(); - var facet = ipa_sudocmdgroup_search_facet({ + var facet = IPA.sudocmdgroup_search_facet({ 'name': 'search', 'label': 'Search' }); that.add_facet(facet); - facet = ipa_sudocmdgroup_details_facet({ + facet = IPA.sudocmdgroup_details_facet({ 'name': 'details', 'label': 'Details' }); @@ -59,18 +59,18 @@ function ipa_sudocmdgroup() { return that; } -IPA.add_entity(ipa_sudocmdgroup()); +IPA.add_entity(IPA.sudocmdgroup()); -function ipa_sudocmdgroup_add_dialog(spec) { +IPA.sudocmdgroup_add_dialog = function (spec) { spec = spec || {}; - var that = ipa_add_dialog(spec); + var that = IPA.add_dialog(spec); that.init = function() { - that.add_field(ipa_text_widget({name:'cn', undo: false})); - that.add_field(ipa_text_widget({name:'description', undo: false})); + that.add_field(IPA.text_widget({name:'cn', undo: false})); + that.add_field(IPA.text_widget({name:'description', undo: false})); that.add_dialog_init(); }; @@ -78,11 +78,11 @@ function ipa_sudocmdgroup_add_dialog(spec) { return that; } -function ipa_sudocmdgroup_search_facet(spec) { +IPA.sudocmdgroup_search_facet = function (spec) { spec = spec || {}; - var that = ipa_search_facet(spec); + var that = IPA.search_facet(spec); that.init = function() { @@ -96,15 +96,15 @@ function ipa_sudocmdgroup_search_facet(spec) { } -function ipa_sudocmdgroup_details_facet(spec) { +IPA.sudocmdgroup_details_facet = function (spec) { spec = spec || {}; - var that = ipa_details_facet(spec); + var that = IPA.details_facet(spec); that.init = function() { - var section = ipa_details_list_section({ + var section = IPA.details_list_section({ 'name': 'general', 'label': 'General' }); @@ -113,13 +113,13 @@ function ipa_sudocmdgroup_details_facet(spec) { section.create_field({'name': 'cn'}); section.create_field({'name': 'description'}); - section = ipa_details_section({ + section = IPA.details_section({ 'name': 'commands', 'label': 'Commands' }); that.add_section(section); - var field = ipa_sudocmdgroup_member_sudocmd_table_widget({ + var field = IPA.sudocmdgroup_member_sudocmd_table_widget({ 'name': 'member_sudocmd', 'label': 'Commands', 'other_entity': 'sudocmd', @@ -133,11 +133,11 @@ function ipa_sudocmdgroup_details_facet(spec) { return that; } -function ipa_sudocmdgroup_member_sudocmd_table_widget(spec) { +IPA.sudocmdgroup_member_sudocmd_table_widget = function (spec) { spec = spec || {}; - var that = ipa_association_table_widget(spec); + var that = IPA.association_table_widget(spec); that.init = function() { diff --git a/install/static/sudorule.js b/install/static/sudorule.js index 7016ef93e..c3cd5821d 100755..100644 --- a/install/static/sudorule.js +++ b/install/static/sudorule.js @@ -20,28 +20,28 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ -function ipa_sudorule() { +IPA.sudorule = function () { - var that = ipa_entity({ + var that = IPA.entity({ 'name': 'sudorule' }); that.init = function() { - var dialog = ipa_sudorule_add_dialog({ + var dialog = IPA.sudorule_add_dialog({ 'name': 'add', 'title': 'Add New Rule' }); that.add_dialog(dialog); dialog.init(); - var facet = ipa_sudorule_search_facet({ + var facet = IPA.sudorule_search_facet({ 'name': 'search', 'label': 'Search' }); that.add_facet(facet); - facet = ipa_sudorule_details_facet({ + facet = IPA.sudorule_details_facet({ 'name': 'details', 'label': 'Details' }); @@ -53,17 +53,17 @@ function ipa_sudorule() { return that; } -IPA.add_entity(ipa_sudorule()); +IPA.add_entity(IPA.sudorule()); -function ipa_sudorule_add_dialog(spec) { +IPA.sudorule_add_dialog = function (spec) { spec = spec || {}; - var that = ipa_add_dialog(spec); + var that = IPA.add_dialog(spec); that.init = function() { - that.add_field(ipa_text_widget({name: 'cn', undo: false})); + that.add_field(IPA.text_widget({name: 'cn', undo: false})); that.add_dialog_init(); }; @@ -71,11 +71,11 @@ function ipa_sudorule_add_dialog(spec) { return that; } -function ipa_sudorule_search_facet(spec) { +IPA.sudorule_search_facet = function (spec) { spec = spec || {}; - var that = ipa_search_facet(spec); + var that = IPA.search_facet(spec); that.init = function() { @@ -89,11 +89,11 @@ function ipa_sudorule_search_facet(spec) { return that; } -function ipa_sudorule_details_facet(spec) { +IPA.sudorule_details_facet = function (spec) { spec = spec || {}; - var that = ipa_details_facet(spec); + var that = IPA.details_facet(spec); that.init = function() { @@ -107,7 +107,7 @@ function ipa_sudorule_details_facet(spec) { }); } else { - section = ipa_sudorule_details_general_section({ + section = IPA.sudorule_details_general_section({ 'name': 'general', 'label': 'General' }); @@ -118,7 +118,7 @@ function ipa_sudorule_details_facet(spec) { section.create_textarea({ 'name': 'description' }); section.create_radio({ 'name': 'ipaenabledflag' }); - section = ipa_rule_details_section({ + section = IPA.rule_details_section({ 'name': 'user', 'label': 'Who', 'field_name': 'usercategory', @@ -134,19 +134,19 @@ function ipa_sudorule_details_facet(spec) { that.add_section(section); var category = section.create_radio({ name: 'usercategory', label: 'User category' }); - section.add_field(ipa_sudorule_association_table_widget({ + section.add_field(IPA.sudorule_association_table_widget({ 'id': that.entity_name+'-memberuser_user', 'name': 'memberuser_user', 'label': 'Users', 'category': category, 'other_entity': 'user', 'add_method': 'add_user', 'remove_method': 'remove_user', 'external': 'externaluser' })); - section.add_field(ipa_sudorule_association_table_widget({ + section.add_field(IPA.sudorule_association_table_widget({ 'id': that.entity_name+'-memberuser_group', 'name': 'memberuser_group', 'label': 'Groups', 'category': category, 'other_entity': 'group', 'add_method': 'add_user', 'remove_method': 'remove_user' })); - section = ipa_rule_details_section({ + section = IPA.rule_details_section({ 'name': 'host', 'label': 'Access this host', 'field_name': 'hostcategory', @@ -162,25 +162,25 @@ function ipa_sudorule_details_facet(spec) { that.add_section(section); category = section.create_radio({ 'name': 'hostcategory', 'label': 'Host category' }); - section.add_field(ipa_sudorule_association_table_widget({ + section.add_field(IPA.sudorule_association_table_widget({ 'id': that.entity_name+'-memberhost_host', 'name': 'memberhost_host', 'label': 'Host', 'category': category, 'other_entity': 'host', 'add_method': 'add_host', 'remove_method': 'remove_host', 'external': 'externalhost' })); - section.add_field(ipa_sudorule_association_table_widget({ + section.add_field(IPA.sudorule_association_table_widget({ 'id': that.entity_name+'-memberhost_hostgroup', 'name': 'memberhost_hostgroup', 'label': 'Groups', 'category': category, 'other_entity': 'hostgroup', 'add_method': 'add_host', 'remove_method': 'remove_host' })); - section = ipa_sudorule_details_command_section({ + section = IPA.sudorule_details_command_section({ 'name': 'command', 'label': 'Run Commands' }); that.add_section(section); - section = ipa_sudorule_details_runas_section({ + section = IPA.sudorule_details_runas_section({ 'name': 'runas', 'label': 'As Whom' }); @@ -195,7 +195,7 @@ function ipa_sudorule_details_facet(spec) { var modify_operation = { 'execute': false, - 'command': ipa_command({ + 'command': IPA.command({ 'method': that.entity_name+'_mod', 'args': [pkey], 'options': {'all': true, 'rights': true} @@ -224,7 +224,7 @@ function ipa_sudorule_details_facet(spec) { 'memberuser': { 'category': 'usercategory', 'has_values': false, - 'command': ipa_command({ + 'command': IPA.command({ 'method': that.entity_name+'_remove_user', 'args': [pkey], 'options': {'all': true, 'rights': true} @@ -233,7 +233,7 @@ function ipa_sudorule_details_facet(spec) { 'memberhost': { 'category': 'hostcategory', 'has_values': false, - 'command': ipa_command({ + 'command': IPA.command({ 'method': that.entity_name+'_remove_host', 'args': [pkey], 'options': {'all': true, 'rights': true} @@ -242,7 +242,7 @@ function ipa_sudorule_details_facet(spec) { 'memberallowcmd': { 'category': 'cmdcategory', 'has_values': false, - 'command': ipa_command({ + 'command': IPA.command({ 'method': that.entity_name+'_remove_allow_command', 'args': [pkey], 'options': {'all': true, 'rights': true} @@ -251,7 +251,7 @@ function ipa_sudorule_details_facet(spec) { 'ipasudorunas': { 'category': 'ipasudorunasusercategory', 'has_values': false, - 'command': ipa_command({ + 'command': IPA.command({ 'method': that.entity_name+'_remove_runasuser', 'args': [pkey], 'options': {'all': true, 'rights': true} @@ -260,7 +260,7 @@ function ipa_sudorule_details_facet(spec) { 'ipasudorunasgroup': { 'category': 'ipasudorunasgroupcategory', 'has_values': false, - 'command': ipa_command({ + 'command': IPA.command({ 'method': that.entity_name+'_remove_runasgroup', 'args': [pkey], 'options': {'all': true, 'rights': true} @@ -270,7 +270,7 @@ function ipa_sudorule_details_facet(spec) { var enable_operation = { 'execute': false, - 'command': ipa_command({ + 'command': IPA.command({ 'method': that.entity_name+'_enable', 'args': [pkey], 'options': {'all': true, 'rights': true} @@ -289,7 +289,7 @@ function ipa_sudorule_details_facet(spec) { var values = field.save(); if (!values) continue; - var param_info = ipa_get_param_info(that.entity_name, field.name); + var param_info = IPA.get_param_info(that.entity_name, field.name); // skip primary key if (param_info && param_info['primary_key']) continue; @@ -343,7 +343,7 @@ function ipa_sudorule_details_facet(spec) { } } - var batch = ipa_batch_command({ + var batch = IPA.batch_command({ 'name': 'sudorule_details_update', 'on_success': function(data, text_status, xhr) { that.refresh(); @@ -377,11 +377,11 @@ function ipa_sudorule_details_facet(spec) { return that; } -function ipa_sudorule_details_general_section(spec){ +IPA.sudorule_details_general_section = function (spec){ spec = spec || {}; - var that = ipa_details_section(spec); + var that = IPA.details_section(spec); that.create = function(container) { @@ -389,7 +389,7 @@ function ipa_sudorule_details_general_section(spec){ 'style': 'width: 100%;' }).appendTo(container); - var param_info = ipa_get_param_info(that.entity_name, 'cn'); + var param_info = IPA.get_param_info(that.entity_name, 'cn'); var tr = $('<tr/>').appendTo(table); @@ -421,7 +421,7 @@ function ipa_sudorule_details_general_section(spec){ 'html': 'undo' }).appendTo(span); - param_info = ipa_get_param_info(that.entity_name, 'description'); + param_info = IPA.get_param_info(that.entity_name, 'description'); tr = $('<tr/>').appendTo(table); @@ -453,7 +453,7 @@ function ipa_sudorule_details_general_section(spec){ 'html': 'undo' }).appendTo(span); - param_info = ipa_get_param_info(that.entity_name, 'ipaenabledflag'); + param_info = IPA.get_param_info(that.entity_name, 'ipaenabledflag'); tr = $('<tr/>').appendTo(table); @@ -500,36 +500,36 @@ function ipa_sudorule_details_general_section(spec){ return that; } -function ipa_sudorule_details_command_section(spec){ +IPA.sudorule_details_command_section = function (spec){ spec = spec || {}; - var that = ipa_details_section(spec); + var that = IPA.details_section(spec); that.init = function() { var category = that.create_radio({'name': 'cmdcategory'}); - that.add_field(ipa_sudorule_command_table_widget({ + that.add_field(IPA.sudorule_command_table_widget({ 'id': that.entity_name+'-memberallowcmd_sudocmd', 'name': 'memberallowcmd_sudocmd', 'label': 'Command', 'category': category, 'section': that, 'other_entity': 'sudocmd', 'add_method': 'add_allow_command', 'remove_method': 'remove_allow_command' })); - that.add_field(ipa_sudorule_command_table_widget({ + that.add_field(IPA.sudorule_command_table_widget({ 'id': that.entity_name+'-memberallowcmd_sudocmdgroup', 'name': 'memberallowcmd_sudocmdgroup', 'label': 'Groups', 'category': category, 'section': that, 'other_entity': 'sudocmdgroup', 'add_method': 'add_allow_command', 'remove_method': 'remove_allow_command' })); - that.add_field(ipa_sudorule_command_table_widget({ + that.add_field(IPA.sudorule_command_table_widget({ 'id': that.entity_name+'-memberdenycmd_sudocmd', 'name': 'memberdenycmd_sudocmd', 'label': 'Command', 'section': that, 'other_entity': 'sudocmd', 'add_method': 'add_deny_command', 'remove_method': 'remove_deny_command' })); - that.add_field(ipa_sudorule_command_table_widget({ + that.add_field(IPA.sudorule_command_table_widget({ 'id': that.entity_name+'-memberdenycmd_sudocmdgroup', 'name': 'memberdenycmd_sudocmdgroup', 'label': 'Groups', 'section': that, @@ -543,7 +543,7 @@ function ipa_sudorule_details_command_section(spec){ if (that.template) return; - var param_info = ipa_get_param_info(that.entity_name, 'cmdcategory'); + var param_info = IPA.get_param_info(that.entity_name, 'cmdcategory'); var span = $('<span/>', { name: 'cmdcategory', @@ -585,7 +585,7 @@ function ipa_sudorule_details_command_section(spec){ 'html': 'undo' }).appendTo(span); - param_info = ipa_get_param_info(that.entity_name, 'memberallowcmd_sudocmd'); + param_info = IPA.get_param_info(that.entity_name, 'memberallowcmd_sudocmd'); var table_span = $('<span/>', { name: 'memberallowcmd_sudocmd', @@ -595,7 +595,7 @@ function ipa_sudorule_details_command_section(spec){ var field = that.get_field('memberallowcmd_sudocmd'); field.create(table_span); - param_info = ipa_get_param_info(that.entity_name, 'memberallowcmd_sudocmdgroup'); + param_info = IPA.get_param_info(that.entity_name, 'memberallowcmd_sudocmdgroup'); table_span = $('<span/>', { name: 'memberallowcmd_sudocmdgroup', @@ -611,7 +611,7 @@ function ipa_sudorule_details_command_section(spec){ title: 'Deny' }).appendTo(span); - param_info = ipa_get_param_info(that.entity_name, 'memberdenycmd_sudocmd'); + param_info = IPA.get_param_info(that.entity_name, 'memberdenycmd_sudocmd'); table_span = $('<span/>', { name: 'memberdenycmd_sudocmd', @@ -621,7 +621,7 @@ function ipa_sudorule_details_command_section(spec){ field = that.get_field('memberdenycmd_sudocmd'); field.create(table_span); - param_info = ipa_get_param_info(that.entity_name, 'memberdenycmd_sudocmdgroup'); + param_info = IPA.get_param_info(that.entity_name, 'memberdenycmd_sudocmdgroup'); table_span = $('<span/>', { name: 'memberdenycmd_sudocmdgroup', @@ -667,28 +667,28 @@ function ipa_sudorule_details_command_section(spec){ return that; } -function ipa_sudorule_details_runas_section(spec){ +IPA.sudorule_details_runas_section = function (spec){ spec = spec || {}; - var that = ipa_details_section(spec); + var that = IPA.details_section(spec); that.init = function() { var category = that.create_radio({ name: 'ipasudorunasusercategory', label: 'Run as User category' }); - that.add_field(ipa_sudorule_association_table_widget({ + that.add_field(IPA.sudorule_association_table_widget({ 'id': that.entity_name+'-runasruser_user', 'name': 'ipasudorunas_user', 'label': 'Users', 'category': category, 'other_entity': 'user', 'add_method': 'add_runasuser', 'remove_method': 'remove_runasuser' })); - that.add_field(ipa_sudorule_association_table_widget({ + that.add_field(IPA.sudorule_association_table_widget({ 'id': that.entity_name+'-runasuser_group', 'name': 'ipasudorunas_group', 'label': 'Groups', 'category': category, 'other_entity': 'group', 'add_method': 'add_runasuser', 'remove_method': 'remove_runasuser' })); category = that.create_radio({ name: 'ipasudorunasgroupcategory', label: 'Run as Group category' }); - that.add_field(ipa_sudorule_association_table_widget({ + that.add_field(IPA.sudorule_association_table_widget({ 'id': that.entity_name+'-runasgroup_group', 'name': 'ipasudorunasgroup_group', 'label': 'Groups', 'category': category, 'other_entity': 'group', 'add_method': 'add_runasgroup', 'remove_method': 'remove_runasgroup' @@ -701,7 +701,7 @@ function ipa_sudorule_details_runas_section(spec){ if (that.template) return; - var param_info = ipa_get_param_info(that.entity_name, 'ipasudorunasusercategory'); + var param_info = IPA.get_param_info(that.entity_name, 'ipasudorunasusercategory'); var span = $('<span/>', { name: 'ipasudorunasusercategory', @@ -735,7 +735,7 @@ function ipa_sudorule_details_runas_section(spec){ span.append('<br/>'); - param_info = ipa_get_param_info(that.entity_name, 'ipasudorunas_user'); + param_info = IPA.get_param_info(that.entity_name, 'ipasudorunas_user'); var table_span = $('<span/>', { name: 'ipasudorunas_user', @@ -745,7 +745,7 @@ function ipa_sudorule_details_runas_section(spec){ var field = that.get_field('ipasudorunas_user'); field.create(table_span); - param_info = ipa_get_param_info(that.entity_name, 'ipasudorunas_group'); + param_info = IPA.get_param_info(that.entity_name, 'ipasudorunas_group'); table_span = $('<span/>', { name: 'ipasudorunas_group', @@ -755,7 +755,7 @@ function ipa_sudorule_details_runas_section(spec){ field = that.get_field('ipasudorunas_group'); field.create(table_span); - param_info = ipa_get_param_info(that.entity_name, 'ipasudorunasgroupcategory'); + param_info = IPA.get_param_info(that.entity_name, 'ipasudorunasgroupcategory'); span = $('<span/>', { name: 'ipasudorunasgroupcategory', @@ -789,7 +789,7 @@ function ipa_sudorule_details_runas_section(spec){ span.append('<br/>'); - param_info = ipa_get_param_info(that.entity_name, 'ipasudorunasgroup_group'); + param_info = IPA.get_param_info(that.entity_name, 'ipasudorunasgroup_group'); table_span = $('<span/>', { name: 'ipasudorunasgroup_group', @@ -859,11 +859,11 @@ function ipa_sudorule_details_runas_section(spec){ return that; } -function ipa_sudorule_association_table_widget(spec) { +IPA.sudorule_association_table_widget = function (spec) { spec = spec || {}; - var that = ipa_rule_association_table_widget(spec); + var that = IPA.rule_association_table_widget(spec); that.external = spec.external; @@ -877,7 +877,7 @@ function ipa_sudorule_association_table_widget(spec) { template = 'sudorule-'+that.other_entity+'-dialog.html #contents'; } - return ipa_sudorule_association_adder_dialog({ + return IPA.sudorule_association_adder_dialog({ 'title': title, 'entity_name': that.entity_name, 'pkey': pkey, @@ -899,11 +899,11 @@ function ipa_sudorule_association_table_widget(spec) { return that; } -function ipa_sudorule_association_adder_dialog(spec) { +IPA.sudorule_association_adder_dialog = function (spec) { spec = spec || {}; - var that = ipa_association_adder_dialog(spec); + var that = IPA.association_adder_dialog(spec); that.external = spec.external; @@ -919,7 +919,7 @@ function ipa_sudorule_association_adder_dialog(spec) { }); } - that.available_table = ipa_table_widget({ + that.available_table = IPA.table_widget({ name: 'available' }); @@ -927,7 +927,7 @@ function ipa_sudorule_association_adder_dialog(spec) { that.available_table.init(); - that.selected_table = ipa_table_widget({ + that.selected_table = IPA.table_widget({ name: 'selected' }); @@ -1052,11 +1052,11 @@ function ipa_sudorule_association_adder_dialog(spec) { return that; } -function ipa_sudorule_command_table_widget(spec) { +IPA.sudorule_command_table_widget = function (spec) { spec = spec || {}; - var that = ipa_association_table_widget(spec); + var that = IPA.association_table_widget(spec); that.category = spec.category; that.section = spec.section; @@ -1065,7 +1065,7 @@ function ipa_sudorule_command_table_widget(spec) { var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || ''; - var batch = ipa_batch_command({ + var batch = IPA.batch_command({ 'on_success': on_success, 'on_error': on_error }); @@ -1073,7 +1073,7 @@ function ipa_sudorule_command_table_widget(spec) { var command; if (that.category) { - command = ipa_command({ + command = IPA.command({ 'method': that.entity_name+'_mod', 'args': [pkey], 'options': {'all': true, 'rights': true}, @@ -1087,7 +1087,7 @@ function ipa_sudorule_command_table_widget(spec) { batch.add_command(command); } - command = ipa_command({ + command = IPA.command({ 'method': that.entity_name+'_'+that.add_method, 'args': [pkey] }); @@ -1101,7 +1101,7 @@ function ipa_sudorule_command_table_widget(spec) { var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || ''; - var command = ipa_command({ + var command = IPA.command({ 'method': that.entity_name+'_'+that.remove_method, 'args': [pkey], 'on_success': on_success, diff --git a/install/static/test/aci_tests.js b/install/static/test/aci_tests.js index 9505f1e1a..c51b556dc 100644 --- a/install/static/test/aci_tests.js +++ b/install/static/test/aci_tests.js @@ -36,7 +36,7 @@ module('aci',{ } ); aci_container = $('<div id="aci"/>').appendTo(document.body); - target_section = ipa_target_section(); + target_section = IPA.target_section(); target_section.create(aci_container); }, teardown: function() { diff --git a/install/static/test/association_tests.js b/install/static/test/association_tests.js index 4ce1354d9..a65678a7f 100644 --- a/install/static/test/association_tests.js +++ b/install/static/test/association_tests.js @@ -18,11 +18,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +module('associate'); + + test("Testing serial_associator().", function() { expect(10); - var orig_ipa_cmd = ipa_cmd; + var orig_ipa_cmd = IPA.cmd; var counter = 0; @@ -35,22 +38,22 @@ test("Testing serial_associator().", function() { params.values = ['user1', 'user2', 'user3']; - ipa_cmd = function(name, args, options, win_callback, fail_callback, objname) { + IPA.cmd = function(name, args, options, win_callback, fail_callback, objname) { counter++; equals( name, params.method, - "Checking ipa_cmd() parameter: method" + "Checking IPA.cmd() parameter: method" ); equals( objname, params.other_entity, - "Checking ipa_cmd() parameter: object name" + "Checking IPA.cmd() parameter: object name" ); equals( args[0], "user"+counter, - "Checking ipa_cmd() parameter: primary key" + "Checking IPA.cmd() parameter: primary key" ); var response = {}; @@ -65,14 +68,14 @@ test("Testing serial_associator().", function() { var associator = serial_associator(params); associator.execute(); - ipa_cmd = orig_ipa_cmd; + IPA.cmd = orig_ipa_cmd; }); test("Testing bulk_associator().", function() { expect(5); - var orig_ipa_cmd = ipa_cmd; + var orig_ipa_cmd = IPA.cmd; var counter = 0; @@ -85,27 +88,27 @@ test("Testing bulk_associator().", function() { params.values = ['user1', 'user2', 'user3']; - ipa_cmd = function(name, args, options, win_callback, fail_callback, objname) { + IPA.cmd = function(name, args, options, win_callback, fail_callback, objname) { counter++; equals( name, params.method, - "Checking ipa_cmd() parameter: method" + "Checking IPA.cmd() parameter: method" ); equals( objname, params.entity_name, - "Checking ipa_cmd() parameter: object name" + "Checking IPA.cmd() parameter: object name" ); equals( args[0], params.pkey, - "Checking ipa_cmd() parameter: primary key" + "Checking IPA.cmd() parameter: primary key" ); equals( options[params.other_entity], "user1,user2,user3", - "Checking ipa_cmd() parameter: options[\""+params.other_entity+"\"]" + "Checking IPA.cmd() parameter: options[\""+params.other_entity+"\"]" ); var response = {}; @@ -120,5 +123,5 @@ test("Testing bulk_associator().", function() { var associator = bulk_associator(params); associator.execute(); - ipa_cmd = orig_ipa_cmd; + IPA.cmd = orig_ipa_cmd; }); diff --git a/install/static/test/details_tests.js b/install/static/test/details_tests.js index 1cb2036fd..d832bd26d 100644 --- a/install/static/test/details_tests.js +++ b/install/static/test/details_tests.js @@ -21,7 +21,7 @@ module('details'); -test("Testing ipa_details_section.create().", function() { +test("Testing IPA.details_section.create().", function() { IPA.ajax_options.async = false; @@ -36,7 +36,7 @@ test("Testing ipa_details_section.create().", function() { } ); - var section = ipa_stanza({name:'IDIDID', label:'NAMENAMENAME'}). + var section = IPA.stanza({name:'IDIDID', label:'NAMENAMENAME'}). input({name:'cn'}). input({name:'description'}). input({name:'number'}); @@ -108,16 +108,16 @@ test("Testing details lifecycle: create, setup, load.", function(){ var result = {}; - ipa_cmd( + IPA.cmd( 'user_show', ['kfrog'], {}, function(data, text_status, xhr) { result = data.result.result; - ok(true, "ipa_cmd() succeeded."); + ok(true, "IPA.cmd() succeeded."); }, function(xhr, text_status, error_thrown) { - ok(false, "ipa_cmd() failed: "+error_thrown); + ok(false, "IPA.cmd() failed: "+error_thrown); } ); @@ -147,37 +147,37 @@ test("Testing details lifecycle: create, setup, load.", function(){ var container = $("<div/>"); var obj_name = 'user'; - ipa_entity_set_details_definition(obj_name, [ - ipa_stanza({name:'identity', label:'Identity Details'}). + IPA.entity_set_details_definition(obj_name, [ + IPA.stanza({name:'identity', label:'Identity Details'}). input({name:'title'}). input({name:'givenname'}). input({name:'sn'}). input({name:'cn'}). input({name:'displayname'}). input({name:'initials'}), - ipa_stanza({name:'account', label:'Account Details'}). + IPA.stanza({name:'account', label:'Account Details'}). input({name:'status', setup: setup_status}). input({name:'uid'}). input({name:'userpassword', save: save_password}). input({name:'uidnumber'}). input({name:'gidnumber'}). input({name:'homedirectory'}), - ipa_stanza({name:'contact', label:'Contact Details'}). + IPA.stanza({name:'contact', label:'Contact Details'}). input({name:'mail'}). input({name:'telephonenumber'}), - ipa_stanza({name:'address'}). + IPA.stanza({name:'address'}). input({name:'street'}). input({name:'location'}). input({name:'state', setup: setup_st}). input({name:'postalcode'}), - ipa_stanza({name:'employee', label:'Employee Information'}). + IPA.stanza({name:'employee', label:'Employee Information'}). input({name:'ou'}). input({name:'manager', load: load_manager}), - ipa_stanza({name:'misc', label:'Misc. Information'}). + IPA.stanza({name:'misc', label:'Misc. Information'}). input({name:'carlicense'}) ]); - var entity = ipa_get_entity(obj_name); + var entity = IPA.fetch_entity(obj_name); var facet = entity.get_facet('details'); facet.create(container); facet.setup(container); @@ -227,7 +227,7 @@ test("Testing details lifecycle: create, setup, load.", function(){ test("Testing create_input().", function() { - var field = ipa_details_field({ + var field = IPA.details_field({ 'name': "name" }); @@ -247,7 +247,7 @@ test("Testing create_input().", function() { test("Testing create_input() read only .", function() { - var field = ipa_details_field({ + var field = IPA.details_field({ 'name': "name" }); @@ -270,9 +270,9 @@ test("Testing create_input() read only .", function() { -test("Testing ipa_details_section_setup again()",function(){ +test("Testing IPA.details_section_setup again()",function(){ - var section = ipa_stanza({name: 'IDIDID', label: 'NAMENAMENAME'}). + var section = IPA.stanza({name: 'IDIDID', label: 'NAMENAMENAME'}). input({name:'cn', label:'Entity Name'}). input({name:'description', label:'Description'}). input({name:'number', label:'Entity ID'}); diff --git a/install/static/test/entity_tests.js b/install/static/test/entity_tests.js index 9d1356ea7..a24f80810 100644 --- a/install/static/test/entity_tests.js +++ b/install/static/test/entity_tests.js @@ -20,20 +20,20 @@ module('entity'); -test('Testing ipa_entity_set_search_definition().', function() { +test('Testing IPA.entity_set_search_definition().', function() { var uid_callback = function() { return true; }; - ipa_entity_set_search_definition('user', [ + IPA.entity_set_search_definition('user', [ ['uid', 'Login', uid_callback] ]); - var facet = ipa_entity_get_search_facet('user'); + var facet = IPA.entity_get_search_facet('user'); ok( facet, - 'ipa_entity_get_search_facet(\'user\') is not null' + 'IPA.entity_get_search_facet(\'user\') is not null' ); var column = facet.get_columns()[0]; @@ -79,13 +79,13 @@ test('Testing ipa_facet_setup_views().', function() { } ); - var entity = ipa_entity({ + var entity = IPA.entity({ 'name': 'user' }); IPA.add_entity(entity); - var facet = ipa_search_facet({ + var facet = IPA.search_facet({ 'name': 'search', 'label': 'Search' }); diff --git a/install/static/test/ipa_tests.js b/install/static/test/ipa_tests.js index 23190c1fb..4fa0d1ea2 100644 --- a/install/static/test/ipa_tests.js +++ b/install/static/test/ipa_tests.js @@ -38,64 +38,64 @@ test("Testing ipa_init().", function() { ); }); -test("Testing ipa_get_param_info().", function() { +test("Testing IPA.get_param_info().", function() { - var param_info = ipa_get_param_info("user", "uid"); + var param_info = IPA.get_param_info("user", "uid"); ok( param_info, - "ipa_get_param_info(\"user\", \"uid\") not null" + "IPA.get_param_info(\"user\", \"uid\") not null" ); equals( param_info["label"], "User login", - "ipa_get_param_info(\"user\", \"uid\")[\"label\"]" + "IPA.get_param_info(\"user\", \"uid\")[\"label\"]" ); equals( - ipa_get_param_info("user", "wrong_attribute"), null, - "ipa_get_param_info(\"user\", \"wrong_attribute\")" + IPA.get_param_info("user", "wrong_attribute"), null, + "IPA.get_param_info(\"user\", \"wrong_attribute\")" ); equals( - ipa_get_param_info("user", null), null, - "ipa_get_param_info(\"user\", null)" + IPA.get_param_info("user", null), null, + "IPA.get_param_info(\"user\", null)" ); equals( - ipa_get_param_info("wrong_entity", "uid"), null, - "ipa_get_param_info(\"wrong_entity\", \"uid\")" + IPA.get_param_info("wrong_entity", "uid"), null, + "IPA.get_param_info(\"wrong_entity\", \"uid\")" ); equals( - ipa_get_param_info(null, "uid"), null, - "ipa_get_param_info(null, \"uid\")" + IPA.get_param_info(null, "uid"), null, + "IPA.get_param_info(null, \"uid\")" ); }); -test("Testing ipa_get_member_attribute().", function() { +test("Testing IPA.get_member_attribute().", function() { equals( - ipa_get_member_attribute("user", "group"), "memberof", - "ipa_get_member_attribute(\"user\", \"group\")" + IPA.get_member_attribute("user", "group"), "memberof", + "IPA.get_member_attribute(\"user\", \"group\")" ); equals( - ipa_get_member_attribute("user", "host"), null, - "ipa_get_member_attribute(\"user\", \"host\")" + IPA.get_member_attribute("user", "host"), null, + "IPA.get_member_attribute(\"user\", \"host\")" ); equals( - ipa_get_member_attribute("user", null), null, - "ipa_get_member_attribute(\"user\", null)" + IPA.get_member_attribute("user", null), null, + "IPA.get_member_attribute(\"user\", null)" ); equals( - ipa_get_member_attribute(null, "group"), null, - "ipa_get_member_attribute(null, \"group\")" + IPA.get_member_attribute(null, "group"), null, + "IPA.get_member_attribute(null, \"group\")" ); }); -test("Testing successful ipa_cmd().", function() { +test("Testing successful IPA.cmd().", function() { var method = 'method'; var args = ['arg1', 'arg2', 'arg3']; @@ -148,7 +148,7 @@ test("Testing successful ipa_cmd().", function() { request.success(xhr, text_status, error_thrown); }; - ipa_cmd(method, args, options, success_handler, error_handler, object); + IPA.cmd(method, args, options, success_handler, error_handler, object); equals( ajax_counter, 1, @@ -170,7 +170,7 @@ test("Testing successful ipa_cmd().", function() { $.ajax = orig; }); -test("Testing unsuccessful ipa_cmd().", function() { +test("Testing unsuccessful IPA.cmd().", function() { var method = 'method'; var args = ['arg1', 'arg2', 'arg3']; @@ -223,7 +223,7 @@ test("Testing unsuccessful ipa_cmd().", function() { request.error(xhr, text_status, error_thrown); }; - ipa_cmd(method, args, options, success_handler, error_handler, object); + IPA.cmd(method, args, options, success_handler, error_handler, object); var dialog = IPA.error_dialog.parent('.ui-dialog'); diff --git a/install/static/test/navigation_tests.js b/install/static/test/navigation_tests.js index 4321939f9..bc198ac0c 100644 --- a/install/static/test/navigation_tests.js +++ b/install/static/test/navigation_tests.js @@ -30,7 +30,7 @@ test("Testing nav_create().", function() { {name:'group', entity:'group'} ]}]; - var entity = ipa_entity({name: 'user'}); + var entity = IPA.entity({name: 'user'}); entity.setup = function(container){ user_mock_called = true; same(container[0].id,'user','user id'); @@ -38,7 +38,7 @@ test("Testing nav_create().", function() { }; IPA.add_entity(entity); - entity = ipa_entity({name: 'group'}); + entity = IPA.entity({name: 'group'}); entity.setup = function(container){ group_mock_called = true; same(container[0].id,'group','group id'); diff --git a/install/static/user.js b/install/static/user.js index c0e6faede..58304d365 100644 --- a/install/static/user.js +++ b/install/static/user.js @@ -20,9 +20,9 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ -function ipa_user(){ +IPA.user = function (){ - var that = ipa_entity({ + var that = IPA.entity({ name: 'user' }); @@ -38,7 +38,7 @@ function ipa_user(){ 'associator': 'serial' }); - var search_facet = ipa_search_facet({ + var search_facet = IPA.search_facet({ 'name': 'search', 'label': 'Search', entity_name: that.name @@ -54,15 +54,15 @@ function ipa_user(){ that.add_facet(details_facet({name:'details',label:'Details'})); - var dialog = ipa_add_dialog({ + var dialog = IPA.add_dialog({ 'name': 'add', 'title': 'Add User' }); that.add_dialog(dialog); - dialog.add_field(ipa_text_widget({ name: 'uid', undo: false })); - dialog.add_field(ipa_text_widget({ name: 'givenname', undo: false })); - dialog.add_field(ipa_text_widget({ name: 'sn', undo: false })); + dialog.add_field(IPA.text_widget({ name: 'uid', undo: false })); + dialog.add_field(IPA.text_widget({ name: 'givenname', undo: false })); + dialog.add_field(IPA.text_widget({ name: 'sn', undo: false })); dialog.init(); /*eventually, we need to call @@ -76,17 +76,17 @@ function ipa_user(){ function details_facet(spec) { spec = spec || {}; - var that = ipa_details_facet(spec); + var that = IPA.details_facet(spec); var sections =[ - ipa_stanza({name:'identity', label:'Identity Details'}). + IPA.stanza({name:'identity', label:'Identity Details'}). input({name:'title'}). input({name:'givenname'}). input({name:'sn'}). input({name:'cn'}). input({name:'displayname'}). input({name:'initials'}), - ipa_stanza({name:'account', label:'Account Details'}). + IPA.stanza({name:'account', label:'Account Details'}). custom_input(user_status_widget({name:'nsaccountlock'})). input({name:'uid'}). input({name:'userpassword', load: user_password_load}). @@ -94,21 +94,21 @@ function ipa_user(){ input({name:'gidnumber'}). input({name:'loginshell'}). input({name:'homedirectory'}), - ipa_stanza({name:'contact', label:'Contact Details'}). + 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'}). + 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'}). + IPA.stanza({name:'employee', label:'Employee Information'}). input({name:'ou', label:'Org. Unit'}). input({name:'manager'}), - ipa_stanza({name:'misc', label:'Misc. Information'}). + IPA.stanza({name:'misc', label:'Misc. Information'}). input({name:'carlicense'}) ]; for (var i = 0; i < sections.length; i += 1){ @@ -118,7 +118,7 @@ function ipa_user(){ } return that; } -IPA.add_entity(ipa_user()); +IPA.add_entity(IPA.user()); /* ATTRIBUTE CALLBACKS */ @@ -127,7 +127,7 @@ function user_status_widget(spec) { spec = spec || {}; - var that = ipa_widget(spec); + var that = IPA.widget(spec); that.update = function() { @@ -135,7 +135,7 @@ function user_status_widget(spec) { $('dd', that.container).remove(); - var dd = ipa_create_first_dd(this.name); + var dd = IPA.create_first_dd(this.name); dd.appendTo(that.container); var lock_field = 'nsaccountlock'; @@ -176,7 +176,7 @@ function user_status_widget(spec) { if (val == 'Active') { command = 'user_disable'; } - ipa_cmd(command, [pkey], {}, on_lock_win,on_lock_fail); + IPA.cmd(command, [pkey], {}, on_lock_win,on_lock_fail); return (false); } @@ -200,7 +200,7 @@ function resetpwd_on_click(){ pw_pkey = [user_pkey]; } - ipa_cmd('passwd', + IPA.cmd('passwd', pw_pkey, {"password":new_password}, function(){ alert("Password change complete"); @@ -243,7 +243,7 @@ function user_password_load(result) { $('dd', that.container).remove(); - var dd = ipa_create_first_dd(this.name); + var dd = IPA.create_first_dd(this.name); dd.appendTo(that.container); var link = $('<a/>',{ @@ -276,7 +276,7 @@ function user_state_load(result) { //next.css('clear', 'none'); //next.css('width', '70px'); - var dd = ipa_create_first_dd(this.name); + var dd = IPA.create_first_dd(this.name); dd.append(select_temp); dd.appendTo(that.container); diff --git a/install/static/widget.js b/install/static/widget.js index d9661c3e8..297a44acc 100755..100644 --- a/install/static/widget.js +++ b/install/static/widget.js @@ -20,7 +20,7 @@ /* REQUIRES: ipa.js */ -function ipa_widget(spec) { +IPA.widget = function(spec) { spec = spec || {}; @@ -81,7 +81,7 @@ function ipa_widget(spec) { function init() { if (that.entity_name && !that.label){ - that.param_info = ipa_get_param_info(that.entity_name, that.name); + that.param_info = IPA.get_param_info(that.entity_name, that.name); if ((that.param_info) && (that.label === undefined)){ that.label = that.param_info.label; } @@ -169,11 +169,12 @@ function ipa_widget(spec) { return that; } -function ipa_text_widget(spec) { + +IPA.text_widget = function(spec) { spec = spec || {}; - var that = ipa_widget(spec); + var that = IPA.widget(spec); that.size = spec.size || 30; @@ -256,11 +257,11 @@ function ipa_text_widget(spec) { return that; } -function ipa_checkbox_widget(spec) { +IPA.checkbox_widget = function (spec) { spec = spec || {}; var is_checked = spec.checked || ''; - var that = ipa_widget(spec); + var that = IPA.widget(spec); that.create = function(container) { @@ -312,11 +313,11 @@ function ipa_checkbox_widget(spec) { return that; } -function ipa_radio_widget(spec) { +IPA.radio_widget = function(spec) { spec = spec || {}; - var that = ipa_widget(spec); + var that = IPA.widget(spec); that.options = spec.options; @@ -390,11 +391,11 @@ function ipa_radio_widget(spec) { return that; } -function ipa_textarea_widget(spec) { +IPA.textarea_widget = function (spec) { spec = spec || {}; - var that = ipa_widget(spec); + var that = IPA.widget(spec); that.rows = spec.rows || 5; that.cols = spec.cols || 40; @@ -449,7 +450,7 @@ function ipa_textarea_widget(spec) { return that; } -function ipa_button_widget(spec) { +IPA.button_widget = function (spec) { spec = spec || {}; @@ -457,7 +458,7 @@ function ipa_button_widget(spec) { spec.load = spec.load || load; spec.save = spec.save || save; - var that = ipa_widget(spec); + var that = IPA.widget(spec); that.click = spec.click; @@ -466,7 +467,7 @@ function ipa_button_widget(spec) { that.widget_setup(container); var input = $('[name="'+that.name+'"]', that.container); - input.replaceWith(ipa_button({ 'label': that.label, 'click': that.click })); + input.replaceWith(IPA.button({ 'label': that.label, 'click': that.click })); } function load(record) { @@ -480,7 +481,7 @@ function ipa_button_widget(spec) { } -function ipa_column(spec) { +IPA.column = function (spec) { spec = spec || {}; @@ -496,7 +497,7 @@ function ipa_column(spec) { that.init = function() { if (that.entity_name && !that.label) { - var param_info = ipa_get_param_info(that.entity_name, that.name); + var param_info = IPA.get_param_info(that.entity_name, that.name); if (param_info) that.label = param_info.label; } }; @@ -514,11 +515,11 @@ function ipa_column(spec) { return that; } -function ipa_table_widget(spec) { +IPA.table_widget = function (spec) { spec = spec || {}; - var that = ipa_widget(spec); + var that = IPA.widget(spec); that.scrollable = spec.scrollable; that.save_values = typeof spec.save_values == 'undefined' ? true : spec.save_values; @@ -552,7 +553,7 @@ function ipa_table_widget(spec) { }; that.create_column = function(spec) { - var column = ipa_column(spec); + var column = IPA.column(spec); that.add_column(column); return column; }; @@ -818,7 +819,7 @@ function ipa_table_widget(spec) { } var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || ''; - ipa_cmd('show', [pkey], {'all': true, 'rights': true}, on_success, on_error, that.entity_name); + IPA.cmd('show', [pkey], {'all': true, 'rights': true}, on_success, on_error, that.entity_name); }; if (spec.columns) { @@ -839,7 +840,7 @@ function ipa_table_widget(spec) { /** * This is a base class for dialog boxes. */ -function ipa_dialog(spec) { +IPA.dialog = function(spec) { spec = spec || {}; @@ -1003,11 +1004,11 @@ function ipa_dialog(spec) { * This dialog provides an interface for searching and selecting * values from the available results. */ -function ipa_adder_dialog(spec) { +IPA.adder_dialog = function (spec) { spec = spec || {}; - var that = ipa_dialog(spec); + var that = IPA.dialog(spec); that.width = spec.width || '600px'; @@ -1036,13 +1037,13 @@ function ipa_adder_dialog(spec) { }; that.create_column = function(spec) { - var column = ipa_column(spec); + var column = IPA.column(spec); that.add_column(column); return column; }; that.init = function() { - that.available_table = ipa_table_widget({ + that.available_table = IPA.table_widget({ name: 'available', scrollable: true, height: '151px' @@ -1052,7 +1053,7 @@ function ipa_adder_dialog(spec) { that.available_table.init(); - that.selected_table = ipa_table_widget({ + that.selected_table = IPA.table_widget({ name: 'selected', scrollable: true, height: '151px' @@ -1165,7 +1166,7 @@ function ipa_adder_dialog(spec) { that.filter_field = $('input[name=filter]', that.container); var button = $('input[name=find]', that.container); - that.find_button = ipa_button({ + that.find_button = IPA.button({ 'label': button.val(), 'icon': 'ui-icon-search', 'click': function() { that.search(); } @@ -1173,7 +1174,7 @@ function ipa_adder_dialog(spec) { button.replaceWith(that.find_button); button = $('input[name=remove]', that.container); - that.remove_button = ipa_button({ + that.remove_button = IPA.button({ 'label': button.val(), 'icon': 'ui-icon-trash', 'click': function() { @@ -1183,7 +1184,7 @@ function ipa_adder_dialog(spec) { button.replaceWith(that.remove_button); button = $('input[name=add]', that.container); - that.add_button = ipa_button({ + that.add_button = IPA.button({ 'label': button.val(), 'icon': 'ui-icon-plus', 'click': function() { @@ -1256,11 +1257,11 @@ function ipa_adder_dialog(spec) { /** * This dialog displays the values to be deleted. */ -function ipa_deleter_dialog(spec) { +IPA.deleter_dialog = function (spec) { spec = spec || {}; - var that = ipa_dialog(spec); + var that = IPA.dialog(spec); that.title = spec.title || IPA.messages.button.remove; that.remove = spec.remove; |