From 91fae67fa48d7fa1f4213bad65000d3669a8c8b2 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Fri, 14 Jan 2011 13:19:56 -0500 Subject: null pkey If the pkey is null, send an empty array. If the pkey is not null, send and array of length 1 with the pkey in it. Addresses: https://fedorahosted.org/freeipa/ticket/767 --- install/static/details.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'install') diff --git a/install/static/details.js b/install/static/details.js index b5c74a62c..2b163423b 100644 --- a/install/static/details.js +++ b/install/static/details.js @@ -731,8 +731,6 @@ IPA.details_update = function (on_win, on_fail) var that = this; var entity_name = that.entity_name; - var pkey = that.get_primary_key(); - function update_on_win(data, text_status, xhr) { if (on_win) on_win(data, text_status, xhr); @@ -748,13 +746,6 @@ IPA.details_update = function (on_win, on_fail) on_fail(xhr, text_status, error_thrown); } - /* - The check - if (!pkey) { return; } - used to happen here, but it breaks krbtpolicy, which allows a null pkey - and usually requires it. - */ - var values; var modlist = {'all': true, 'setattr': [], 'addattr': [], 'rights': true}; var attrs_wo_option = {}; @@ -800,7 +791,14 @@ IPA.details_update = function (on_win, on_fail) } } - IPA.cmd('mod', [pkey], modlist, update_on_win, null, entity_name); + var pkey = that.get_primary_key() ; + if (pkey){ + pkey = [pkey]; + }else{ + pkey = []; + } + + IPA.cmd('mod', pkey, modlist, update_on_win, null, entity_name); } -- cgit