You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2014/05/13 14:40:07 UTC
git commit: updated refs/heads/4.4 to 7a13afc
Repository: cloudstack
Updated Branches:
refs/heads/4.4 68a44cf23 -> 7a13afca0
CLOUDSTACK-6379: UI > fix a bug that domain admin failed to be created when current login doesn't have visibility to root domain object.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7a13afca
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7a13afca
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7a13afca
Branch: refs/heads/4.4
Commit: 7a13afca0af10d45e2f58475018cfd1ffb906585
Parents: 68a44cf
Author: Jessica Wang <je...@apache.org>
Authored: Mon May 12 15:33:40 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Tue May 13 14:39:56 2014 +0200
----------------------------------------------------------------------
ui/scripts/accounts.js | 3 +-
ui/scripts/accountsWizard.js | 67 ++++++---------------------------------
2 files changed, 10 insertions(+), 60 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7a13afca/ui/scripts/accounts.js
----------------------------------------------------------------------
diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index ced9da0..a789084 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -17,8 +17,7 @@
(function(cloudStack) {
var domainObjs;
- var rootDomainId;
-
+
cloudStack.sections.accounts = {
title: 'label.accounts',
id: 'accounts',
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7a13afca/ui/scripts/accountsWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/accountsWizard.js b/ui/scripts/accountsWizard.js
index d84fbfa..e02a04e 100644
--- a/ui/scripts/accountsWizard.js
+++ b/ui/scripts/accountsWizard.js
@@ -16,6 +16,8 @@
// under the License.
(function(cloudStack, $) {
+ var rootDomainId;
+
cloudStack.accountsWizard = {
informationWithinLdap: {
@@ -75,20 +77,9 @@
validation: {
required: true
},
- select: function(args) {
- var data = {};
-
- if (args.context.users) { // In accounts section
- data.listAll = true;
- } else if (args.context.domains) { // In domain section (use specific domain)
- data.id = args.context.domains[0].id;
- }
-
+ select: function(args) {
$.ajax({
- url: createURL("listDomains"),
- data: data,
- dataType: "json",
- async: false,
+ url: createURL("listDomains"),
success: function(json) {
var items = [];
domainObjs = json.listdomainsresponse.domain;
@@ -204,8 +195,10 @@
}
var accountType = args.data.accounttype;
- if (args.data.accounttype == "1" && args.data.domainid != rootDomainId) { //if account type is admin, but domain is not Root domain
- accountType = "2"; // Change accounttype from root-domain("1") to domain-admin("2")
+ if (accountType == "1") { //if "admin" is selected in account type dropdown
+ if (rootDomainId == undefined || args.data.domainid != rootDomainId ) { //but current login has no visibility to root domain object, or the selected domain is not root domain
+ accountType = "2"; // change accountType from root-domain("1") to domain-admin("2")
+ }
}
array1.push("&accounttype=" + accountType);
@@ -268,48 +261,6 @@
}
});
}
- }
- /*
- action: function(args) {
- var array1 = [];
-
- var username = args.data.username;
-
- array1.push("&domainid=" + args.data.domainid);
-
- if (args.data.account != null && args.data.account.length != 0) {
- array1.push("&account=" + args.data.account);
- }
-
- if (args.data.accounttype == "1" && args.data.domainid != rootDomainId) {
- args.data.accounttype = "2";
- }
- array1.push("&accountType=" + args.data.accounttype);
-
- if (args.data.timezone != null && args.data.timezone.length != 0) {
- array1.push("&timezone=" + args.data.timezone);
- }
- if (args.data.networkdomain != null && args.data.networkdomain != 0) {
- array1.push("&networkDomain=" + args.data.networkdomain);
- }
-
- for (var i = 0; i < username.length; i++) {
- $.ajax({
- url: createURL("ldapCreateAccount&username=" + username[i] + array1.join("")),
- dataType: "json",
- async: false,
- success: function(json) {
- var item = json.createaccountresponse.account;
- args.response.success({
- data: item
- });
- },
- error: function(XMLHttpResponse) {
- args.response.error(parseXMLHttpResponse(XMLHttpResponse));
- }
- });
- }
- }
- */
+ }
};
}(cloudStack, jQuery));
\ No newline at end of file