Server side integration for LDAP Configuration
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/d8537a44 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/d8537a44 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/d8537a44 Branch: refs/heads/master Commit: d8537a4446b65c8f172e057976511f2750dffcb8 Parents: ff9d62a Author: Pranav Saxena <pranav.sax...@citrix.com> Authored: Fri Feb 15 21:12:22 2013 +0530 Committer: Pranav Saxena <pranav.sax...@citrix.com> Committed: Fri Feb 15 21:12:22 2013 +0530 ---------------------------------------------------------------------- ui/scripts/globalSettings.js | 45 ++++++++++++++++++++++++++++++++----- 1 files changed, 39 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d8537a44/ui/scripts/globalSettings.js ---------------------------------------------------------------------- diff --git a/ui/scripts/globalSettings.js b/ui/scripts/globalSettings.js index e946149..5f7fb74 100644 --- a/ui/scripts/globalSettings.js +++ b/ui/scripts/globalSettings.js @@ -106,10 +106,10 @@ var data = {}; listViewDataProvider(args, data); $.ajax({ - url: createURL(''), + url: createURL(''), //Need a list LDAP configuration API call which needs to be implemented data: data, success: function(json) { - // var items = json.listhypervisorcapabilitiesresponse.hypervisorCapabilities; + // var items = json.listldapconfigresponse; args.response.success({data:items}); }, error: function(data) { @@ -145,13 +145,11 @@ label:'SSL' , isBoolean:true, isChecked:false - // var $form = $(this).closest("form"); - }, port: { label: 'Port' , defaultValue: '389' }, - truststore:{ label:'Trust Store' , isHidden:true , dependsOn:'ssl' }, - truststorepassword:{ label:'Trust Store Password' ,isHidden:true , dependsOn:'ssl'} + truststore:{ label:'Trust Store' , isHidden:true , dependsOn:'ssl',validation:{required:true} }, + truststorepassword:{ label:'Trust Store Password' ,isHidden:true , dependsOn:'ssl', validation:{required:true}} } @@ -160,6 +158,41 @@ action:function(args) { + var array = []; + array.push("&binddn=" + todb(args.data.name)); + array.push("&bindpass=" + todb(args.data.password)); + array.push("&hostname=" + todb(args.data.hostname)); + array.push("&searchbase=" +todb(args.data.searchbase)); + array.push("&queryfilter=" +todb(args.data.queryfilter)); + array.push("&port=" +todb(args.data.port)); + + if(args.$form.find('.form-item[rel=ssl]').find('input[type=checkbox]').is(':Checked')== true) { + + array.push("&ssl=true"); + if(args.data.truststore != "") + array.push("&truststore=" +todb(args.data.truststore)); + + if(args.data.truststorepassword !="") + array.push("&truststorepass=" +todb(args.data.truststorepassword)); + + } + + else + array.push("&ssl=false"); + + $.ajax({ + url: createURL("ldapConfig" + array.join("")), + dataType: "json", + async: true, + success: function(json) { + var items = json.ldapconfigresponse; + args.response.success({ + data: items + }); + + } + + }); }