1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

F #4327: block pwd change admin acct (#4571)

This commit is contained in:
Frederick Borges 2020-04-22 19:01:41 +02:00 committed by GitHub
parent 7e1bd53efd
commit 136f00b27c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 5 deletions

View File

@ -70,7 +70,11 @@ define(function(require) {
*/
function _html() {
return TemplateEasyInfo({"languageOptions": Locale.language_options});
this.cantChangePassword = parseInt(this.element.ID) <= 1;
return TemplateEasyInfo({
'languageOptions': Locale.language_options,
'cantChangePassword': this.cantChangePassword
});
}
function _setup(context) {

View File

@ -75,9 +75,18 @@
<input type="password" id="provision_new_confirm_password" class="provision-input" placeholder="{{tr "Confirm Password"}}"/>
</div>
</div>
{{#if cantChangePassword}}
<div>
Special Cloud administrator accounts (oneadmin and serveradmin)
cannot be changed in Sunstone as authorization files need to be changed
to ensure the proper functioning of the OpenNebula cloud. Please follow the
<a href="http://docs.opennebula.io/5.10/operation/users_groups_management/manage_users.html#change-credentials-for-oneadmin-or-serveradmin" target="_blank">documentation</a>
for this task.
</div>
{{/if}}
<div class="row">
<div class="large-12 columns">
<button href"#" type="submit" class="button large radius large-12 small-12">{{tr "Update Password"}}</button>
<button href"#" type="submit" class="button large radius large-12 small-12" {{#if cantChangePassword}}disabled{{/if}}>{{tr "Update Password"}}</button>
</div>
</div>
</form>

View File

@ -43,7 +43,7 @@ define(function(require) {
this.userCreation = new UserCreation(DIALOG_ID,
{name: false, auth_driver: false, group_select: false});
BaseDialog.call(this);
}
@ -70,9 +70,11 @@ define(function(require) {
}
function _html() {
this.cantChangePassword = parseInt(this.selectedElements) <= 1;
return TemplateHTML({
'dialogId': this.dialogId,
'userCreationHTML': this.userCreation.html()
'cantChangePassword': this.cantChangePassword,
'userCreationHTML': this.userCreation.html()
});
}

View File

@ -25,8 +25,17 @@
{{{userCreationHTML}}}
</div>
</div>
{{#if cantChangePassword}}
<div>
Special Cloud administrator accounts (oneadmin and serveradmin)
cannot be changed in Sunstone as authorization files need to be changed
to ensure the proper functioning of the OpenNebula cloud. Please follow the
<a href="http://docs.opennebula.io/5.10/operation/users_groups_management/manage_users.html#change-credentials-for-oneadmin-or-serveradmin" target="_blank">documentation</a>
for this task.
</div>
{{/if}}
<div class="form_buttons row">
<button type="submit" class="button radius right">
<button type="submit" class="button radius right" {{#if cantChangePassword}}disabled{{/if}}>
{{tr "Change"}}
</button>
</div>