diff --git a/blocks/login/block_login.php b/blocks/login/block_login.php index 2c4eda4aa72..6f5bab7c0a5 100644 --- a/blocks/login/block_login.php +++ b/blocks/login/block_login.php @@ -32,7 +32,7 @@ class block_login extends block_base { } function get_content () { - global $USER, $CFG, $SESSION; + global $USER, $CFG, $SESSION, $OUTPUT; $wwwroot = ''; $signup = ''; @@ -96,15 +96,32 @@ class block_login extends block_base { $this->content->text .= "\n"; if (!empty($signup)) { - $this->content->footer .= '
'.get_string('startsignup').'
'; + $this->content->text .= '
'.get_string('startsignup').'
'; } if (!empty($forgot)) { - $this->content->footer .= '
'.get_string('forgotaccount').'
'; + $this->content->text .= '
'.get_string('forgotaccount').'
'; + } + + $authsequence = get_enabled_auth_plugins(true); // Get all auths, in sequence. + $potentialidps = array(); + foreach ($authsequence as $authname) { + $authplugin = get_auth_plugin($authname); + $potentialidps = array_merge($potentialidps, $authplugin->loginpage_idp_list(empty($SESSION->wantsurl) ? '' : $SESSION->wantsurl)); + } + + if (!empty($potentialidps)) { + $this->content->text .= '
'; + $this->content->text .= '
' . get_string('potentialidps', 'auth') . '
'; + $this->content->text .= '
'; + foreach ($potentialidps as $idp) { + $this->content->text .= ''; + } + $this->content->text .= '
'; + $this->content->text .= '
'; } } return $this->content; } } - -