]> git.mjollnir.org Git - moodle.git/commitdiff
Slight regression in policy (to bring it back to exactly how it all is in 1.0.9).
authormoodler <moodler>
Sun, 17 Aug 2003 13:06:10 +0000 (13:06 +0000)
committermoodler <moodler>
Sun, 17 Aug 2003 13:06:10 +0000 (13:06 +0000)
Only course creators can assign teacher to courses UNLESS the config variable
teacherassignteachers is true (by default it will be off).

course/lib.php
course/teacher.php

index 274251074c23dd9a096eb4710fa224392e76b6ba..362f840934e914843b9023d0c107dfc5fbd478ea 100644 (file)
@@ -747,13 +747,19 @@ function print_course_admin_links($course, $width=180) {
             }
             $admindata[]="<a href=\"edit.php?id=$course->id\">".get_string("settings")."...</a>";
             $adminicon[]="<img src=\"$pixpath/i/settings.gif\" height=16 width=16 alt=\"\">";
-            if (!$course->teachers) {
-                $course->teachers = get_string("defaultcourseteachers");
+
+            if (iscreator() or !empty($CFG->teacherassignteachers)) {
+                if (!$course->teachers) {
+                    $course->teachers = get_string("defaultcourseteachers");
+                }
+                $admindata[]="<a href=\"teacher.php?id=$course->id\">$course->teachers...</a>";
+                $adminicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
             }
-            $admindata[]="<a href=\"teacher.php?id=$course->id\">$course->teachers...</a>";
-            $adminicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
         }
 
+        if (!$course->teachers) {
+            $course->teachers = get_string("defaultcourseteachers");
+        }
         $admindata[]="<a href=\"student.php?id=$course->id\">$course->students...</a>";
         $adminicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\">";
 
@@ -779,7 +785,6 @@ function print_course_admin_links($course, $width=180) {
         $admindata[]="<a href=\"$CFG->wwwroot/files/index.php?id=$course->id\">".get_string("files")."...</a>";
         $adminicon[]="<img src=\"$pixpath/i/files.gif\" height=16 width=16 alt=\"\">";
 
-    
         $admindata[]="<a href=\"$CFG->wwwroot/doc/view.php?id=$course->id&file=teacher.html\">".get_string("help")."...</a>";
         $adminicon[]="<img src=\"$modpixpath/resource/icon.gif\" height=16 width=16 alt=\"\">";
 
index 4da64353e21111b6ad449530001d844d27dddd87..cfbb7656d7e3db605dff8e08b34880afd6ca3539 100644 (file)
@@ -3,7 +3,7 @@
 
        require_once("../config.php");
 
-    define("MAX_USERS_PER_PAGE", 30);
+    define("MAX_USERS_PER_PAGE", 40);
 
     require_variable($id);         // course id
     optional_variable($add, "");
@@ -16,7 +16,8 @@
         error("Course ID was incorrect (can't find it)");
     }
 
-    if (!isteacheredit($course->id)) {
+    if (!(isteacheredit($course->id) and iscreator()) and 
+        !(isteacheredit($course->id) and !empty($CFG->teacheraddteachers) ) ) {
         error("You must be an administrator or course creator to use this page.");
     }