Repository: cloudstack
Updated Branches:
  refs/heads/4.4 25b415972 -> 20c581e63


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 953167808c3e9a9c40a6f7be6e16ebf32c608a4c)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/20c581e6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/20c581e6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/20c581e6

Branch: refs/heads/4.4
Commit: 20c581e63201d8be518e793cdaed77f88bfa3b58
Parents: 25b4159
Author: Jessica Wang <jessicaw...@apache.org>
Authored: Wed Apr 23 16:27:44 2014 -0700
Committer: Daan Hoogland <d...@onecht.net>
Committed: Mon Jul 28 13:59:52 2014 +0200

----------------------------------------------------------------------
 ui/scripts/accounts.js                 |  1 +
 ui/scripts/ui-custom/accountsWizard.js | 95 +++++++++++++++++++++++++++--
 2 files changed, 90 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20c581e6/ui/scripts/accounts.js
----------------------------------------------------------------------
diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index a789084..4eaa401 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -96,6 +96,7 @@
                             label: 'Add LDAP Account',
                             isHeader: true,
                             preFilter: function(args) {
+                                //if ((isAdmin() || isDomainAdmin()) && true) 
{ //for testing only
                                 if ((isAdmin() || isDomainAdmin()) && 
isLdapEnabled()) {
                                     return true;
                                 } else {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20c581e6/ui/scripts/ui-custom/accountsWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/accountsWizard.js 
b/ui/scripts/ui-custom/accountsWizard.js
index 5ef0fa9..3259227 100644
--- a/ui/scripts/ui-custom/accountsWizard.js
+++ b/ui/scripts/ui-custom/accountsWizard.js
@@ -130,6 +130,89 @@
                         dataType: "json",
                         async: false,
                         success: function(json) {
+                               //for testing only (begin)
+                               /*
+                               json = {
+                                           "ldapuserresponse": {
+                                               "count": 11,
+                                               "LdapUser": [
+                                                   {
+                                                       "email": 
"t...@test.com",
+                                                       "principal": 
"CN=Administrator,CN=Users,DC=hyd-qa,DC=com",
+                                                       "username": 
"Administrator",
+                                                       "domain": 
"CN=Administrator"
+                                                   },
+                                                   {
+                                                       "email": 
"t...@test.com",
+                                                       "principal": 
"CN=Guest,CN=Users,DC=hyd-qa,DC=com",
+                                                       "username": "Guest",
+                                                       "domain": "CN=Guest"
+                                                   },
+                                                   {
+                                                       "email": 
"t...@test.com",
+                                                       "principal": 
"CN=IUSR_HYD-QA12,CN=Users,DC=hyd-qa,DC=com",
+                                                       "username": 
"IUSR_HYD-QA12",
+                                                       "domain": 
"CN=IUSR_HYD-QA12"
+                                                   },
+                                                   {
+                                                       "email": 
"t...@test.com",
+                                                       "principal": 
"CN=IWAM_HYD-QA12,CN=Users,DC=hyd-qa,DC=com",
+                                                       "username": 
"IWAM_HYD-QA12",
+                                                       "domain": 
"CN=IWAM_HYD-QA12"
+                                                   },
+                                                   {
+                                                       "email": 
"t...@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": 
"sa...@sadhu.com",
+                                                       "principal": 
"CN=sadhu,CN=Users,DC=hyd-qa,DC=com",
+                                                       "firstname": "sadhu",
+                                                       "username": "sadhu",
+                                                       "domain": "CN=sadhu"
+                                                   },
+                                                   {
+                                                       "email": 
"t...@test.com",
+                                                       "principal": 
"CN=sangee1 hariharan,CN=Users,DC=hyd-qa,DC=com",
+                                                       "firstname": "sangee1",
+                                                       "lastname": "hariharan",
+                                                       "username": "sangee1",
+                                                       "domain": "CN=sangee1 
hariharan"
+                                                   },
+                                                   {
+                                                       "email": 
"t...@test.com",
+                                                       "principal": 
"CN=sanjeev n.,CN=Users,DC=hyd-qa,DC=com",
+                                                       "firstname": "sanjeev",
+                                                       "username": "sanjeev",
+                                                       "domain": "CN=sanjeev 
n."
+                                                   },
+                                                   {
+                                                       "email": 
"t...@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);

Reply via email to