]> git.mjollnir.org Git - moodle.git/commitdiff
Allow admin to do anything the teacher can do
authormartin <martin>
Sat, 16 Mar 2002 06:19:02 +0000 (06:19 +0000)
committermartin <martin>
Sat, 16 Mar 2002 06:19:02 +0000 (06:19 +0000)
course/edit.php
course/log.php
course/loglive.php
course/mod.php
course/view.php

index 3f4977f6e1dc743917688464a861f957f9ec99f9..31ff510e6a56ce498a87ec9f26f431d0ed778d5a 100644 (file)
@@ -12,7 +12,7 @@
 
            require_login($course->id);
 
-        if (!isteacher($course->id)) {
+        if (!isteacher($course->id)  && ! isadmin()) {
             error("Only teachers can edit the course!");
         }
     } else {  // Admin is creating a new course
index 2153f4d21ac3fccd9067b6ecd278311b849e2d4e..bae4f7cef67282cc493f56dc9454f1abf5875209 100644 (file)
@@ -11,7 +11,7 @@
         error("That's an invalid course id");
     }
 
-    if ( ! isteacher($course->id)) {
+    if ( ! isteacher($course->id) && ! isadmin()) {
         error("Only teachers can view logs");
     }
 
index a3e22ff728c128c6cb8def77c380eb7346f851db..3b6f687dce2f709c36dc0e4187ff056dca4ae2a3 100644 (file)
@@ -11,7 +11,7 @@
         error("That's an invalid course id");
     }
 
-    if ( ! isteacher($course->id)) {
+    if ( ! isteacher($course->id) && ! isadmin()) {
         error("Only teachers can view logs");
     }
 
index 832f6e7a20194cb5fbf1c8db97b35c075a4f2884..ded225188cd2c25bfa8851ed7ad8f134384c6c46 100644 (file)
@@ -9,7 +9,7 @@
 
         require_login($mod->course);
 
-        if (!isteacher($mod->course)) {
+        if (!isteacher($mod->course) && !isadmin()) {
             error("You can't modify this course!");
         }
 
@@ -93,7 +93,7 @@
 
         require_login($course->id);
 
-        if (!isteacher($course->id)) {
+        if (!isteacher($course->id) && !isadmin()) {
             error("You can't modify this course!");
         }
 
 
     require_login($course->id);
 
-    if (!isteacher($course->id)) {
+    if (!isteacher($course->id) && !isadmin()) {
         error("You can't modify this course!");
     }
 
index 1be1cc24192f4be34c599414cbbd148072b08314..f86e47a777c475d6557333386afb788b51839b67 100644 (file)
@@ -14,7 +14,7 @@
 
     add_to_log("View course: $course->shortname", $id);
 
-    if ( $USER->teacher[$course->id] ) {
+    if ( isteacher($course->id) || isadmin() ) {
         if ($edit == "on") {
             $USER->editing = true;
         } else if ($edit == "off") {