mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
CLOUDSTACK-6487: 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.
This commit is contained in:
parent
e0e226869d
commit
aabe6f2baf
@ -97,6 +97,7 @@
|
||||
label: 'Add LDAP Account',
|
||||
isHeader: true,
|
||||
preFilter: function(args) {
|
||||
//if ((isAdmin() || isDomainAdmin()) && true) { //for testing only
|
||||
if ((isAdmin() || isDomainAdmin()) && isLdapEnabled()) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@ -130,6 +130,89 @@
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
//for testing only (begin)
|
||||
/*
|
||||
json = {
|
||||
"ldapuserresponse": {
|
||||
"count": 11,
|
||||
"LdapUser": [
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=Administrator,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "Administrator",
|
||||
"domain": "CN=Administrator"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=Guest,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "Guest",
|
||||
"domain": "CN=Guest"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=IUSR_HYD-QA12,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "IUSR_HYD-QA12",
|
||||
"domain": "CN=IUSR_HYD-QA12"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=IWAM_HYD-QA12,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "IWAM_HYD-QA12",
|
||||
"domain": "CN=IWAM_HYD-QA12"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=SUPPORT_388945a0,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "SUPPORT_388945a0",
|
||||
"domain": "CN=SUPPORT_388945a0"
|
||||
},
|
||||
{
|
||||
"principal": "CN=jessica j,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "jessica",
|
||||
"lastname": "j",
|
||||
"username": "jessica",
|
||||
"domain": "CN=jessica j"
|
||||
},
|
||||
{
|
||||
"principal": "CN=krbtgt,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "krbtgt",
|
||||
"domain": "CN=krbtgt"
|
||||
},
|
||||
{
|
||||
"email": "sadhu@sadhu.com",
|
||||
"principal": "CN=sadhu,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "sadhu",
|
||||
"username": "sadhu",
|
||||
"domain": "CN=sadhu"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=sangee1 hariharan,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "sangee1",
|
||||
"lastname": "hariharan",
|
||||
"username": "sangee1",
|
||||
"domain": "CN=sangee1 hariharan"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=sanjeev n.,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "sanjeev",
|
||||
"username": "sanjeev",
|
||||
"domain": "CN=sanjeev n."
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=test1dddd,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "test1",
|
||||
"username": "test1dddd",
|
||||
"domain": "CN=test1dddd"
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
*/
|
||||
//for testing only (end)
|
||||
|
||||
if (json.ldapuserresponse.count > 0) {
|
||||
$(json.ldapuserresponse.LdapUser).each(function() {
|
||||
var $result = $('<tr>');
|
||||
@ -137,15 +220,15 @@
|
||||
$result.append(
|
||||
$('<td>').addClass('select').append(
|
||||
$('<input>').attr({
|
||||
type: 'checkbox', name: 'username', value: this.username
|
||||
type: 'checkbox', name: 'username', value: _s(this.username)
|
||||
})
|
||||
),
|
||||
$('<td>').addClass('name').html(this.firstname + ' ' + this.lastname)
|
||||
.attr('title', this.firstname + ' ' + this.lastname),
|
||||
$('<td>').addClass('username').html(this.username)
|
||||
$('<td>').addClass('name').html(_s(this.firstname) + ' ' + _s(this.lastname))
|
||||
.attr('title', _s(this.firstname) + ' ' + _s(this.lastname)),
|
||||
$('<td>').addClass('username').html(_s(this.username))
|
||||
.attr('title', this.username),
|
||||
$('<td>').addClass('email').html(this.email)
|
||||
.attr('title', this.email)
|
||||
$('<td>').addClass('email').html(_s(this.email))
|
||||
.attr('title', _s(this.email))
|
||||
)
|
||||
|
||||
$table.append($result);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user