]> git.mjollnir.org Git - moodle.git/commitdiff
Redirect teachers to course after coursecreation.
authorpaca70 <paca70>
Tue, 25 Feb 2003 10:45:37 +0000 (10:45 +0000)
committerpaca70 <paca70>
Tue, 25 Feb 2003 10:45:37 +0000 (10:45 +0000)
course/edit.php

index f29b9c5d600c28b667d51c12683acc078e3b185b..fd99cab12714af82a129b8ca3fd994a03f70ed2e 100644 (file)
                     $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!");
                 }