From 8eb81bd9e75c507999e4d78be58e0cb2498fdb39 Mon Sep 17 00:00:00 2001 From: skodak Date: Tue, 15 May 2007 21:13:23 +0000 Subject: [PATCH] MDL-9824 do not use sesskey check when user already logged out in logout.php; merged from MOODLE_18_STABLE --- login/logout.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/login/logout.php b/login/logout.php index 2d8c0e5ac49df..0d9e4842c6b00 100644 --- a/login/logout.php +++ b/login/logout.php @@ -8,7 +8,12 @@ $sesskey = optional_param('sesskey', '__notpresent__', PARAM_RAW); // we want not null default to prevent required sesskey warning - if (!confirm_sesskey($sesskey)) { + if (!isloggedin()) { + // no confirmation, user has already logged out + require_logout(); + redirect($redirect); + + } else 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();