diff --git a/lib/accesslib.php b/lib/accesslib.php index e36c126..9b749d0 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -2779,6 +2779,11 @@ function role_unassign_all(array $params, $subcontexts = false, $includemanual = function isloggedin() { global $USER; +// Validate user logged in status for SSO + if (isset($USER->auth)) { + $userauth = get_auth_plugin($USER->auth); + $userauth->auth_validate_loggedin_hook(); + return (!empty($USER->id)); } diff --git a/lib/authlib.php b/lib/authlib.php index 334bd44..3a56287 100644 --- a/lib/authlib.php +++ b/lib/authlib.php @@ -380,6 +380,17 @@ class auth_plugin_base { return true; } +// ou-specific begins #54 + /** + * Hook for validating logged in user for this authentication plugin. + * This method is called from accesslib isloggedin() function for current $USER auth plugin. + * Allows user logged out from SSO sytem to be logged out from Moodle for example. + */ + function auth_validate_loggedin_hook() { + //override if needed + } +// ou-specific ends + /** * Hook for overriding behaviour of login page. * This method is called from login/index.php page for all enabled auth plugins.