From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 4C7781FF13B for ; Mon, 08 Jun 2026 08:58:08 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0484613CA2; Mon, 8 Jun 2026 08:58:08 +0200 (CEST) From: Stoiko Ivanov To: pmg-devel@lists.proxmox.com Subject: [PATCH pmg-gui 4/5] login: show optional consent-banner before login Date: Mon, 8 Jun 2026 08:56:22 +0200 Message-ID: <20260608065653.624545-5-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260608065653.624545-1-s.ivanov@proxmox.com> References: <20260608065653.624545-1-s.ivanov@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1780901809648 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.086 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment 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] Message-ID-Hash: ASHU3S6KPYRJ3OVFM2RNVQFCQ5UNFIE3 X-Message-ID-Hash: ASHU3S6KPYRJ3OVFM2RNVQFCQ5UNFIE3 X-MailFrom: s.ivanov@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: adapted from pve-manager commit: 2e42468a ("show optional consent-banner before login") Signed-off-by: Stoiko Ivanov --- js/LoginView.js | 11 +++++++++++ js/SystemOptions.js | 7 +++++++ pmg-index.html.tt | 1 + 3 files changed, 19 insertions(+) diff --git a/js/LoginView.js b/js/LoginView.js index e897683..4651423 100644 --- a/js/LoginView.js +++ b/js/LoginView.js @@ -31,6 +31,17 @@ Ext.define('PMG.LoginView', { me.lookup('quarantineButton').setVisible(!!Proxmox.QuarantineLink); if (view.targetview !== 'quarantineview') { + if (Proxmox.ConsentText) { + let oidc_auth_redirect = Proxmox.Utils.getOpenIDRedirectionAuthorization(); + if (oidc_auth_redirect === undefined) { + Ext.create('Proxmox.window.ConsentModal', { + autoShow: true, + consent: Proxmox.Markdown.parse( + Proxmox.Utils.base64ToUtf8(Proxmox.ConsentText), + ), + }); + } + } return; } diff --git a/js/SystemOptions.js b/js/SystemOptions.js index 517eb71..5bf7127 100644 --- a/js/SystemOptions.js +++ b/js/SystemOptions.js @@ -93,6 +93,13 @@ Ext.define('PMG.SystemOptions', { me.add_proxy_row('http_proxy', gettext('HTTP proxy')); + me.add_textareafield_row('consent-text', gettext('Consent Text'), { + deleteEmpty: true, + fieldOpts: { + maxLength: 64 * 1024, + }, + }); + me.callParent(); me.on('activate', me.rstore.startUpdate); diff --git a/pmg-index.html.tt b/pmg-index.html.tt index 10f9a2d..3e3c4b6 100644 --- a/pmg-index.html.tt +++ b/pmg-index.html.tt @@ -45,6 +45,7 @@ UserName: '[% username %]', CSRFPreventionToken: '[% token %]', QuarantineLink: [% IF quarantinelink %] true [% ELSE %] false [% END %], + ConsentText: '[% consenttext %]', }; -- 2.47.3