]> git.mjollnir.org Git - moodle.git/commitdiff
Completed mods to allow teachers to make backups
authormoodler <moodler>
Fri, 1 Aug 2003 14:42:14 +0000 (14:42 +0000)
committermoodler <moodler>
Fri, 1 Aug 2003 14:42:14 +0000 (14:42 +0000)
backup/backup.php
backup/backup_check.html
backup/backup_execute.html
backup/backup_form.html

index 767c7c12ad5fd6559e2974f49279dddf9dca2f2c..70353184f688ac9975149e2c748b51f9e706038d 100644 (file)
@@ -67,9 +67,9 @@
                      "<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     
index 8c7552328679efffa3991c46023857f2e91a2fc3..08652ef9ace3cc8ed51290e75fc3ad5075c2f664 100644 (file)
@@ -4,11 +4,17 @@
     //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!");
index 7394e0304bd519a5dccab301cf70eb6f9c89255e..8b79a6e6dc83356b3987dd2a58785a91ea2c9f33 100644 (file)
@@ -4,11 +4,17 @@
     //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!");
index fe20b0033bdacdf22d8fe348b1d0cb084147aebf..90e534131fdd1c62eddf4995300b53611c5d41ad 100644 (file)
@@ -4,11 +4,17 @@
     //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!");