URL: https://github.com/freeipa/freeipa/pull/1048 Author: stlaz Title: #1048: Backport PR 1044 to ipa-4-6 Action: opened
PR body: """ This PR was opened automatically because PR #1044 was pushed to master and backport to ipa-4-6 is required. """ To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/1048/head:pr1048 git checkout pr1048
From 218c91e366069e9d12ffdd2520082da1df8ba3c2 Mon Sep 17 00:00:00 2001 From: Pavel Vomacka <pvoma...@redhat.com> Date: Wed, 6 Sep 2017 15:19:58 +0200 Subject: [PATCH 1/2] WebUI: remove unused parameter from get_whoami_command The batch param is not used anywhere therefore we can remove it. https://pagure.io/freeipa/issue/7143 --- install/ui/src/freeipa/ipa.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js index 2538001c94..3920b8eb0a 100644 --- a/install/ui/src/freeipa/ipa.js +++ b/install/ui/src/freeipa/ipa.js @@ -191,7 +191,7 @@ var IPA = function () { } })); - batch.add_command(that.get_whoami_command(true)); + batch.add_command(that.get_whoami_command()); batch.add_command(rpc.command({ method: 'env', @@ -259,10 +259,8 @@ var IPA = function () { /** * Prepares `user-find --whoami` command * @protected - * @param {boolean} batch - Specifies if it will be used as single command or - * in a batch. */ - that.get_whoami_command = function(batch) { + that.get_whoami_command = function() { return rpc.command({ method: 'whoami', on_success: function(data, text_status, xhr) { From 189a574d7355ba1e104fbf207e7f7537c33f745a Mon Sep 17 00:00:00 2001 From: Pavel Vomacka <pvoma...@redhat.com> Date: Wed, 6 Sep 2017 15:20:07 +0200 Subject: [PATCH 2/2] WebUI: Fix calling undefined method during reset passwords When calling reset password the whoami command is not called in batch command, therefore the result is different then in calling during reset password operation. That needs to be handled to properly set entity_show method which needs to be called after to gather data about logged in entity. https://pagure.io/freeipa/issue/7143 --- install/ui/src/freeipa/ipa.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js index 3920b8eb0a..138ca031b8 100644 --- a/install/ui/src/freeipa/ipa.js +++ b/install/ui/src/freeipa/ipa.js @@ -264,18 +264,19 @@ var IPA = function () { return rpc.command({ method: 'whoami', on_success: function(data, text_status, xhr) { - that.whoami.metadata = data; + that.whoami.metadata = data.result || data; + var wa_data = that.whoami.metadata; rpc.command({ - method: data.details || data.command, - args: data.arguments, + method: wa_data.details || wa_data.command, + args: wa_data.arguments, options: function() { - var options = data.options || []; + var options = wa_data.options || []; $.extend(options, {all: true}); return options; }(), on_success: function(data, text_status, xhr) { - that.whoami.data = false ? data.result[0] : data.result.result; + that.whoami.data = data.result.result; var entity = that.whoami.metadata.object; if (entity === 'user') {
_______________________________________________ FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org