From b5fe1e8f615271f4f71826b83e51f5e3abd277a6 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Thu, 21 Jul 2011 02:23:29 -0500 Subject: Removed HBAC access time code. The HBAC access time is currently not supported, so the related UI code has been removed to reduce maintenance issue. When the feature becomes supported in the future the code may be restored/rewritten. Ticket #546 --- install/ui/hbac.js | 344 ----------------------------------------------------- 1 file changed, 344 deletions(-) diff --git a/install/ui/hbac.js b/install/ui/hbac.js index 387c03cee..1e2cefb8d 100644 --- a/install/ui/hbac.js +++ b/install/ui/hbac.js @@ -358,16 +358,6 @@ IPA.hbacrule_details_facet = function(spec) { }) }; - var remove_accesstime = { - 'template': IPA.command({ - entity: that.entity_name, - method: 'remove_accesstime', - args: [pkey], - options: {all: true, rights: true} - }), - 'commands': [] - }; - var categories = { 'usercategory': { 'remove_values': false @@ -476,17 +466,6 @@ IPA.hbacrule_details_facet = function(spec) { continue; } - if (field.name == 'accesstime') { - // if accesstime is dirty, it means 'Any Time' is selected, - // so existing values have to be removed - for (var k=0; k', { 'name': 'text' }).appendTo(container); - - span.append(that.text); - - for (var i=0; i', { - 'type': 'radio', - 'name': that.name, - 'value': option.value - }).appendTo(container); - - container.append(' '); - - container.append(option.label); - - container.append(' '); - } - - that.create_undo(container); - - container.append('
'); - - span = $('', { - name: 'table', - 'class': 'details-field' - }).appendTo(container); - - that.table.create(span); - - var buttons = $('span[name=buttons]', span); - - $('', { - 'type': 'button', - 'name': 'remove', - 'value': IPA.messages.buttons.remove - }).appendTo(buttons); - - $('', { - 'type': 'button', - 'name': 'add', - 'value': IPA.messages.buttons.add - }).appendTo(buttons); - }; - - that.setup = function(container) { - - that.widget_setup(container); - - var span = $('.details-field[name="table"]', that.container); - that.table.setup(span); - - var button = $('input[name=remove]', span); - button.replaceWith(IPA.button({ - name: 'remove', - 'label': button.val(), - 'icon': 'remove-icon', - 'click': function() { that.remove(that.container); } - })); - - button = $('input[name=add]', span); - button.replaceWith(IPA.button({ - name: 'add', - 'label': button.val(), - 'icon': 'add-icon', - 'click': function() { that.add(that.container); } - })); - - var input = $('input[name="'+that.name+'"]', that.container); - input.change(function() { - that.set_dirty(true); - }); - - var undo = that.get_undo(); - undo.click(function() { - that.reset(); - }); - }; - - that.save = function() { - var value = $('input[name="'+that.name+'"]:checked', that.container).val(); - if (value === '') { - return that.table.save(); - } else { - return []; - } - }; - - that.load = function(record) { - - that.values = record[that.name] || []; - that.reset(); - }; - - that.update = function() { - - that.set_category(that.container, that.values && that.values.length ? '' : 'all'); - - that.table.tbody.empty(); - for (var i=0; that.values && i').appendTo(dialog.container); - - var tr = $('').appendTo(table); - - var td = $('', { - 'style': 'vertical-align: top;' - }).appendTo(tr); - td.append(that.label+': '); - - td = $('').appendTo(tr); - - var span = $('', { 'name': that.name }).appendTo(td); - - $('', { - 'type': 'text', - 'name': that.name, - 'size': 40 - }).appendTo(span); - - tr = $('').appendTo(table); - - td = $('', { - 'style': 'vertical-align: top;' - }).appendTo(tr); - td.append('Example:'); - - td = $('').appendTo(tr); - - td.append('Every day between 0800 and 1400:
'); - td.append('periodic daily 0800-1400

'); - - td.append('December 16, 2010 from 10:32 until 10:33:
'); - td.append('absolute 201012161032 ~ 201012161033'); - }; - - function add(on_success, on_error) { - - var field = dialog.get_field(that.name); - var value = field.save()[0]; - - var command = IPA.command({ - entity: that.entity_name, - method: 'add_'+that.name, - args: [pkey], - on_success: function() { - that.refresh(); - if (on_success) on_success(); - }, - on_error: function() { - that.refresh(); - if (on_error) on_error(); - } - }); - - command.set_option(that.name, value); - - command.execute(); - } - - dialog.add_button(IPA.messages.buttons.add, function() { - add( - function() { dialog.reset(); } - ); - }); - - dialog.add_button(IPA.messages.buttons.add_and_close, function() { - add( - function() { dialog.close(); }, - function() { dialog.close(); } - ); - }); - - dialog.add_button(IPA.messages.buttons.cancel, function() { - dialog.close(); - }); - - dialog.init(); - - dialog.open(that.container); - }; - - that.remove = function() { - - var values = that.table.get_selected_values(); - - var title; - if (!values.length) { - title = IPA.messages.dialogs.remove_empty; - alert(title); - return; - } - - var pkey = IPA.nav.get_state(that.entity_name+'-pkey'); - title = IPA.messages.association.remove; - title = title.replace('${entity}', IPA.metadata.objects[that.entity_name].label_singular); - title = title.replace('${primary_key}', pkey); - title = title.replace('${other_entity}', that.label); - - var dialog = IPA.deleter_dialog({ - 'title': title, - 'values': values - }); - - dialog.execute = function() { - - var batch = IPA.batch_command({ - 'on_success': function() { - that.refresh(); - dialog.close(); - }, - 'on_error': function() { - that.refresh(); - dialog.close(); - } - }); - - for (var i=0; i