}
if (isset($SESSION->ccpaid)) {
unset($SESSION->ccpaid);
- redirect($CFG->wwwroot . '/login/logout.php');
+ redirect($CFG->wwwroot . '/login/logout.php?sesskey='.sesskey());
return;
}
}
$string['loginto'] = 'Login to $a';
$string['loginusing'] = 'Login here using your username and password';
$string['logout'] = 'Logout';
+$string['logoutconfirm'] = 'Do you really want to logout?';
$string['logs'] = 'Logs';
$string['logtoomanycourses'] = '[ <a href=\"$a->url\">more</a> ]';
$string['logtoomanyusers'] = '[ <a href=\"$a->url\">more</a> ]';
href=\"$CFG->wwwroot/course/view.php?id=$course->id&switchrole=0&sesskey=".sesskey()."\">".get_string('switchrolereturn').'</a>)';
} else {
$loggedinas = $realuserinfo.get_string('loggedinas', 'moodle', $username).' '.
- " (<a $CFG->frametarget href=\"$CFG->wwwroot/login/logout.php\">".get_string('logout').'</a>)';
+ " (<a $CFG->frametarget href=\"$CFG->wwwroot/login/logout.php?sesskey=".sesskey()."\">".get_string('logout').'</a>)';
}
} else {
$loggedinas = get_string('loggedinnot', 'moodle').
$wwwroot = $CFG->wwwroot;
}
+ $sesskey = optional_param('sesskey', '__notpresent__', PARAM_RAW); // we want not null default to prevent required sesskey warning
+
+ if (!confirm_sesskey($sesskey)) {
+ print_header($SITE->fullname, $SITE->fullname, 'home');
+ notice_yesno(get_string('logoutconfirm'), 'logout.php', $CFG->wwwroot.'/', array('sesskey'=>sesskey()), null, 'post', 'get');
+ print_footer();
+ die;
+ }
+
require_logout();
redirect("$wwwroot/");