From 9a8a28e4f90dba9ecd3be46cd8768db66c8e5456 Mon Sep 17 00:00:00 2001 From: Dave Page Date: Thu, 1 Aug 2019 11:39:33 +0100 Subject: [PATCH] Allow a banner to be displayed on the login and other related pages showing custom text. Fixes #4549 --- docs/en_US/release_notes_4_12.rst | 1 + web/config.py | 7 +++++++ web/pgadmin/static/scss/_pgadmin.style.scss | 10 ++++++++++ web/pgadmin/templates/security/panel.html | 5 +++++ 4 files changed, 23 insertions(+) diff --git a/docs/en_US/release_notes_4_12.rst b/docs/en_US/release_notes_4_12.rst index d48177863..720b72bc4 100644 --- a/docs/en_US/release_notes_4_12.rst +++ b/docs/en_US/release_notes_4_12.rst @@ -11,6 +11,7 @@ New features | `Issue #4333 `_ - Add support for planner support functions in PostgreSQL 12+ functions. | `Issue #4334 `_ - Add support for generated columns in Postgres 12+. +| `Issue #4549 `_ - Allow a banner to be displayed on the login and other related pages showing custom text. Housekeeping ************ diff --git a/web/config.py b/web/config.py index c58c2d4a0..6905ac609 100644 --- a/web/config.py +++ b/web/config.py @@ -187,6 +187,13 @@ else: else: DATA_DIR = os.path.realpath(os.path.expanduser(u'~/.pgadmin/')) +# An optional login banner to show security warnings/disclaimers etc. at +# login and password recovery etc. HTML may be included for basic formatting, +# For example: +# LOGIN_BANNER = "

Authorised Users Only!

" \ +# "Unauthorised use is strictly forbidden." +LOGIN_BANNER = "" + ########################################################################## # Log settings ########################################################################## diff --git a/web/pgadmin/static/scss/_pgadmin.style.scss b/web/pgadmin/static/scss/_pgadmin.style.scss index fd2b42199..794baa862 100644 --- a/web/pgadmin/static/scss/_pgadmin.style.scss +++ b/web/pgadmin/static/scss/_pgadmin.style.scss @@ -919,6 +919,16 @@ table.table-empty-rows{ } } +.login_banner { + position: fixed; + width: 80%; + top: 50px; + left: 50%; + transform: translateX(-50%); + text-align: center; + z-index: 100; +} + .change_pass { background-color: $color-gray-light; height: 100%; diff --git a/web/pgadmin/templates/security/panel.html b/web/pgadmin/templates/security/panel.html index 7d2699654..7de1d9d90 100644 --- a/web/pgadmin/templates/security/panel.html +++ b/web/pgadmin/templates/security/panel.html @@ -2,6 +2,11 @@ {% from "security/fields.html" import render_field_with_errors %} {% block body %}