From 95b85f907b96bde5907e8190fac262ff869b2b03 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Tue, 4 Oct 2011 18:38:08 +0200 Subject: Disables gid field if not posix group in group adder dialog https://fedorahosted.org/freeipa/ticket/1922 gidNumber is not an allowed attribute for a non-posix group. When adding a non-posix group from the UI, unchecking the "Is this a POSIX group?:" box should disable the "GID:" field. --- install/ui/group.js | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'install/ui/group.js') diff --git a/install/ui/group.js b/install/ui/group.js index b9664ea6..a63a7800 100644 --- a/install/ui/group.js +++ b/install/ui/group.js @@ -102,6 +102,7 @@ IPA.entity_factories.group = function () { }). standard_association_facets(). adder_dialog({ + factory: IPA.group_adder_dialog, fields: [ 'cn', { @@ -133,4 +134,30 @@ IPA.group_nonposix_checkbox_widget = function (spec) { }; return that; -}; \ No newline at end of file +}; + +IPA.group_adder_dialog = function (spec) { + + spec = spec || {}; + + var that = IPA.add_dialog(spec); + + var init = function() { + + var posix_field = that.get_field('nonposix'); + posix_field.value_changed.attach(that.on_posix_change); + }; + + that.on_posix_change = function (value) { + + var gid_field = that.get_field('gidnumber'); + if(value) { + gid_field.reset(); + } + gid_field.set_enabled(!value); + }; + + init(); + + return that; +}; -- cgit