From: paca70 Date: Tue, 25 Feb 2003 10:45:37 +0000 (+0000) Subject: Redirect teachers to course after coursecreation. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d7466bdecb1dcbc3f4b6d5da6ae606611f7cc89b;p=moodle.git Redirect teachers to course after coursecreation. --- diff --git a/course/edit.php b/course/edit.php index f29b9c5d60..fd99cab127 100644 --- a/course/edit.php +++ b/course/edit.php @@ -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!"); }