Redirect teachers to course after coursecreation.

This commit is contained in:
paca70
2003-02-25 10:45:37 +00:00
parent 44996d00f9
commit d7466bdecb
+10 -5
View File
@@ -63,12 +63,17 @@
$teacher[course] = $newid;
$teacher[authority] = 1; // First teacher is the main teacher
$mainteacher = insert_record("user_teachers", $teacher);
if (!$mainteacher) {
error("Could not add main teacher to new course!");
}
$mainteacher = insert_record("user_teachers", $teacher);
if (!$mainteacher){
error("Could not add main teacher to new course!");
}
redirect("teacher.php?id=$newid", get_string("changessaved"));
if (isadmin()){ //redirect admin to add teachers
redirect("teacher.php?id=$newid", get_string("changessaved"));
} else { //redirect teachers to course
redirect("$CFG->wwwroot/course/view.php?id=$newid", get_string("changessaved"));
}
} else {
error("Serious Error! Could not create the new course!");
}