From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 447E1672FF for ; Thu, 30 Jul 2020 10:22:54 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 328B414070 for ; Thu, 30 Jul 2020 10:22:24 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 836AD14063 for ; Thu, 30 Jul 2020 10:22:23 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 3C7C6433F9 for ; Thu, 30 Jul 2020 10:22:23 +0200 (CEST) To: pbs-devel@lists.proxmox.com References: <20200729083338.28581-1-a.lauterer@proxmox.com> From: Dominik Csapak Message-ID: <44ae1142-687b-1221-113d-58e4fd745cdd@proxmox.com> Date: Thu, 30 Jul 2020 10:22:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:79.0) Gecko/20100101 Thunderbird/79.0 MIME-Version: 1.0 In-Reply-To: <20200729083338.28581-1-a.lauterer@proxmox.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 1.053 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.812 Looks like a legit reply (A) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH proxmox-backup] gui: user: fix #2898 add dialog to set password X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 08:22:54 -0000 works as intended, one nit inline other than that: Reviewed-By: Dominik Csapak Tested-By: Dominik Csapak On 7/29/20 10:33 AM, Aaron Lauterer wrote: > Signed-off-by: Aaron Lauterer > --- > www/Makefile | 1 + > www/config/UserView.js | 18 ++++++++++++++ > www/window/UserPassword.js | 49 ++++++++++++++++++++++++++++++++++++++ > 3 files changed, 68 insertions(+) > create mode 100644 www/window/UserPassword.js > > diff --git a/www/Makefile b/www/Makefile > index d8c91a18..edce8cb3 100644 > --- a/www/Makefile > +++ b/www/Makefile > @@ -18,6 +18,7 @@ JSSRC= \ > config/SyncView.js \ > config/DataStoreConfig.js \ > window/UserEdit.js \ > + window/UserPassword.js \ > window/RemoteEdit.js \ > window/SyncJobEdit.js \ > window/ACLEdit.js \ > diff --git a/www/config/UserView.js b/www/config/UserView.js > index 7a869d44..91e7a83a 100644 > --- a/www/config/UserView.js > +++ b/www/config/UserView.js > @@ -51,6 +51,18 @@ Ext.define('PBS.config.UserView', { > }).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) { > return Ext.String.htmlEncode(userid.match(/^(.+)@([^@]+)$/)[1]); > }, > @@ -98,6 +110,12 @@ Ext.define('PBS.config.UserView', { > handler: 'editUser', > disabled: true, > }, > + { > + xtype: 'proxmoxButton', > + text: gettext('Password'), > + handler: 'setPassword', > + disabled: true, > + }, > { > xtype: 'proxmoxStdRemoveButton', > baseurl: '/access/users/', > diff --git a/www/window/UserPassword.js b/www/window/UserPassword.js > new file mode 100644 > index 00000000..ed1c2e32 > --- /dev/null > +++ b/www/window/UserPassword.js > @@ -0,0 +1,49 @@ > +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, > + }, > + ], > + > + getValues: function(dirtyOnly) { > + var me = this; > + > + var values = me.callParent(arguments); > + > + return values; > + }, if we only call callParent, is it necessary to have it at all? > +}); >