Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected logout behaviour when SLO is enabled #11

Open
mfprimo opened this issue Jul 11, 2017 · 0 comments
Open

Unexpected logout behaviour when SLO is enabled #11

mfprimo opened this issue Jul 11, 2017 · 0 comments

Comments

@mfprimo
Copy link

mfprimo commented Jul 11, 2017

After logout, plain Moodle redirects the user to either the login page or the site index
(from Moodle login/logout.php):

if ($login) {
    $redirect = get_login_url();
} else {
    $redirect = $CFG->wwwroot.'/';
}
//....
redirect($redirect);

This auth/saml plugin, instead, redirects the user to the current page (from Moodle SAML Auth plugin index.php):

            if(isset($_SERVER['SCRIPT_URI'])) {
                $urltogo = $_SERVER['SCRIPT_URI'];
                $urltogo = str_replace('auth/saml/index.php', '', $urltogo);
            }
            else if(isset($_SERVER['HTTP_REFERER'])) {
                $urltogo = $_SERVER['HTTP_REFERER'];
            }
            else{
                $urltogo = '/';
            }

            if($saml_param->dosinglelogout) {
                $as->logout($urltogo);
                assert("FALSE"); // The previous line issues a redirect
            } else {
                header('Location: '.$urltogo);
                exit();
            }

As result, Moodle present a logout behaviour different from usual user experience and in case of the current page is not accessible to anonymous user even an unexpected error.

Proposed solution: use the global $redirect variable to retain the usual Moodle behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant