mirror of
git://git.proxmox.com/git/proxmox-backup.git
synced 2025-01-24 02:04:14 +03:00
gui: user: fix #2898 add dialog to set password
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
This commit is contained in:
parent
d3d566f7bd
commit
16f0afbfb5
@ -18,6 +18,7 @@ JSSRC= \
|
|||||||
config/SyncView.js \
|
config/SyncView.js \
|
||||||
config/DataStoreConfig.js \
|
config/DataStoreConfig.js \
|
||||||
window/UserEdit.js \
|
window/UserEdit.js \
|
||||||
|
window/UserPassword.js \
|
||||||
window/RemoteEdit.js \
|
window/RemoteEdit.js \
|
||||||
window/SyncJobEdit.js \
|
window/SyncJobEdit.js \
|
||||||
window/ACLEdit.js \
|
window/ACLEdit.js \
|
||||||
|
@ -51,6 +51,18 @@ Ext.define('PBS.config.UserView', {
|
|||||||
}).show();
|
}).show();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setPassword: function() {
|
||||||
|
let me = this;
|
||||||
|
let view = me.getView();
|
||||||
|
let selection = view.getSelection();
|
||||||
|
|
||||||
|
if (selection.length < 1) return;
|
||||||
|
|
||||||
|
Ext.create('PBS.window.UserPassword', {
|
||||||
|
url: '/api2/extjs/access/users/' + selection[0].data.userid,
|
||||||
|
}).show();
|
||||||
|
},
|
||||||
|
|
||||||
renderUsername: function(userid) {
|
renderUsername: function(userid) {
|
||||||
return Ext.String.htmlEncode(userid.match(/^(.+)@([^@]+)$/)[1]);
|
return Ext.String.htmlEncode(userid.match(/^(.+)@([^@]+)$/)[1]);
|
||||||
},
|
},
|
||||||
@ -98,6 +110,12 @@ Ext.define('PBS.config.UserView', {
|
|||||||
handler: 'editUser',
|
handler: 'editUser',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
xtype: 'proxmoxButton',
|
||||||
|
text: gettext('Password'),
|
||||||
|
handler: 'setPassword',
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
xtype: 'proxmoxStdRemoveButton',
|
xtype: 'proxmoxStdRemoveButton',
|
||||||
baseurl: '/access/users/',
|
baseurl: '/access/users/',
|
||||||
|
41
www/window/UserPassword.js
Normal file
41
www/window/UserPassword.js
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
Ext.define('PBS.window.UserPassword', {
|
||||||
|
extend: 'Proxmox.window.Edit',
|
||||||
|
alias: 'widget.pbsUserPassword',
|
||||||
|
|
||||||
|
userid: undefined,
|
||||||
|
|
||||||
|
method: 'PUT',
|
||||||
|
|
||||||
|
subject: gettext('User Password'),
|
||||||
|
|
||||||
|
fieldDefaults: { labelWidth: 120 },
|
||||||
|
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
xtype: 'textfield',
|
||||||
|
inputType: 'password',
|
||||||
|
fieldLabel: gettext('Password'),
|
||||||
|
minLength: 5,
|
||||||
|
allowBlank: false,
|
||||||
|
name: 'password',
|
||||||
|
listeners: {
|
||||||
|
change: function(field) {
|
||||||
|
field.next().validate();
|
||||||
|
},
|
||||||
|
blur: function(field) {
|
||||||
|
field.next().validate();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
xtype: 'textfield',
|
||||||
|
inputType: 'password',
|
||||||
|
fieldLabel: gettext('Confirm password'),
|
||||||
|
name: 'verifypassword',
|
||||||
|
vtype: 'password',
|
||||||
|
initialPassField: 'password',
|
||||||
|
allowBlank: false,
|
||||||
|
submitValue: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user