discourse-ldap-auth icon indicating copy to clipboard operation
discourse-ldap-auth copied to clipboard

Customize Login Screen

Open jonaharagon opened this issue 7 years ago • 6 comments

I'm wondering if it's possible to modify the login screen popup. I looked through all the files in this repo and for the life of me couldn't figure out where to change anything. Maybe I just don't know how Discourse plugins work. I need a way to add a "Register" button to the page (linking to an external site) and to change the title from "LDAP Authentication" to something else.

Also is there any reason it couldn't open in a new tab instead? Seems less intrusive that way.

jonaharagon avatar May 09 '18 03:05 jonaharagon

You can customize the styling by editing https://github.com/jonmbake/discourse-ldap-auth/blob/master/css/form.css. You could change the title from "LDAP Authentication" to something else by passing in a title attribute here: https://github.com/jonmbake/discourse-ldap-auth/blob/master/plugin.rb#L38.

The overall structure of the login form is defined by omniauth so I don't think there is an easy way to add buttons, etc.

jonmbake avatar May 11 '18 22:05 jonmbake

@jonmbake Would you accept a PR that adds a Discourse setting for the title attribute?

ryantm avatar Jan 17 '19 00:01 ryantm

Hi Jon,

I'm not sure i understand this properly. I am trying to

  1. change the text on the login button that currently says "with LDAP"
  2. change the the header on the popup that says "LDAP Authentication"

You wrote

You could change the title from "LDAP Authentication" to something else by passing in a title attribute here: https://github.com/jonmbake/discourse-ldap-auth/blob/master/plugin.rb#L38.

So what i did was:

cd /var/discourcse ./launcher enter app vi plugins/discourse-ldap-auth/plugin.rb

and edited line 38 from: uid: SiteSetting.ldap_uid, to uid: SiteSetting.title, (i also just tried typing what i wanted it to say in plain text too)

and it didn't work. Note that the i modified lines 81 and 82 to be:

auth_provider title: 'with your NETNAME', message: 'Log in with your NETNAME credentials',

What should i be doing instead? Thanks so much!

thomasbeaudry avatar Mar 21 '19 17:03 thomasbeaudry

@thomasbeaudry Hmmm... changing the auth_provider title should work. Maybe checkout Discourse source to see where they are pulling those values from?

jonmbake avatar Mar 23 '19 12:03 jonmbake

auth_provider

Page source shows:

;title_override":"with LDAP","message_override":"Log in with your LDAP

Is there something i have to do after i change auth_provider title for my discourse to take note that it changed?

thomasbeaudry avatar Mar 27 '19 20:03 thomasbeaudry

Hi, is there any way we can include placeholders for the username and password for input fields and also change the text in the sign-in button. Thank you

psunkana avatar Aug 28 '20 10:08 psunkana