Skip to content

Commit 20c581e

Browse files
Jessica WangDaanHoogland
authored andcommitted
BUG-ID: CS-19795: UI > Add LDAP Account - fix a bug that a LDAP account that does not have email and all LDAP accounts below it are missing from the listing.
Reviewed-by: Brian (cherry picked from commit 9531678)
1 parent 25b4159 commit 20c581e

2 files changed

Lines changed: 90 additions & 6 deletions

File tree

‎ui/scripts/accounts.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
label: 'Add LDAP Account',
9797
isHeader: true,
9898
preFilter: function(args) {
99+
//if ((isAdmin() || isDomainAdmin()) && true) { //for testing only
99100
if ((isAdmin() || isDomainAdmin()) && isLdapEnabled()) {
100101
return true;
101102
} else {

‎ui/scripts/ui-custom/accountsWizard.js‎

Lines changed: 89 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,22 +130,105 @@
130130
dataType: "json",
131131
async: false,
132132
success: function(json) {
133+
//for testing only (begin)
134+
/*
135+
json = {
136+
"ldapuserresponse": {
137+
"count": 11,
138+
"LdapUser": [
139+
{
140+
"email": "test@test.com",
141+
"principal": "CN=Administrator,CN=Users,DC=hyd-qa,DC=com",
142+
"username": "Administrator",
143+
"domain": "CN=Administrator"
144+
},
145+
{
146+
"email": "test@test.com",
147+
"principal": "CN=Guest,CN=Users,DC=hyd-qa,DC=com",
148+
"username": "Guest",
149+
"domain": "CN=Guest"
150+
},
151+
{
152+
"email": "test@test.com",
153+
"principal": "CN=IUSR_HYD-QA12,CN=Users,DC=hyd-qa,DC=com",
154+
"username": "IUSR_HYD-QA12",
155+
"domain": "CN=IUSR_HYD-QA12"
156+
},
157+
{
158+
"email": "test@test.com",
159+
"principal": "CN=IWAM_HYD-QA12,CN=Users,DC=hyd-qa,DC=com",
160+
"username": "IWAM_HYD-QA12",
161+
"domain": "CN=IWAM_HYD-QA12"
162+
},
163+
{
164+
"email": "test@test.com",
165+
"principal": "CN=SUPPORT_388945a0,CN=Users,DC=hyd-qa,DC=com",
166+
"username": "SUPPORT_388945a0",
167+
"domain": "CN=SUPPORT_388945a0"
168+
},
169+
{
170+
"principal": "CN=jessica j,CN=Users,DC=hyd-qa,DC=com",
171+
"firstname": "jessica",
172+
"lastname": "j",
173+
"username": "jessica",
174+
"domain": "CN=jessica j"
175+
},
176+
{
177+
"principal": "CN=krbtgt,CN=Users,DC=hyd-qa,DC=com",
178+
"username": "krbtgt",
179+
"domain": "CN=krbtgt"
180+
},
181+
{
182+
"email": "sadhu@sadhu.com",
183+
"principal": "CN=sadhu,CN=Users,DC=hyd-qa,DC=com",
184+
"firstname": "sadhu",
185+
"username": "sadhu",
186+
"domain": "CN=sadhu"
187+
},
188+
{
189+
"email": "test@test.com",
190+
"principal": "CN=sangee1 hariharan,CN=Users,DC=hyd-qa,DC=com",
191+
"firstname": "sangee1",
192+
"lastname": "hariharan",
193+
"username": "sangee1",
194+
"domain": "CN=sangee1 hariharan"
195+
},
196+
{
197+
"email": "test@test.com",
198+
"principal": "CN=sanjeev n.,CN=Users,DC=hyd-qa,DC=com",
199+
"firstname": "sanjeev",
200+
"username": "sanjeev",
201+
"domain": "CN=sanjeev n."
202+
},
203+
{
204+
"email": "test@test.com",
205+
"principal": "CN=test1dddd,CN=Users,DC=hyd-qa,DC=com",
206+
"firstname": "test1",
207+
"username": "test1dddd",
208+
"domain": "CN=test1dddd"
209+
}
210+
]
211+
}
212+
};
213+
*/
214+
//for testing only (end)
215+
133216
if (json.ldapuserresponse.count > 0) {
134217
$(json.ldapuserresponse.LdapUser).each(function() {
135218
var $result = $('<tr>');
136219

137220
$result.append(
138221
$('<td>').addClass('select').append(
139222
$('<input>').attr({
140-
type: 'checkbox', name: 'username', value: this.username
223+
type: 'checkbox', name: 'username', value: _s(this.username)
141224
})
142225
),
143-
$('<td>').addClass('name').html(this.firstname + ' ' + this.lastname)
144-
.attr('title', this.firstname + ' ' + this.lastname),
145-
$('<td>').addClass('username').html(this.username)
226+
$('<td>').addClass('name').html(_s(this.firstname) + ' ' + _s(this.lastname))
227+
.attr('title', _s(this.firstname) + ' ' + _s(this.lastname)),
228+
$('<td>').addClass('username').html(_s(this.username))
146229
.attr('title', this.username),
147-
$('<td>').addClass('email').html(this.email)
148-
.attr('title', this.email)
230+
$('<td>').addClass('email').html(_s(this.email))
231+
.attr('title', _s(this.email))
149232
)
150233

151234
$table.append($result);

0 commit comments

Comments
 (0)