2 // Logs the user out and sends them to the home page
4 require_once("../config.php");
6 // can be overriden by auth plugins
7 $redirect = $CFG->wwwroot
.'/';
9 $sesskey = optional_param('sesskey', '__notpresent__', PARAM_RAW
); // we want not null default to prevent required sesskey warning
12 // no confirmation, user has already logged out
16 } else if (!confirm_sesskey($sesskey)) {
17 print_header($SITE->fullname
, $SITE->fullname
, 'home');
18 notice_yesno(get_string('logoutconfirm'), 'logout.php', $CFG->wwwroot
.'/', array('sesskey'=>sesskey()), null, 'post', 'get');
23 $authsequence = get_enabled_auth_plugins(); // auths, in sequence
24 foreach($authsequence as $authname) {
25 $authplugin = get_auth_plugin($authname);
26 $authplugin->logoutpage_hook();