mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
New LDAP UI
Signed-off-by: Sebastien Goasguen <runseb@gmail.com>
This commit is contained in:
parent
eaa4143371
commit
ec064b3077
@ -17,3 +17,266 @@ givenName: Ryan
|
|||||||
mail: rmurphy@cloudstack.org
|
mail: rmurphy@cloudstack.org
|
||||||
uid: rmurphy
|
uid: rmurphy
|
||||||
userpassword:: cGFzc3dvcmQ=
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Barbara Brewer,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Barbara Brewer
|
||||||
|
sn: Brewer
|
||||||
|
mail: bbrewer@cloudstack.org
|
||||||
|
uid: bbrewer
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Zak Wilkinson,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Zak Wilkinson
|
||||||
|
givenname: Zak
|
||||||
|
sn: Wilkinson
|
||||||
|
uid: zwilkinson
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Archie Shingleton,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Archie Shingleton
|
||||||
|
sn: Shingleton
|
||||||
|
givenName: Archie
|
||||||
|
mail: ashingleton@cloudstack.org
|
||||||
|
uid: ashingleton
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Cletus Pears,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Cletus Pears
|
||||||
|
sn: Pears
|
||||||
|
givenName: Cletus
|
||||||
|
mail: cpears@cloudstack.org
|
||||||
|
uid: cpears
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Teisha Milewski,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Teisha Milewski
|
||||||
|
sn: Milewski
|
||||||
|
givenName: Teisha
|
||||||
|
mail: tmilewski@cloudstack.org
|
||||||
|
uid: tmilewski
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Eloy Para,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Eloy Para
|
||||||
|
sn: Para
|
||||||
|
givenName: Eloy
|
||||||
|
mail: epara@cloudstack.org
|
||||||
|
uid: epara
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Elaine Lamb,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Elaine Lamb
|
||||||
|
sn: Lamb
|
||||||
|
givenName: Elaine
|
||||||
|
mail: elamb@cloudstack.org
|
||||||
|
uid: elamb
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Soon Griffen,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Soon Griffen
|
||||||
|
sn: Griffen
|
||||||
|
givenName: Soon
|
||||||
|
mail: sgriffen@cloudstack.org
|
||||||
|
uid: sgriffen
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Tran Neisler,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Tran Neisler
|
||||||
|
sn: Neisler
|
||||||
|
givenName: Tran
|
||||||
|
mail: tneisler@cloudstack.org
|
||||||
|
uid: tneisler
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Mirella Zeck,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Mirella Zeck
|
||||||
|
sn: Zeck
|
||||||
|
givenName: Mirella
|
||||||
|
mail: mzeck@cloudstack.org
|
||||||
|
uid: mzeck
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Greg Hoskin,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Greg Hoskin
|
||||||
|
sn: Hoskin
|
||||||
|
givenName: Greg
|
||||||
|
mail: ghoskin@cloudstack.org
|
||||||
|
uid: ghoskin
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Johanne Runyon,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Johanne Runyon
|
||||||
|
sn: Runyon
|
||||||
|
givenName: Johanne
|
||||||
|
mail: jrunyon@cloudstack.org
|
||||||
|
uid: jrunyon
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Mabelle Waiters,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Mabelle Waiters
|
||||||
|
sn: Waiters
|
||||||
|
givenName: Mabelle
|
||||||
|
mail: mwaiters@cloudstack.org
|
||||||
|
uid: mwaiters
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Phillip Fruge,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Phillip Fruge
|
||||||
|
sn: Fruge
|
||||||
|
givenName: Phillip
|
||||||
|
mail: pfruge@cloudstack.org
|
||||||
|
uid: pfruge
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Jayna Ridenhour,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Jayna Ridenhour
|
||||||
|
sn: Ridenhour
|
||||||
|
givenName: Jayna
|
||||||
|
mail: jridenhour@cloudstack.org
|
||||||
|
uid: jridenhour
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Marlyn Mandujano,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Marlyn Mandujano
|
||||||
|
sn: Mandujano
|
||||||
|
givenName: Marlyn
|
||||||
|
mail: mmandujano@cloudstack.org
|
||||||
|
uid: mmandujano
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Shaunna Scherer,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Shaunna Scherer
|
||||||
|
sn: Scherer
|
||||||
|
givenName: Shaunna
|
||||||
|
mail: sscherer@cloudstack.org
|
||||||
|
uid: sscherer
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Adriana Bozek,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Adriana Bozek
|
||||||
|
sn: Bozek
|
||||||
|
givenName: Adriana
|
||||||
|
mail: abozek@cloudstack.org
|
||||||
|
uid: abozek
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Silvana Chipman,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Silvana Chipman
|
||||||
|
sn: Chipman
|
||||||
|
givenName: Silvana
|
||||||
|
mail: schipman@cloudstack.org
|
||||||
|
uid: schipman
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Marion Wasden,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Marion Wasden
|
||||||
|
sn: Wasden
|
||||||
|
givenName: Marion
|
||||||
|
mail: mwasden@cloudstack.org
|
||||||
|
uid: mwasden
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Anisa Casson,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Anisa Casson
|
||||||
|
sn: Casson
|
||||||
|
givenName: Anisa
|
||||||
|
mail: acasson@cloudstack.org
|
||||||
|
uid: acasson
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
dn: cn=Cammy Petri,dc=cloudstack,dc=org
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: organizationalPerson
|
||||||
|
objectClass: person
|
||||||
|
objectClass: top
|
||||||
|
cn: Cammy Petri
|
||||||
|
sn: Petri
|
||||||
|
givenName: Cammy
|
||||||
|
mail: cpetri@cloudstack.org
|
||||||
|
uid: cpetri
|
||||||
|
userpassword:: cGFzc3dvcmQ=
|
||||||
|
|
||||||
|
|||||||
@ -12268,84 +12268,97 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
|
|||||||
}
|
}
|
||||||
|
|
||||||
.accounts-wizard table {
|
.accounts-wizard table {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
table-layout: fixed;
|
table-layout: fixed;
|
||||||
|
}
|
||||||
|
.accounts-wizard .ui-button {
|
||||||
|
display: inline-block !important;
|
||||||
|
float: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.accounts-wizard td:last-child {
|
.accounts-wizard td:last-child {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.accounts-wizard tbody tr:nth-child(even) {
|
.accounts-wizard tbody tr:nth-child(even) {
|
||||||
background: #DFE1E3;
|
background: #DFE1E3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.accounts-wizard tbody tr:nth-child(odd) {
|
.accounts-wizard tbody tr:nth-child(odd) {
|
||||||
background: #F2F0F0;
|
background: #F2F0F0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.accounts-wizard .content {
|
.accounts-wizard .content {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.accounts-wizard .content:last-child {
|
.accounts-wizard .content:last-child {
|
||||||
margin-left: 14px;
|
margin-left: 14px;
|
||||||
}
|
}
|
||||||
|
.accounts-wizard .input-area {
|
||||||
.accounts-wizard .select-container {
|
width: 320px;
|
||||||
overflow: auto;
|
font-size: 13px;
|
||||||
|
color: #485867;
|
||||||
|
text-shadow: 0px 2px 1px #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.accounts-wizard .input-area{
|
|
||||||
width: 320px;
|
|
||||||
font-size: 15px;
|
|
||||||
color: #485867;
|
|
||||||
text-shadow: 0px 2px 1px #FFFFFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ldap-account-choice {
|
.ldap-account-choice {
|
||||||
border: none !important;
|
border: none !important;
|
||||||
border-radius: 0 0 0 0 !important;
|
border-radius: 0 0 0 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.manual-account-details .name {
|
.manual-account-details .name {
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
float: left;
|
float: left;
|
||||||
padding-bottom:10px;
|
padding-bottom:10px;
|
||||||
|
}
|
||||||
|
.manual-account-details {
|
||||||
|
height: auto !important;
|
||||||
|
overflow: visible !important;
|
||||||
|
overflow-x: visible !important;
|
||||||
|
}
|
||||||
|
.manual-account-details label.error {
|
||||||
|
display: block;
|
||||||
|
font-size: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.manual-account-details .value {
|
.manual-account-details .value {
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.manual-account-details .form-item:after {
|
.manual-account-details .form-item:after {
|
||||||
content: ".";
|
content:".";
|
||||||
display: block;
|
display: block;
|
||||||
clear: both;
|
clear: both;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
line-height: 0;
|
line-height: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.manual-account-details .form-item {
|
.manual-account-details .form-item {
|
||||||
padding: 10px;
|
padding: 5px;
|
||||||
width: 278px;
|
width: 100%;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.manual-account-details select, .manual-account-details input {
|
.manual-account-details select, .manual-account-details input {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
|
}
|
||||||
|
.manual-account-details input {
|
||||||
|
background: #F6F6F6;
|
||||||
|
-moz-border-radius: 4px;
|
||||||
|
-webkit-border-radius: 4px;
|
||||||
|
-khtml-border-radius: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border-radius: 4px 4px 4px 4px;
|
||||||
|
border: 1px solid #AFAFAF;
|
||||||
|
-moz-box-shadow: inset 0px 1px #727272;
|
||||||
|
-webkit-box-shadow: inset 0px 1px #727272;
|
||||||
|
-o-box-shadow: inset 0px 1px #727272;
|
||||||
|
box-shadow: inset 0px 1px #727272;
|
||||||
|
-moz-box-shadow: inset 0px 1px 0px #727272;
|
||||||
|
-webkit-box-shadow: inset 0px 1px 0px #727272;
|
||||||
|
-o-box-shadow: inset 0px 1px 0px #727272;
|
||||||
}
|
}
|
||||||
|
|
||||||
.manual-account-details > *:nth-child(even) {
|
.manual-account-details > *:nth-child(even) {
|
||||||
background: #DFE1E3;
|
background: #DFE1E3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.manual-account-details > *:nth-child(odd) {
|
.manual-account-details > *:nth-child(odd) {
|
||||||
background: #F2F0F0;
|
background: #F2F0F0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.manual-account-details .value {
|
.manual-account-details .value {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -473,8 +473,8 @@ under the License.
|
|||||||
<div class="multi-wizard accounts-wizard">
|
<div class="multi-wizard accounts-wizard">
|
||||||
<form>
|
<form>
|
||||||
<div class="steps">
|
<div class="steps">
|
||||||
<div class="content">
|
<div class="content ldap-account-choice">
|
||||||
<div class="select-container ldap-account-choice">
|
<div class="select-container">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -496,8 +496,8 @@ under the License.
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<div class="button cancel"><span><fmt:message key="label.cancel"/></span></div>
|
<button class="cancel ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"><span><fmt:message key="label.cancel"/></span></button>
|
||||||
<div class="button next"><span><fmt:message key="label.add"/></span></div>
|
<button class="next ok ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"><span><fmt:message key="label.add"/></span></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Zone wizard -->
|
<!-- Zone wizard -->
|
||||||
|
|||||||
@ -1287,7 +1287,7 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('updateUser'),
|
url: createURL('updateUser'),
|
||||||
data: data,
|
data: data,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: json.updateuserresponse.user
|
data: json.updateuserresponse.user
|
||||||
|
|||||||
@ -18,7 +18,57 @@
|
|||||||
(function(cloudStack, $) {
|
(function(cloudStack, $) {
|
||||||
cloudStack.accountsWizard = {
|
cloudStack.accountsWizard = {
|
||||||
|
|
||||||
manuallyInputtedAccountInformation: {
|
informationWithinLdap: {
|
||||||
|
username: {
|
||||||
|
label: 'label.username',
|
||||||
|
validation: {
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
docID: 'helpAccountUsername'
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
label: 'label.password',
|
||||||
|
validation: {
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
isPassword: true,
|
||||||
|
id: 'password',
|
||||||
|
docID: 'helpAccountPassword'
|
||||||
|
},
|
||||||
|
'password-confirm': {
|
||||||
|
label: 'label.confirm.password',
|
||||||
|
validation: {
|
||||||
|
required: true,
|
||||||
|
equalTo: '#password'
|
||||||
|
},
|
||||||
|
isPassword: true,
|
||||||
|
docID: 'helpAccountConfirmPassword'
|
||||||
|
},
|
||||||
|
email: {
|
||||||
|
label: 'label.email',
|
||||||
|
validation: {
|
||||||
|
required: true,
|
||||||
|
email: true
|
||||||
|
},
|
||||||
|
docID: 'helpAccountEmail'
|
||||||
|
},
|
||||||
|
firstname: {
|
||||||
|
label: 'label.first.name',
|
||||||
|
validation: {
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
docID: 'helpAccountFirstName'
|
||||||
|
},
|
||||||
|
lastname: {
|
||||||
|
label: 'label.last.name',
|
||||||
|
validation: {
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
docID: 'helpAccountLastName'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
informationNotInLdap: {
|
||||||
domainid: {
|
domainid: {
|
||||||
label: 'label.domain',
|
label: 'label.domain',
|
||||||
docID: 'helpAccountDomain',
|
docID: 'helpAccountDomain',
|
||||||
@ -48,7 +98,7 @@
|
|||||||
description: this.path
|
description: this.path
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.level == 0)
|
if (this.level === 0)
|
||||||
rootDomainId = this.id;
|
rootDomainId = this.id;
|
||||||
});
|
});
|
||||||
args.response.success({
|
args.response.success({
|
||||||
@ -62,8 +112,8 @@
|
|||||||
label: 'label.account',
|
label: 'label.account',
|
||||||
docID: 'helpAccountAccount',
|
docID: 'helpAccountAccount',
|
||||||
validation: {
|
validation: {
|
||||||
required: true
|
required: false
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
accounttype: {
|
accounttype: {
|
||||||
label: 'label.type',
|
label: 'label.type',
|
||||||
@ -116,43 +166,123 @@
|
|||||||
|
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var array1 = [];
|
var array1 = [];
|
||||||
|
var ldapStatus = isLdapEnabled();
|
||||||
|
console.log("creating user: " + args.username);
|
||||||
|
array1.push("&username=" + args.username);
|
||||||
|
|
||||||
|
if (!ldapStatus) {
|
||||||
|
var password = args.data.password;
|
||||||
|
if (md5Hashed) {
|
||||||
|
password = $.md5(password);
|
||||||
|
}
|
||||||
|
array1.push("&email=" + args.data.email);
|
||||||
|
array1.push("&firstname=" + args.data.firstname);
|
||||||
|
array1.push("&lastname=" + args.data.lastname);
|
||||||
|
|
||||||
|
var password = args.data.password;
|
||||||
|
if (md5Hashed) {
|
||||||
|
password = $.md5(password);
|
||||||
|
}
|
||||||
|
array1.push("&password=" + password);
|
||||||
|
}
|
||||||
|
|
||||||
array1.push("&username=" + args.data.username);
|
|
||||||
array1.push("&domainid=" + args.data.domainid);
|
array1.push("&domainid=" + args.data.domainid);
|
||||||
|
|
||||||
if (args.data.account != null && args.data.account.length != 0) {
|
var account = args.data.account;
|
||||||
array1.push("&account=" + args.data.account);
|
if (account === null || account.length === 0) {
|
||||||
|
account = args.username;
|
||||||
}
|
}
|
||||||
|
array1.push("&account=" + account);
|
||||||
|
|
||||||
if (args.data.accounttype == "1" && args.data.domainid != rootDomainId) {
|
var accountType = args.data.accounttype;
|
||||||
args.data.accounttype = "2";
|
if (args.data.accounttype == "1" && args.data.domainid != rootDomainId) { //if account type is admin, but domain is not Root domain
|
||||||
|
accountType = "2"; // Change accounttype from root-domain("1") to domain-admin("2")
|
||||||
}
|
}
|
||||||
array1.push("&accountType=" + args.data.accounttype);
|
array1.push("&accounttype=" + accountType);
|
||||||
|
|
||||||
if (args.data.timezone != null && args.data.timezone.length != 0) {
|
if (args.data.timezone !== null && args.data.timezone.length > 0) {
|
||||||
array1.push("&timezone=" + args.data.timezone);
|
array1.push("&timezone=" + args.data.timezone);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.data.networkdomain != null && args.data.networkdomain != 0) {
|
if (args.data.networkdomain !== null && args.data.networkdomain.length > 0) {
|
||||||
array1.push("&networkDomain=" + args.data.networkdomain);
|
array1.push("&networkdomain=" + args.data.networkdomain);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(array1.join(""));
|
if (ldapStatus) {
|
||||||
console.log(args.data);
|
console.log("doing an ldap add");
|
||||||
|
$.ajax({
|
||||||
$.ajax({
|
url: createURL('ldapCreateAccount' + array1.join("")),
|
||||||
url: createURL("ldapCreateAccount" + array1.join("")),
|
dataType: "json",
|
||||||
dataType: "json",
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var item = json.createaccountresponse.account;
|
var item = json.createaccountresponse.account;
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: item
|
data: item
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
error: function(XMLHttpResponse) {
|
error: function(XMLHttpResponse) {
|
||||||
args.response.error(parseXMLHttpResponse(XMLHttpResponse));
|
args.response.error(parseXMLHttpResponse(XMLHttpResponse));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
console.log("doing normal user add");
|
||||||
|
$.ajax({
|
||||||
|
url: createURL('createAccount' + array1.join("")),
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
success: function(json) {
|
||||||
|
var item = json.createaccountresponse.account;
|
||||||
|
args.response.success({
|
||||||
|
data: item
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: function(XMLHttpResponse) {
|
||||||
|
args.response.error(parseXMLHttpResponse(XMLHttpResponse));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
/*
|
||||||
|
action: function(args) {
|
||||||
|
var array1 = [];
|
||||||
|
|
||||||
|
var username = args.data.username;
|
||||||
|
|
||||||
|
array1.push("&domainid=" + args.data.domainid);
|
||||||
|
|
||||||
|
if (args.data.account != null && args.data.account.length != 0) {
|
||||||
|
array1.push("&account=" + args.data.account);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.data.accounttype == "1" && args.data.domainid != rootDomainId) {
|
||||||
|
args.data.accounttype = "2";
|
||||||
|
}
|
||||||
|
array1.push("&accountType=" + args.data.accounttype);
|
||||||
|
|
||||||
|
if (args.data.timezone != null && args.data.timezone.length != 0) {
|
||||||
|
array1.push("&timezone=" + args.data.timezone);
|
||||||
|
}
|
||||||
|
if (args.data.networkdomain != null && args.data.networkdomain != 0) {
|
||||||
|
array1.push("&networkDomain=" + args.data.networkdomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < username.length; i++) {
|
||||||
|
$.ajax({
|
||||||
|
url: createURL("ldapCreateAccount&username=" + username[i] + array1.join("")),
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
success: function(json) {
|
||||||
|
var item = json.createaccountresponse.account;
|
||||||
|
args.response.success({
|
||||||
|
data: item
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: function(XMLHttpResponse) {
|
||||||
|
args.response.error(parseXMLHttpResponse(XMLHttpResponse));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
};
|
||||||
}(cloudStack, jQuery));
|
}(cloudStack, jQuery));
|
||||||
|
|||||||
@ -699,6 +699,22 @@ var addGuestNetworkDialog = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function isLdapEnabled() {
|
||||||
|
var result;
|
||||||
|
$.ajax({
|
||||||
|
url: createURL("listLdapConfigurations"),
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
success: function(json) {
|
||||||
|
result = (json.ldapconfigurationresponse.count > 0);
|
||||||
|
},
|
||||||
|
error: function(json) {
|
||||||
|
result = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// Role Functions
|
// Role Functions
|
||||||
|
|
||||||
function isAdmin() {
|
function isAdmin() {
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
cloudStack.uiCustom.accountsWizard = function(args) {
|
cloudStack.uiCustom.accountsWizard = function(args) {
|
||||||
return function(listViewArgs) {
|
return function(listViewArgs) {
|
||||||
var context = listViewArgs.context;
|
var context = listViewArgs.context;
|
||||||
|
var ldapStatus = isLdapEnabled();
|
||||||
var accountsWizard = function(data) {
|
var accountsWizard = function(data) {
|
||||||
var $wizard = $('#template').find('div.accounts-wizard').clone();
|
var $wizard = $('#template').find('div.accounts-wizard').clone();
|
||||||
var $form = $wizard.find('form');
|
var $form = $wizard.find('form');
|
||||||
@ -33,82 +33,129 @@
|
|||||||
|
|
||||||
var completeAction = function() {
|
var completeAction = function() {
|
||||||
var data = cloudStack.serializeForm($form);
|
var data = cloudStack.serializeForm($form);
|
||||||
args.action({
|
var username = data.username;
|
||||||
context: context,
|
var bulkAdd = (username instanceof Array);
|
||||||
data: data,
|
if (bulkAdd) {
|
||||||
response: {
|
console.log("doing bulk add");
|
||||||
success: function(args) {
|
for (var i = 0; i < username.length; i++) {
|
||||||
$('.list-view').listView('refresh');
|
console.log("creating user " + username[i]);
|
||||||
close();
|
args.action({
|
||||||
},
|
context: context,
|
||||||
error: function(message) {
|
data: data,
|
||||||
close();
|
username: username[i],
|
||||||
if(message) {
|
response: {
|
||||||
cloudStack.dialog.notice({
|
error: function(message) {
|
||||||
message: message
|
if (message) {
|
||||||
});
|
cloudStack.dialog.notice({
|
||||||
|
message: message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
args.action({
|
||||||
|
context: context,
|
||||||
|
data: data,
|
||||||
|
username: username,
|
||||||
|
response: {
|
||||||
|
error: function(message) {
|
||||||
|
if (message) {
|
||||||
|
cloudStack.dialog.notice({
|
||||||
|
message: message
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
$wizard.click(function(event) {
|
$wizard.click(function(event) {
|
||||||
var $target = $(event.target);
|
var $target = $(event.target);
|
||||||
if ($target.closest('div.button.next').size()) {
|
if ($target.closest('button.next').size()) {
|
||||||
$form.validate();
|
$form.validate();
|
||||||
if ($form.valid()) {
|
if ($form.valid()) {
|
||||||
completeAction();
|
completeAction();
|
||||||
|
$(window).trigger('cloudStack.fullRefresh');
|
||||||
|
close();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($target.closest('div.button.cancel').size()) {
|
if ($target.closest('button.cancel').size()) {
|
||||||
close();
|
close();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var form = cloudStack.dialog.createForm({
|
if (ldapStatus) {
|
||||||
|
var $table = $wizard.find('.ldap-account-choice tbody');
|
||||||
|
$.ajax({
|
||||||
|
url: createURL("listAllLdapUsers"),
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
success: function(json) {
|
||||||
|
$(json.ldapuserresponse.LdapUser).each(function() {
|
||||||
|
var result = $("<tr>");
|
||||||
|
result.append("<td><input type=\"checkbox\" class=\"required\" name=\"username\" value=\"" + this.username + "\"></td>");
|
||||||
|
result.append("<td>" + this.firstname + " " + this.lastname + "</td>");
|
||||||
|
result.append("<td>" + this.username + "</td>");
|
||||||
|
result.append("<td>" + this.email + "</td>");
|
||||||
|
$table.append(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
var informationWithinLdap = cloudStack.dialog.createForm({
|
||||||
|
context: context,
|
||||||
|
noDialog: true,
|
||||||
|
form: {
|
||||||
|
title: '',
|
||||||
|
fields: args.informationWithinLdap
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//console.log(informationWithinLdap.$formContainer);
|
||||||
|
var informationWithinLdapForm = informationWithinLdap.$formContainer.find('form .form-item');
|
||||||
|
informationWithinLdapForm.find('.value #label_username').addClass('required');
|
||||||
|
informationWithinLdapForm.find('.value #password').addClass('required');
|
||||||
|
informationWithinLdapForm.find('.value #label_confirm_password').addClass('required');
|
||||||
|
informationWithinLdapForm.find('.value #label_confirm_password').attr('equalTo', '#password');
|
||||||
|
informationWithinLdapForm.find('.value #label_email').addClass('required');
|
||||||
|
informationWithinLdapForm.find('.value #label_first_name').addClass('required');
|
||||||
|
informationWithinLdapForm.find('.value #label_last_name').addClass('required');
|
||||||
|
$wizard.find('.manual-account-details').append(informationWithinLdapForm).children().css('background', 'none');
|
||||||
|
$wizard.find('.ldap-account-choice').css('display', 'none');
|
||||||
|
$wizard.removeClass('multi-wizard');
|
||||||
|
}
|
||||||
|
|
||||||
|
var informationNotInLdap = cloudStack.dialog.createForm({
|
||||||
context: context,
|
context: context,
|
||||||
noDialog: true,
|
noDialog: true,
|
||||||
form: {
|
form: {
|
||||||
title: '',
|
title: '',
|
||||||
fields: args.manuallyInputtedAccountInformation
|
fields: args.informationNotInLdap
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var $manualDetails = form.$formContainer.find('form .form-item');
|
var informationNotInLdapForm = informationNotInLdap.$formContainer.find('form .form-item');
|
||||||
$wizard.find('.manual-account-details').append($manualDetails);
|
informationNotInLdapForm.find('.value #label_domain').addClass('required');
|
||||||
|
informationNotInLdapForm.find('.value #label_type').addClass('required');
|
||||||
var $table = $wizard.find('.ldap-account-choice tbody');
|
if (!ldapStatus) {
|
||||||
|
informationNotInLdapForm.css('background', 'none');
|
||||||
$.ajax({
|
}
|
||||||
url: createURL("listAllLdapUsers"),
|
$wizard.find('.manual-account-details').append(informationNotInLdapForm);
|
||||||
dataType: "json",
|
|
||||||
async: false,
|
|
||||||
success: function(json) {
|
|
||||||
$(json.ldapuserresponse.LdapUser).each(function() {
|
|
||||||
var result = $("<tr>");
|
|
||||||
result.append("<td><input type=\"radio\" class=\"required\" name=\"username\" value=\"" + this.username + "\"></td>");
|
|
||||||
result.append("<td>" + this.firstname + " " + this.lastname + "</td>");
|
|
||||||
result.append("<td>" + this.username + "</td>");
|
|
||||||
result.append("<td>" + this.email + "</td>");
|
|
||||||
$table.append(result);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return $wizard.dialog({
|
return $wizard.dialog({
|
||||||
title: _l('label.add.account'),
|
title: _l('label.add.account'),
|
||||||
width: 800,
|
width: ldapStatus ? 800 : 330,
|
||||||
height: 500,
|
height: ldapStatus ? 500 : 500,
|
||||||
closeOnEscape: false,
|
closeOnEscape: false,
|
||||||
zIndex: 5000
|
zIndex: 5000
|
||||||
}).closest('.ui-dialog').overlay();
|
}).closest('.ui-dialog').overlay();
|
||||||
}
|
};
|
||||||
|
|
||||||
accountsWizard(args);
|
accountsWizard(args);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user