Commit 32e74e1b authored by Francois Marier's avatar Francois Marier
Browse files

Move the SAML "SSO Login" link to PluginAuthSaml



The query is no longer needed since that login_form_elements()
function will only get called if there is a usable and enabled
SAML auth instance somewhere.

Bug #905081

Change-Id: Ia68d968baad17a22957e2e43e98a430eae201347
Signed-off-by: default avatarFrancois Marier <francois@catalyst.net.nz>
parent c40b75f6
......@@ -1023,9 +1023,6 @@ function auth_get_login_form() {
'register' => array(
'value' => '<div id="login-helplinks">' . '<a href="' . get_config('wwwroot') . 'forgotpass.php" tabindex="2">' . get_string('lostusernamepassword') . '</a></div>'
),
'loginsaml' => array(
'value' => ((count_records('auth_instance', 'authname', 'saml') == 0) ? '' : '<div id="login-helplinks"><a href="' . get_config('wwwroot') . 'auth/saml/" tabindex="2">' . get_string('login', 'auth.saml') . '</a></div>')
),
'login_submitted' => array(
'type' => 'hidden',
'value' => 1
......@@ -1648,9 +1645,6 @@ function auth_generate_login_form() {
'value' => '<div id="login-helplinks">' . $registerlink
. '<a href="' . get_config('wwwroot') . 'forgotpass.php" tabindex="2">' . get_string('lostusernamepassword') . '</a></div>'
),
'loginsaml' => array(
'value' => ((count_records('auth_instance', 'authname', 'saml') == 0) ? '' : '<a href="' . get_config('wwwroot') . 'auth/saml/" tabindex="2">' . get_string('login', 'auth.saml') . '</a>')
),
);
// Get any extra elements from the enabled auth plugins
......
......@@ -584,4 +584,16 @@ class PluginAuthSaml extends PluginAuth {
}
return $values;
}
/**
* Add "SSO Login" link below the normal login form.
*/
public static function login_form_elements() {
$elements = array(
'loginsaml' => array(
'value' => '<div class="login-externallink"><a href="' . get_config('wwwroot') . 'auth/saml/">' . get_string('login', 'auth.saml') . '</a></div>'
)
);
return $elements;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment