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 31DBF6063F for ; Tue, 17 Nov 2020 14:27:10 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 23E1C113F7 for ; Tue, 17 Nov 2020 14:27:10 +0100 (CET) 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 F1585113E4 for ; Tue, 17 Nov 2020 14:27:08 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id ACBA3437AC for ; Tue, 17 Nov 2020 14:27:08 +0100 (CET) Date: Tue, 17 Nov 2020 14:27:07 +0100 From: Stoiko Ivanov To: Dominik Csapak Cc: pmg-devel@lists.proxmox.com Message-ID: <20201117142707.221400ed@rosa.proxmox.com> In-Reply-To: <20201117080513.15046-5-d.csapak@proxmox.com> References: <20201117080513.15046-1-d.csapak@proxmox.com> <20201117080513.15046-5-d.csapak@proxmox.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.086 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [html.tt] Subject: Re: [pmg-devel] [PATCH pmg-gui 1/1] add 'Request Quarantine Link' Button to LoginView X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Nov 2020 13:27:10 -0000 On Tue, 17 Nov 2020 09:05:13 +0100 Dominik Csapak wrote: > if the template has 'quarantinelink' enabled, we > show a button 'Request Quarantine Link' on the quarantine login ui > > there a user can enter their e-mail and request a link to the quarantine > > Signed-off-by: Dominik Csapak > --- > js/LoginView.js | 33 +++++++++++++++++++++++++++++++++ > pmg-index.html.tt | 3 ++- > 2 files changed, 35 insertions(+), 1 deletion(-) > > diff --git a/js/LoginView.js b/js/LoginView.js > index 8e610aa..5546517 100644 > --- a/js/LoginView.js > +++ b/js/LoginView.js > @@ -10,6 +10,10 @@ Ext.define('PMG.LoginView', { > > let realmfield = me.lookup('realmfield'); > > + let enableQuarantineLink = view.targetview === 'quarantineview' && !!Proxmox.QuarantineLink; as talked off-list - for me it was confusing to have the button only available on the quarantine view. - No hard feelings on the topic though... > + > + me.lookup('quarantineButton').setVisible(enableQuarantineLink); > + > if (view.targetview !== 'quarantineview') { > return; > } > @@ -65,6 +69,28 @@ Ext.define('PMG.LoginView', { > } > }, > > + openQuarantineLinkWindow: function() { > + let me = this; > + me.lookup('loginwindow').setVisible(false); > + Ext.create('Proxmox.window.Edit', { > + title: gettext('Request Quarantine Link'), > + url: '/quarantine/sendlink', > + method: 'POST', > + items: [ > + { > + xtype: 'proxmoxtextfield', > + name: 'mail', > + fieldLabel: gettext('Your E-Mail'), > + }, > + ], > + listeners: { > + destroy: function() { > + me.lookup('loginwindow').show(true); > + }, > + }, > + }).show(); > + }, > + > control: { > 'field[name=lang]': { > change: function(f, value) { > @@ -76,6 +102,9 @@ Ext.define('PMG.LoginView', { > window.location.reload(); > }, > }, > + 'button[reference=quarantineButton]': { > + click: 'openQuarantineLinkWindow', > + }, > 'button[reference=loginButton]': { > click: 'submitForm', > }, > @@ -172,6 +201,10 @@ Ext.define('PMG.LoginView', { > }, > ], > buttons: [ > + { > + text: gettext('Request Quarantine Link'), > + reference: 'quarantineButton', > + }, > { > text: gettext('Login'), > reference: 'loginButton', > diff --git a/pmg-index.html.tt b/pmg-index.html.tt > index 4faf0cf..4a29ba2 100644 > --- a/pmg-index.html.tt > +++ b/pmg-index.html.tt > @@ -30,7 +30,8 @@ > Setup: { auth_cookie_name: 'PMGAuthCookie' }, > NodeName: '[% nodename %]', > UserName: '[% username %]', > - CSRFPreventionToken: '[% token %]' > + CSRFPreventionToken: '[% token %]', > + QuarantineLink: [% IF quarantinelink %] true [% ELSE %] false [% END %], > }; > >