Block causes SAML error on logout

Block causes SAML error on logout

eftir Kimber Warden -
Number of replies: 0

Our Moodle uses SAML to automatically log students into Google when they log in to Moodle. There are no problems on login or logout.

I have created a block that uses OAuth2 to retrieve the contents of the students Gmail inbox and display them in Moodle. This works too, with the exception of when the student logs out of Moodle. When the student logs out of Moodle, he gets this error: "Notice: Undefined property: stdClass::$dologout in /var/www/moodle/auth/saml/auth.php on line 167"

The relevant code in the auth/saml.php file is:

function logoutpage_hook() {

        global $SESSION;

        unset($SESSION->SAMLSessionControlled);

        if($this->config->dologout) {  <-----------THIS IS LINE 167.

            set_moodle_cookie('nobody');

            require_logout();

            require_once('config.php');

            if (!empty($SIMPLESAMLPHP_LOGOUT_HOOK)) {

                redirect($SIMPLESAMLPHP_LOGOUT_HOOK);

            }

            else {

                redirect($GLOBALS['CFG']->wwwroot.'/auth/saml/index.php?logout=1');

            }

        }


The error only occurs on logout if the Gmail block is installed. What do I need to do to fix it?

Average of ratings: -