}
$USER->teacher[$newcourseid] = true;
- save_session("USER");
redirect("view.php?id=$newcourseid", get_string("changessaved"));
}
}
$USER->student["$id"] = true;
- save_session("USER");
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
- save_session("SESSION");
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$id";
}
}
$USER->student["$id"] = true;
- save_session("USER");
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
- save_session("SESSION");
} else {
$destination = "$CFG->wwwroot/course/view.php?id=$id";
}
$USER = get_user_info_from_db("id", $USER->realuser);
$USER->loggedin = true;
$USER->site = $CFG->wwwroot;
- save_session("USER");
redirect($_SERVER["HTTP_REFERER"]);
exit;
}
$USER->loggedin = true;
$USER->site = $CFG->wwwroot;
$USER->realuser = $teacher_id;
- save_session("USER");
set_moodle_cookie($USER->username);
$student_name = "$USER->firstname $USER->lastname";
if (!empty($SESSION->returnpage)) {
$return = $SESSION->returnpage;
unset($SESSION->returnpage);
- save_session("SESSION");
redirect($return);
} else {
redirect("view.php?id=$mod->course");
if (isset($SESSION->modform)) { // Variables are stored in the session
$mod = $SESSION->modform;
unset($SESSION->modform);
- save_session("SESSION");
} else {
$mod = (object)$_POST;
}
if (!empty($SESSION->returnpage)) {
$return = $SESSION->returnpage;
unset($SESSION->returnpage);
- save_session("SESSION");
redirect($return);
} else {
redirect("view.php?id=$mod->course");
if (isset($return)) {
$SESSION->returnpage = "$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id";
- save_session("SESSION");
}
$form->coursemodule = $cm->id;
}
unset($SESSION->modform); // Clear any old ones that may be hanging around.
- save_session("SESSION");
$modform = "../mod/$module->name/mod.html";
} else {
$USER->topic = $topic;
}
- save_session("USER");
}
if (isteacher($course->id) and isset($marker)) {
if ($user->id == $USER->id) {
unset($USER->student["$id"]);
- save_session("USER");
redirect("$CFG->wwwroot");
}
} else if ($edit == "off") {
$USER->editing = false;
}
- save_session("USER");
}
}
} else if ($help == "off") {
$USER->help = false;
}
- save_session("USER");
}
$SESSION->fromdiscussion = "$CFG->wwwroot/course/view.php?id=$course->id";
- save_session("SESSION");
if (! $course->category) { // This course is not a real course.
redirect("$CFG->wwwroot/");
} else {
$USER->section = $week;
}
- save_session("USER");
}
if ($course->newsitems) {