sesskey added to logout.php MDL-8727
This commit is contained in:
@@ -49,7 +49,7 @@ function prevent_double_paid($course)
|
||||
}
|
||||
if (isset($SESSION->ccpaid)) {
|
||||
unset($SESSION->ccpaid);
|
||||
redirect($CFG->wwwroot . '/login/logout.php');
|
||||
redirect($CFG->wwwroot . '/login/logout.php?sesskey='.sesskey());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -824,6 +824,7 @@ $string['loginstepsnone'] = '<p>Hi!</p>
|
||||
$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> ]';
|
||||
|
||||
+1
-1
@@ -2748,7 +2748,7 @@ function user_login_string($course=NULL, $user=NULL) {
|
||||
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').
|
||||
|
||||
@@ -10,6 +10,15 @@
|
||||
$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/");
|
||||
|
||||
Reference in New Issue
Block a user