1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

feature #2017: Add confirm password

This commit is contained in:
Daniel Molina 2014-02-07 18:03:46 +01:00
parent 644000c2c1
commit ac783e714b
2 changed files with 36 additions and 2 deletions

View File

@ -213,6 +213,17 @@ var settings_update_password = '<div class="panel">\
<div class=""></div>\
</div>\
</div>\
<div class="row centered">\
<div class="four columns">\
<label class="inline right" for="confirm_password">'+tr("Confirm Password")+':</label>\
</div>\
<div class="seven columns">\
<input type="password" name="confirm_password" id="confirm_password" />\
</div>\
<div class="one columns">\
<div class=""></div>\
</div>\
</div>\
<hr>\
<div class="form_buttons">\
<button class="button radius right success" id="update_pw_submit" type="submit" value="User.update">'+tr("Change")+'</button>\
@ -256,12 +267,18 @@ function setupUpdatePassword() {
$('#settings_update_password_form',dialog).submit(function(){
var pw=$('#new_password',this).val();
var confirm_password=$('#confirm_password',this).val();
if (!pw.length){
notifyError(tr("Fill in a new password"));
return false;
}
if (pw !== confirm_password){
notifyError(tr("Password does not match"));
return false;
}
Sunstone.runAction("UserSettings.passwd",[-1],pw);
$('#settings_update_password',dialogs_context).trigger("reveal:close")
return false;
@ -490,7 +507,7 @@ $(document).ready(function(){
success: function(request, group_list) {
var group_dropdown_options = "";
$.each(group_list,function(){
group_dropdown_options +=
group_dropdown_options +=
'<option elem_id="'+this.GROUP.ID
+'" value="'+this.GROUP.ID+'">'
+this.GROUP.NAME+' (id:'+this.GROUP.ID+')</option>';
@ -504,4 +521,4 @@ $(document).ready(function(){
$config_dialog.reveal();
});
});
});

View File

@ -172,6 +172,17 @@ var update_pw_tmpl = '<div class="panel">\
<div class=""></div>\
</div>\
</div>\
<div class="row centered">\
<div class="four columns">\
<label class="inline right" for="confirm_password">'+tr("Confirm Password")+':</label>\
</div>\
<div class="seven columns">\
<input type="password" name="confirm_password" id="confirm_password" />\
</div>\
<div class="one columns">\
<div class=""></div>\
</div>\
</div>\
<hr>\
<div class="form_buttons">\
<button class="button radius right success" id="update_pw_submit" type="submit" value="User.update">'+tr("Change")+'</button>\
@ -870,12 +881,18 @@ function setupUpdatePasswordDialog(){
$('#update_user_pw_form',dialog).submit(function(){
var pw=$('#new_password',this).val();
var confirm_password=$('#confirm_password',this).val();
if (!pw.length){
notifyError(tr("Fill in a new password"));
return false;
}
if (pw !== confirm_password){
notifyError(tr("Password does not match"));
return false;
}
Sunstone.runAction("User.passwd",getSelectedNodes(dataTable_users),pw);
$update_pw_dialog.trigger("reveal:close")
return false;