You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2014/01/03 01:47:44 UTC
git commit: updated refs/heads/4.3 to ca6bf9b
Updated Branches:
refs/heads/4.3 62be5fad1 -> ca6bf9b72
CLOUDSTACK-5527: UI > accounts page > support both "Add (non-LDAP) Account" and "Add LDAP Account" when LDAP is enabled.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ca6bf9b7
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ca6bf9b7
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ca6bf9b7
Branch: refs/heads/4.3
Commit: ca6bf9b7298beff645d32aa9567f4ab5e445a32c
Parents: 62be5fa
Author: Jessica Wang <je...@apache.org>
Authored: Thu Jan 2 16:47:23 2014 -0800
Committer: Jessica Wang <je...@apache.org>
Committed: Thu Jan 2 16:47:32 2014 -0800
----------------------------------------------------------------------
ui/scripts/accounts.js | 37 +++++++++++++++++++++++++++--
ui/scripts/accountsWizard.js | 2 +-
ui/scripts/ui-custom/accountsWizard.js | 9 ++++---
3 files changed, 42 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca6bf9b7/ui/scripts/accounts.js
----------------------------------------------------------------------
diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index 0293992..a15cc87 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -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) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca6bf9b7/ui/scripts/accountsWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/accountsWizard.js b/ui/scripts/accountsWizard.js
index e41f8c4..6b4907c 100644
--- a/ui/scripts/accountsWizard.js
+++ b/ui/scripts/accountsWizard.js
@@ -174,7 +174,7 @@
action: function(args) {
var array1 = [];
- var ldapStatus = isLdapEnabled();
+ var ldapStatus = args.isLdap;
if (args.username) {
array1.push("&username=" + args.username);
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ca6bf9b7/ui/scripts/ui-custom/accountsWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/accountsWizard.js b/ui/scripts/ui-custom/accountsWizard.js
index e52c21f..f2017f8 100644
--- a/ui/scripts/ui-custom/accountsWizard.js
+++ b/ui/scripts/ui-custom/accountsWizard.js
@@ -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,