From 9ccfa64940eab1007c1e09bc7f8f0f2f06119825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Thu, 15 Nov 2018 20:27:58 +0100 Subject: [PATCH] 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. --- login/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/login/index.php b/login/index.php index 143c7b40a06..995fa98bed4 100644 --- a/login/index.php +++ b/login/index.php @@ -67,13 +67,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(); } @@ -132,7 +132,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;