mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-08-04 15:30:08 +00:00
window/PasswordEdit.js: copied from pve-manager
This commit is contained in:
parent
066babdc65
commit
c9441d5f32
1
Makefile
1
Makefile
@ -31,6 +31,7 @@ JSSRC= \
|
||||
panel/InputPanel.js \
|
||||
panel/LogView.js \
|
||||
window/Edit.js \
|
||||
window/PasswordEdit.js \
|
||||
window/TaskViewer.js \
|
||||
node/NetworkEdit.js \
|
||||
node/NetworkView.js \
|
||||
|
53
window/PasswordEdit.js
Normal file
53
window/PasswordEdit.js
Normal file
@ -0,0 +1,53 @@
|
||||
xt.define('Proxmox.window.PasswordEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
alias: 'proxmoxWindowPasswordEdit',
|
||||
|
||||
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();
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user