You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ui/scripts/accountsWizard.js
+9-58Lines changed: 9 additions & 58 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,8 @@
16
16
// under the License.
17
17
18
18
(function(cloudStack,$){
19
+
varrootDomainId;
20
+
19
21
cloudStack.accountsWizard={
20
22
21
23
informationWithinLdap: {
@@ -75,20 +77,9 @@
75
77
validation: {
76
78
required: true
77
79
},
78
-
select: function(args){
79
-
vardata={};
80
-
81
-
if(args.context.users){// In accounts section
82
-
data.listAll=true;
83
-
}elseif(args.context.domains){// In domain section (use specific domain)
84
-
data.id=args.context.domains[0].id;
85
-
}
86
-
80
+
select: function(args){
87
81
$.ajax({
88
-
url: createURL("listDomains"),
89
-
data: data,
90
-
dataType: "json",
91
-
async: false,
82
+
url: createURL("listDomains"),
92
83
success: function(json){
93
84
varitems=[];
94
85
domainObjs=json.listdomainsresponse.domain;
@@ -204,8 +195,10 @@
204
195
}
205
196
206
197
varaccountType=args.data.accounttype;
207
-
if(args.data.accounttype=="1"&&args.data.domainid!=rootDomainId){//if account type is admin, but domain is not Root domain
208
-
accountType="2";// Change accounttype from root-domain("1") to domain-admin("2")
198
+
if(accountType=="1"){//if "admin" is selected in account type dropdown
199
+
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
200
+
accountType="2";// change accountType from root-domain("1") to domain-admin("2")
201
+
}
209
202
}
210
203
array1.push("&accounttype="+accountType);
211
204
@@ -268,48 +261,6 @@
268
261
}
269
262
});
270
263
}
271
-
}
272
-
/*
273
-
action: function(args) {
274
-
var array1 = [];
275
-
276
-
var username = args.data.username;
277
-
278
-
array1.push("&domainid=" + args.data.domainid);
279
-
280
-
if (args.data.account != null && args.data.account.length != 0) {
281
-
array1.push("&account=" + args.data.account);
282
-
}
283
-
284
-
if (args.data.accounttype == "1" && args.data.domainid != rootDomainId) {
0 commit comments