"<a href=\"$CFG->wwwroot/$CFG->admin/index.php\">$stradministration</a> ->
<a href=\"backup.php\">$strcoursebackup</a> -> $course->fullname ($course->shortname)");
} else {
- print_header("$site->shortname: $strcoursebackup", $site->fullname,
- "<a href=\"$CFG->wwwroot/$CFG->admin/index.php\">$stradministration</a> ->
- <a href=\"backup.php\">$strcoursebackup</a> -> $course->fullname ($course->shortname)");
+ print_header("$course->shortname: $strcoursebackup", $course->fullname,
+ "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ->
+ $strcoursebackup");
}
//Print form
//Check login
require_login();
- //Check admin
- if (!isadmin()) {
- error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
+ if (!empty($course->id)) {
+ if (!isteacher($course->id)) {
+ error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
+ }
+ } else {
+ if (!isadmin()) {
+ error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
+ }
}
+
//Check site
if (!$site = get_site()) {
error("Site not found!");
//Check login
require_login();
- //Check admin
- if (!isadmin()) {
- error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
+ if (!empty($course->id)) {
+ if (!isteacher($course->id)) {
+ error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
+ }
+ } else {
+ if (!isadmin()) {
+ error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
+ }
}
+
//Check site
if (!$site = get_site()) {
error("Site not found!");
//Check login
require_login();
- //Check admin
- if (!isadmin()) {
- error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
+ if (!empty($course->id)) {
+ if (!isteacher($course->id)) {
+ error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
+ }
+ } else {
+ if (!isadmin()) {
+ error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php");
+ }
}
+
//Check site
if (!$site = get_site()) {
error("Site not found!");