mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-06 17:10:35 +00:00
use window.PasswordEdit from widget toolkit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
8cbc11a70c
commit
83c52beb4d
@ -1,56 +1,3 @@
|
||||
Ext.define('PVE.window.PasswordEdit', {
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
||||
if (!me.userid) {
|
||||
throw "no userid specified";
|
||||
}
|
||||
|
||||
var verifypw;
|
||||
var pwfield;
|
||||
|
||||
var validate_pw = function() {
|
||||
if (verifypw.getValue() !== pwfield.getValue()) {
|
||||
return gettext("Passwords does not match");
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
verifypw = Ext.createWidget('textfield', {
|
||||
inputType: 'password',
|
||||
fieldLabel: gettext('Confirm password'),
|
||||
name: 'verifypassword',
|
||||
submitValue: false,
|
||||
validator: validate_pw
|
||||
});
|
||||
|
||||
pwfield = Ext.createWidget('textfield', {
|
||||
inputType: 'password',
|
||||
fieldLabel: gettext('Password'),
|
||||
minLength: 5,
|
||||
name: 'password',
|
||||
validator: validate_pw
|
||||
});
|
||||
|
||||
Ext.apply(me, {
|
||||
subject: gettext('Password'),
|
||||
url: '/api2/extjs/access/password',
|
||||
items: [
|
||||
pwfield, verifypw,
|
||||
{
|
||||
xtype: 'hiddenfield',
|
||||
name: 'userid',
|
||||
value: me.userid
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
me.callParent();
|
||||
}
|
||||
});
|
||||
|
||||
Ext.define('PVE.dc.UserView', {
|
||||
extend: 'Ext.grid.GridPanel',
|
||||
|
||||
@ -123,7 +70,7 @@ Ext.define('PVE.dc.UserView', {
|
||||
disabled: true,
|
||||
selModel: sm,
|
||||
handler: function(btn, event, rec) {
|
||||
var win = Ext.create('PVE.window.PasswordEdit',{
|
||||
var win = Ext.create('Proxmox.window.PasswordEdit', {
|
||||
userid: rec.data.userid
|
||||
});
|
||||
win.on('destroy', reload);
|
||||
|
Loading…
Reference in New Issue
Block a user