Fix for bug 3350 where older SESSION->wantsurl was hanging around

This commit is contained in:
moodler
2005-05-29 07:58:37 +00:00
parent cb9b40a576
commit 3d8a508910
2 changed files with 11 additions and 7 deletions
+11 -2
View File
@@ -222,9 +222,18 @@
}
if (isset($USER->newadminuser)) {
unset($USER->newadminuser);
redirect("$CFG->wwwroot/", get_string("changessaved"));
redirect("$CFG->wwwroot/", get_string('changessaved'));
}
if (!empty($SESSION->wantsurl)) { // User may have been forced to edit account, so let's
// send them to where they wanted to go originally
$wantsurl = $SESSION->wantsurl;
$SESSION->wantsurl = ''; // In case unset doesn't work as expected
unset($SESSION->wantsurl);
redirect($wantsurl, get_string('changessaved'));
} else {
redirect("$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id",
get_string("changessaved"));
}
redirect("$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id", get_string("changessaved"));
} else {
redirect("$CFG->wwwroot/$CFG->admin/user.php", get_string("changessaved"));
}
-5
View File
@@ -9,11 +9,6 @@
$enable = optional_param('enable', ''); // enable email
$disable = optional_param('disable', ''); // disable email
if (!empty($SESSION->wantsurl)) {
$wantsurl = $SESSION->wantsurl;
unset($SESSION->wantsurl);
redirect($wantsurl);
}
if (empty($id)) { // See your own profile by default
require_login();