Set $CFG->alternateloginurl dynamically

Set $CFG->alternateloginurl dynamically

by Michael Ko -
Number of replies: 1

We have login forms on 3 different websites (different students will log in from a different website). Currently we have $CFG->alternateloginurl set in config.php to only one of the websites.

We want to be able to redirect anyone who needs to log in to a dynamically chosen website. 

I can work out which login URL each user needs to use, but is there some way to dynamically change the alternate login URL without hacking the core code?

Thanks

Average of ratings: -
In reply to Michael Ko

Re: Set $CFG->alternateloginurl dynamically

by Dan Poltawski -

It's probably cleanest to implement this as an authentication plugin - (it's hard to understand how you are doing this without an auth plugin already, how do they actually login if you send them elsewhere?)