mirror of
https://github.com/moodle/moodle.git
synced 2025-04-09 02:12:22 +02:00
MDL-63994 login: Clarify inline comments on loginpage_hook() usage
While working on the issue, I found these inline comments outdated and confusing. The auth plugin types can implement a loginpage_hook() method, the purpose of which is to inject the $user and/or $frm into this login/index.php script. The new comments should make it more clear. Note the second comment mentioned a prelogin_hook() which was an old name of what is now called loginpage_hook(). It had nothing to do with the existing pre_loginpage_hook() and was only confusing.
This commit is contained in:
parent
208950cff0
commit
667f564b4d
@ -69,13 +69,13 @@ if (!empty($SESSION->has_timed_out)) {
|
||||
$session_has_timed_out = false;
|
||||
}
|
||||
|
||||
/// auth plugins may override these - SSO anyone?
|
||||
$frm = false;
|
||||
$user = false;
|
||||
|
||||
$authsequence = get_enabled_auth_plugins(true); // auths, in sequence
|
||||
foreach($authsequence as $authname) {
|
||||
$authplugin = get_auth_plugin($authname);
|
||||
// The auth plugin's loginpage_hook() can eventually set $frm and/or $user.
|
||||
$authplugin->loginpage_hook();
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ if ($frm and isset($frm->username)) { // Login WITH
|
||||
}
|
||||
|
||||
if ($user) {
|
||||
//user already supplied by aut plugin prelogin hook
|
||||
// The auth plugin has already provided the user via the loginpage_hook() called above.
|
||||
} else if (($frm->username == 'guest') and empty($CFG->guestloginbutton)) {
|
||||
$user = false; /// Can't log in as guest if guest button is disabled
|
||||
$frm = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user