Describe the bug
When dual login is set and we go to the login screen. The button sends us to sitename.com/login/index.php?saml=on but it doesnt "call" the login. we just go in loop.
To Reproduce
Steps to reproduce the behavior:
Install newest version in moodle 3.6.3
Set to dual login
Log out
Try and login via click the button
Desktop (please complete the following information):
Any browser
To make it work we changed the code in the loginpage_hook in auth.php line 198 - 228 :
From: /**
@global string $SESSION
@return type
*/
public function loginpage_hook() {
global $SESSION, $CFG;
$saml = optional_param('saml', 'undefined', PARAM_TEXT);
// If saml=off, go to default login page regardless any other
// settings. Useful to administrators to recover from misconfiguration
if ($saml == 'off') {
$SESSION->saml = 'off';
return;
}
// If dual login is disabled or saml=on, the user is redirect to the IdP
if ($saml == 'on') {
$SESSION->saml='on';
$this->saml2_login();
}
// Otherwise, is checked the last option in session
if (!empty($SESSION->saml) && $SESSION->saml == 'off') {
return;
}
if ($this->config->dual_login) {
return;
}
$this->saml2_login();
}
To this :
/**
@global string $SESSION
@return type
*/
public function loginpage_hook() {
global $SESSION;
if(!isset($SESSION->saml)){
$SESSION->saml = '';
}
$saml = optional_param('saml', $SESSION->saml, PARAM_TEXT);
/**
* Check if dual login is enabled.
* Can bypass IdP auth.
* To bypass IdP auth, go to <moodle-url>/login/index.php?saml=off
*
*/
if ((int) $this->config->dual_login && $saml !== 'on') {
$saml = 'off';
}
$SESSION->saml = !empty($saml) ? $saml : 'on';
if (isset($SESSION->saml) && $SESSION->saml === 'off') {
return;
}
$this->saml2_login();
Describe the bug When dual login is set and we go to the login screen. The button sends us to sitename.com/login/index.php?saml=on but it doesnt "call" the login. we just go in loop.
To Reproduce Steps to reproduce the behavior: Install newest version in moodle 3.6.3 Set to dual login Log out Try and login via click the button
Desktop (please complete the following information): Any browser
To make it work we changed the code in the loginpage_hook in auth.php line 198 - 228 : From: /**
To this :
/**
@return type */ public function loginpage_hook() {
}