/// check that site is properly customized
if (empty($site->shortname) or empty($site->shortname)) {
- redirect('settings.php?section=frontpage&return=site');
+ redirect('settings.php?section=frontpage&return=site');
}
/// Check if we are returning from moodle.org registration and if so, we mark that fact to remove reminders
if (empty($errors)) {
switch ($return) {
case 'site':
- redirect("$CFG->wwwroot/", get_string('changessaved'),1);
+ redirect("$CFG->wwwroot/");
case 'admin':
- redirect("$CFG->wwwroot/admin/", get_string('changessaved'),1);
+ redirect("$CFG->wwwroot/admin/");
default:
- redirect("$CFG->wwwroot/admin/settings.php?section=" . $PAGE->section, get_string('changessaved'),1);
+ // following redirect should display confirmation message because it redirects
+ // to the same page, user might not know if save button worked
+ redirect("$CFG->wwwroot/admin/settings.php?section=" . $PAGE->section, get_string('changessaved'),2);
}
} else {
error(get_string('errorwithsettings', 'admin') . ' <br />' . $errors);
if (isset($USER->newadminuser)) {
unset($USER->newadminuser);
// redirect to admin/ to continue with installation
- redirect("$CFG->wwwroot/$CFG->admin/", get_string('changessaved'));
+ redirect("$CFG->wwwroot/$CFG->admin/");
}
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'));
+ redirect($wantsurl);
} 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");
}
} else {
- redirect("$CFG->wwwroot/$CFG->admin/user.php", get_string("changessaved"));
+ redirect("$CFG->wwwroot/$CFG->admin/user.php");
}
} else {
error("Could not update the user record ($user->id)");