]> git.mjollnir.org Git - moodle.git/commitdiff
Replaced creator() calls with has_capability()
authorvyshane <vyshane>
Tue, 15 Aug 2006 09:45:11 +0000 (09:45 +0000)
committervyshane <vyshane>
Tue, 15 Aug 2006 09:45:11 +0000 (09:45 +0000)
course/import/activities/index.php
course/import/activities/mod.php

index c420c67158767fab81726cc90656a02bc82cb6dc..5bae0f15059b45dd3116ce45ec0f1fc06732dd6a 100644 (file)
     require_login($course->id);
     $tocontext = get_context_instance(CONTEXT_COURSE, $id);
     $fromcontext = get_context_instance(CONTEXT_COURSE, $fromcourse);
+    $syscontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
 
     if (!has_capability('moodle/course:manageactivities', $tocontext)) {
         error("You need do not have the required permissions to import activities to this course");
     }
 
     // if we're not a course creator , we can only import from our own courses.
-    if (iscreator()) {
+    if (has_capability('moodle/course:create', $syscontext)) {
         $creator = true;
     }
 
index 8cdcd09fa697b0362334b5560180297b4610dec2..8776e5a28e5ef341aa3681499840f0bbc2617618 100644 (file)
@@ -6,9 +6,11 @@
 
     require_once($CFG->dirroot.'/course/lib.php');
     require_once($CFG->dirroot.'/backup/restorelib.php');
+    
+    $syscontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
 
     // if we're not a course creator , we can only import from our own courses.
-    if (iscreator()) {
+    if (has_capability('moodle/course:create', $syscontext)) {
         $creator = true;
     }
 
 
     print_table($table);
 
-?>
+?>
\ No newline at end of file