This plugin was forked from the original discourse-ldap-auth plugin in order to customize the login page. Note that the html for the login page is part of the omniauth gem, so we can't customize it easily. So for now we are providing login page customizations via css styles only.
That means that we have to add custom html as an svg background image :(
The forked repo can be found here: https://github.com/clansing/discourse-ldap-auth
Edit the css/form.css file to change the content of the login page. Specifically, any
additional html text is provided in the form::before and form::after styles as svg background images.
For example
form::before {
content: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='650px' height='230px'%3E%3CforeignObject width='100%25' height='100%25'%3E%3Cdiv xmlns='http://www.w3.org/1999/xhtml' style='font-family: Helvetica; font-size: 12px; width: 100%25;'%3E%3Cdiv style='padding: 10px; border: 1px solid rgb(220, 220, 220); border-radius: 5px; background-color:rgb(245, 245, 245)'%3E This is a Department of Energy (DOE) computer system. DOE computer systems are provided for the processing of official U.S. Government information only. All data contained within DOE computer systems is owned by the DOE, and may be audited, intercepted, recorded, read, copied, or captured in any manner and disclosed in any manner, by authorized personnel. THERE IS NO RIGHT OF PRIVACY IN THIS SYSTEM. System personnel may disclose any potential evidence of crime found on DOE computer systems to appropriate authorities. %3Cp%3EUSE OF THIS SYSTEM BY ANY USER, AUTHORIZED OR UNAUTHORIZED, CONSTITUTES CONSENT TO THIS AUDITING, INTERCEPTION, RECORDING, READING, COPYING, CAPTURING, and DISCLOSURE OF COMPUTER ACTIVITY.%3C/p%3E%3C/div%3E%3Cdiv style='margin-top: 30px;'%3E%3Cdiv style='font-weight: bold; font-size: 14px;'%3E Please log in with your ARM LDAP account* credentials: %3C/div%3E%3Cdiv style='font-style: italic; margin-top: 5px;'%3E (Note that the first time logging into the forum, users will also need to be admitted by a site moderator.) %3C/div%3E%3C/div%3E%3C/div%3E%3C/foreignObject%3E%3C/svg%3E");
}- Open the
css/svg-content.htmlpage - Edit the
<svg>element in either the<!--- FORM BEFORE -->or<!--- FORM AFTER -->section. - Open the SVG URL encoder at https://yoksel.github.io/url-encoder/
- Paste the entire
<svg>element into the "Insert SVG:" box - Copy the text from the "Take Encoded:" box
- Open the
css/form.cssfile - Edit the
form::beforeorform::aftercontent attribute, depending upon which one you are modifying. - Paste the content from the "Take Encoded:" box into the content url at this location:
content: url("data:image/svg+xml;charset=utf8,PASTE_SVG_HERE");
See this discussion for more info on using svg images to render html (there are some limitations):
- ssh to discourse.adc.arm.gov using the cert you got from Pete
- Follow these instructions: https://meta.discourse.org/t/install-plugins-in-discourse/19157
- ssh to discourse.adc.arm.gov using the cert you got from Pete
- Run these commands
sudo bash cd /var/discourse ./launcher rebuild app