LMSouq
moodle-core Open

Redirecting users from Moodle to another site when login fails

JO
Joe Maloney
1 month ago
3 views
Problem Description
I've written a custom plugin that allows for url login. Users entering my Moodle site this way, all come from the same external site and can be identified based on the url. When their login fails, I would like to redirect them back to a "login failed" page on the external website, instead of the normal login failed routine on my own moodle site. Is there a function in Moodle to redirect users from within an authentication plugin? Part of the problem is that by the time the plugin is being processed, the header has already been processed. Setting variables in the header is therefore not effective. Any help is appreciated.

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base