]>
Commit | Line | Data |
---|---|---|
ec62162d DM |
1 | Ext.define('Proxmox.window.PasswordEdit', { |
2 | extend: 'Proxmox.window.Edit', | |
c9441d5f DM |
3 | alias: 'proxmoxWindowPasswordEdit', |
4 | ||
4c21393e | 5 | subject: gettext('Password'), |
c9441d5f | 6 | |
4c21393e | 7 | url: '/api2/extjs/access/password', |
c9441d5f | 8 | |
4c21393e DM |
9 | fieldDefaults: { |
10 | labelWidth: 120 | |
11 | }, | |
c9441d5f | 12 | |
4c21393e DM |
13 | items: [ |
14 | { | |
15 | xtype: 'textfield', | |
16 | inputType: 'password', | |
17 | fieldLabel: gettext('Password'), | |
18 | minLength: 5, | |
a1891d76 | 19 | allowBlank: false, |
4c21393e DM |
20 | name: 'password', |
21 | listeners: { | |
22 | change: function(field){ | |
23 | field.next().validate(); | |
24 | }, | |
25 | blur: function(field){ | |
26 | field.next().validate(); | |
27 | } | |
c9441d5f | 28 | } |
4c21393e DM |
29 | }, |
30 | { | |
31 | xtype: 'textfield', | |
c9441d5f | 32 | inputType: 'password', |
4c21393e | 33 | fieldLabel: gettext('Confirm password'), |
c9441d5f | 34 | name: 'verifypassword', |
a1891d76 | 35 | allowBlank: false, |
4c21393e DM |
36 | vtype: 'password', |
37 | initialPassField: 'password', | |
38 | submitValue: false | |
39 | }, | |
40 | { | |
41 | xtype: 'hiddenfield', | |
42 | name: 'userid' | |
43 | } | |
44 | ], | |
c9441d5f | 45 | |
4c21393e DM |
46 | initComponent : function() { |
47 | var me = this; | |
c9441d5f | 48 | |
4c21393e DM |
49 | if (!me.userid) { |
50 | throw "no userid specified"; | |
51 | } | |
c9441d5f DM |
52 | |
53 | me.callParent(); | |
4c21393e | 54 | me.down('[name=userid]').setValue(me.userid); |
c9441d5f DM |
55 | } |
56 | }); |