]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12081, teacher with import capability can not import course
authortoyomoyo <toyomoyo>
Mon, 26 Nov 2007 02:39:28 +0000 (02:39 +0000)
committertoyomoyo <toyomoyo>
Mon, 26 Nov 2007 02:39:28 +0000 (02:39 +0000)
backup/restore.php
backup/restore_execute.html
backup/restore_precheck.html

index 47f20c94efa421cf2afe0bd55910350d6676c334..0224a304cc74f99161570bf51245f811ba5eed23 100644 (file)
@@ -55,7 +55,8 @@
             if (empty($to)) {
                 error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
             } else {
-                if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $to))) {
+                if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $to))
+                    && !has_capability('moodle/site:import',  get_context_instance(CONTEXT_COURSE, $to))) {
                     error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
                 }
             }
index 64be901a545c9206f1139effc6473e49afe0c9e1..3406d7777cbf64f76f3cd3a62ff6bb5c217a69df 100644 (file)
@@ -26,7 +26,8 @@
             if (empty($to)) {
                 error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
             } else {
-                if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $to))) {
+                if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $to)) 
+                    && !has_capability('moodle/site:import',  get_context_instance(CONTEXT_COURSE, $to))) {
                     error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
                 }
             }
index 777e24c2105f057bc16861a179e41f16fbdc272f..2f213a4ec92ea2604c8ad58d617edc3e342dfc41 100644 (file)
@@ -18,7 +18,8 @@
             if (empty($to)) {
                 error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
             } else {
-                if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $to))) {
+                if (!has_capability('moodle/site:restore', get_context_instance(CONTEXT_COURSE, $to))
+                    && !has_capability('moodle/site:import',  get_context_instance(CONTEXT_COURSE, $to))) {
                     error("You need to be a teacher or admin user to use this page.", "$CFG->wwwroot/login/index.php");
                 }
             }