From: martin Date: Sat, 16 Mar 2002 06:19:02 +0000 (+0000) Subject: Allow admin to do anything the teacher can do X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a69023cf464d136d601ad45bf22d74b6f323e6e6;p=moodle.git Allow admin to do anything the teacher can do --- diff --git a/course/edit.php b/course/edit.php index 3f4977f6e1..31ff510e6a 100644 --- a/course/edit.php +++ b/course/edit.php @@ -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 diff --git a/course/log.php b/course/log.php index 2153f4d21a..bae4f7cef6 100644 --- a/course/log.php +++ b/course/log.php @@ -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"); } diff --git a/course/loglive.php b/course/loglive.php index a3e22ff728..3b6f687dce 100644 --- a/course/loglive.php +++ b/course/loglive.php @@ -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"); } diff --git a/course/mod.php b/course/mod.php index 832f6e7a20..ded225188c 100644 --- a/course/mod.php +++ b/course/mod.php @@ -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!"); } @@ -177,7 +177,7 @@ require_login($course->id); - if (!isteacher($course->id)) { + if (!isteacher($course->id) && !isadmin()) { error("You can't modify this course!"); } diff --git a/course/view.php b/course/view.php index 1be1cc2419..f86e47a777 100644 --- a/course/view.php +++ b/course/view.php @@ -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") {