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

Start authentication flow if user guest Start authentication flow if user guest #39

Open
wants to merge 2 commits into
base: MOODLE_37_STABLE
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion classes/loginflow/authcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ public function handleredirect() {
// Response from OP.
$this->handleauthresponse($requestparams);
} else {
if (isloggedin() && empty($justauth) && empty($promptaconsent)) {
if (isloggedin() && !isguestuser() && empty($justauth) && empty($promptaconsent)) {
global $USER;
if($USER->id )
if (isset($SESSION->wantsurl) and (strpos($SESSION->wantsurl, $CFG->wwwroot) === 0)) {
$urltogo = $SESSION->wantsurl;
unset($SESSION->wantsurl);
Expand All @@ -116,6 +118,10 @@ public function handleredirect() {
redirect($urltogo);
die();
}
//Handle Guest account session termination
if(isguestuser()){
require_logout();
}
// Initial login request.
$stateparams = ['forceflow' => 'authcode'];
$extraparams = [];
Expand Down