]> git.mjollnir.org Git - moodle.git/commitdiff
Restore option allowed to teachers too.
authorstronk7 <stronk7>
Sat, 2 Aug 2003 10:08:57 +0000 (10:08 +0000)
committerstronk7 <stronk7>
Sat, 2 Aug 2003 10:08:57 +0000 (10:08 +0000)
The course_id is passed to restore.php as a parameter

files/index.php

index bc43c73df8d7e99d1db86339b32f1066a0bb23dd..23d6c405e92fc349a478ac0b47c0a09810f952f5 100644 (file)
                 echo "<BR>";
                 $restore_path = "../backup/restore.php";
                 notice_yesno (get_string("areyousuretorestorethis"),
-                                $restore_path."?file=".$id.$wdir."/".$file,
+                                $restore_path."?id=".$id."&file=".$id.$wdir."/".$file,
                                 "index.php?id=$id&wdir=$wdir&action=cancel");
             } else {
                 displaydir($wdir);
@@ -745,7 +745,7 @@ function displaydir ($wdir) {
             } else if ($icon == "zip.gif") {
                 $edittext = "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=unzip\">$strunzip</A>&nbsp;";
                 $edittext .= "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=listzip\">$strlist</A> ";
-                if (!empty($CFG->backup_version) && isadmin()) {
+                if (!empty($CFG->backup_version) && isteacher($id)) {
                     $edittext .= "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$filesafe&action=restore\">$strrestore</A> ";
                 }
             } else {