]> git.mjollnir.org Git - moodle.git/commitdiff
Teacher editors can edit courses, and course creators get
authormoodler <moodler>
Sat, 16 Aug 2003 05:40:27 +0000 (05:40 +0000)
committermoodler <moodler>
Sat, 16 Aug 2003 05:40:27 +0000 (05:40 +0000)
added as teacher-editors when they create a course

course/edit.php

index fc1f7423f6210eda259febd20c1fc3d76ef86dc8..e751f3d8f6db084b9e25b81335a17518c9343d7b 100644 (file)
             error("Course ID was incorrect");
         }
 
-        if (!isteacher($course->id)) {
-            error("Only teachers can edit the course!");
+        if (!isteacheredit($course->id)) {
+            error("You do not currently have editing privileges!");
         }
     } else {  // Admin is creating a new course
 
         if (!iscreator()) {
-            error("Only administrators and teachers can use this page");
+            error("You do not currently have course creation privileges!");
         }
 
         $course = NULL;
                         $newteacher->userid = $USER->id;
                         $newteacher->course = $newcourseid;
                         $newteacher->authority = 1;   // First teacher is the main teacher
+                        $newteacher->editall = 1;     // Course creator can edit their own course
 
                         if (!$newteacher->id = insert_record("user_teachers", $newteacher)) {
                             error("Could not add you to this new course!");
                         }
 
                         $USER->teacher[$newcourseid] = true;
+                        $USER->teacheredit[$newcourseid] = true;
 
                         redirect("view.php?id=$newcourseid", get_string("changessaved"));
                     }