From fcb6960e32848f5c27ffeb44f24c61abeb17a933 Mon Sep 17 00:00:00 2001
From: davidc <david-ccc@infotrek.co.uk>
Date: Mon, 28 Mar 2022 22:06:02 +0000
Subject: [PATCH] LOGIN_BANNER config to display a banner above the login form

---
 uffd/default_config.cfg                   | 3 +++
 uffd/session/templates/session/login.html | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/uffd/default_config.cfg b/uffd/default_config.cfg
index 14e1cdf3..9368ce27 100644
--- a/uffd/default_config.cfg
+++ b/uffd/default_config.cfg
@@ -109,6 +109,9 @@ SERVICES_BANNER_PUBLIC=True
 # Enable the service overview page for users who are not logged in
 SERVICES_PUBLIC=True
 
+# An optional banner that will be displayed above the login form
+#LOGIN_BANNER='Always check the URL. Never enter your SSO password on any other site.'
+
 BRANDING_LOGO_URL='/static/empty.png'
 SITE_TITLE='uffd'
 
diff --git a/uffd/session/templates/session/login.html b/uffd/session/templates/session/login.html
index fc3ba82e..8b963c29 100644
--- a/uffd/session/templates/session/login.html
+++ b/uffd/session/templates/session/login.html
@@ -5,6 +5,9 @@
 	<div class="col-12">
 		<h2 class="text-center">{{_("Login")}}</h2>
 	</div>
+	{% if config['LOGIN_BANNER'] %}
+		<p>{{ config['LOGIN_BANNER'] }}</p>
+	{% endif %}
 	<div class="form-group col-12">
 		<label for="user-loginname">{{_("Login Name")}}</label>
 		<input type="text" class="form-control" id="user-loginname" name="loginname" required="required" tabindex = "1" autofocus>
-- 
GitLab