sesskey added to logout.php MDL-8727 ; backported from HEAD

This commit is contained in:
skodak
2007-03-02 17:15:53 +00:00
parent 3ce0e8274f
commit bd90f02488
4 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -638,7 +638,7 @@ class enrolment_plugin_authorize
}
if (isset($SESSION->ccpaid)) {
unset($SESSION->ccpaid);
redirect($CFG->wwwroot . '/login/logout.php');
redirect($CFG->wwwroot . '/login/logout.php?sesskey='.sesskey());
return;
}
}
+1
View File
@@ -746,6 +746,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
View File
@@ -2463,7 +2463,7 @@ function user_login_string($course=NULL, $user=NULL) {
" (<a target=\"{$CFG->framename}\" href=\"$wwwroot/login/index.php\">".get_string('login').'</a>)';
} else {
$loggedinas = $realuserinfo.get_string('loggedinas', 'moodle', $username).' '.$instudentview.
" (<a target=\"{$CFG->framename}\" href=\"$CFG->wwwroot/login/logout.php\">".get_string('logout').'</a>)';
" (<a target=\"{$CFG->framename}\" href=\"$CFG->wwwroot/login/logout.php?sesskey=".sesskey()."\">".get_string('logout').'</a>)';
}
} else {
$loggedinas = get_string('loggedinnot', 'moodle').
+10
View File
@@ -3,6 +3,16 @@
require_once("../config.php");
$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?sesskey='.sesskey(), $CFG->wwwroot.'/');
print_footer();
die;
}
require_logout();
redirect("$CFG->wwwroot/");