CLOUDSTACK-5527: UI > accounts page > support both "Add (non-LDAP) Account" and "Add LDAP Account" when LDAP is enabled.

This commit is contained in:
Jessica Wang 2014-01-02 16:47:23 -08:00
parent 62be5fad12
commit ca6bf9b729
3 changed files with 42 additions and 6 deletions

View File

@ -86,11 +86,44 @@
action: {
custom: cloudStack.uiCustom.accountsWizard(
cloudStack.accountsWizard
cloudStack.accountsWizard,
false
)
}
}
},
addLdapAccount: {
label: 'Add LDAP Account',
isHeader: true,
preFilter: function(args) {
if ((isAdmin() || isDomainAdmin()) && isLdapEnabled()) {
return true;
} else {
return false;
}
},
messages: {
notification: function(args) {
return 'Add LDAP Account';
}
},
notification: {
poll: function(args) {
args.complete({
actionFilter: accountActionfilter
});
}
},
action: {
custom: cloudStack.uiCustom.accountsWizard(
cloudStack.accountsWizard,
true
)
}
}
},
dataProvider: function(args) {

View File

@ -174,7 +174,7 @@
action: function(args) {
var array1 = [];
var ldapStatus = isLdapEnabled();
var ldapStatus = args.isLdap;
if (args.username) {
array1.push("&username=" + args.username);
}

View File

@ -16,10 +16,10 @@
// under the License.
(function($, cloudStack) {
cloudStack.uiCustom.accountsWizard = function(args) {
cloudStack.uiCustom.accountsWizard = function(args, isLdap) {
return function(listViewArgs) {
var context = listViewArgs.context;
var ldapStatus = isLdapEnabled();
var ldapStatus = isLdap;
var accountsWizard = function(data) {
var $wizard = $('#template').find('div.accounts-wizard').clone();
var $form = $wizard.find('form');
@ -39,6 +39,7 @@
args.action({
context: context,
data: data,
isLdap: isLdap,
groupname: groupname,
response: {
error: function(message) {
@ -58,6 +59,7 @@
args.action({
context: context,
data: data,
isLdap: isLdap,
username: username[i],
response: {
error: function(message) {
@ -74,6 +76,7 @@
args.action({
context: context,
data: data,
isLdap: isLdap,
username: username,
response: {
error: function(message) {
@ -188,7 +191,7 @@
$wizard.find('.manual-account-details').append(informationNotInLdapForm);
return $wizard.dialog({
title: _l('label.add.account'),
title: ldapStatus ? _l('Add LDAP Account') : _l('label.add.account'),
width: ldapStatus ? 800 : 330,
height: ldapStatus ? 500 : 500,
closeOnEscape: false,