]> git.mjollnir.org Git - moodle.git/commitdiff
fix access check function for documents bug $context->instance to $context->instanceid
authordiml <diml>
Sun, 7 Oct 2007 19:34:59 +0000 (19:34 +0000)
committerdiml <diml>
Sun, 7 Oct 2007 19:34:59 +0000 (19:34 +0000)
search/documents/data_document.php
search/documents/glossary_document.php
search/documents/resource_document.php
search/documents/techproject_document.php
search/documents/wiki_document.php

index c8995279c919592abbe87500c7be099bc790377c..b513d616b1a6ae4efdfa664a0e80707918ad5bfe 100644 (file)
@@ -330,7 +330,7 @@ function data_check_text_access($path, $itemtype, $this_id, $user, $group_id, $c
     $data = get_record('data', 'id', $record->dataid);
     $course = get_record('course', 'id', $data->course);
     $module_context = get_record('context', 'id', $context_id);
-    $cm = get_record('course_modules', 'id', $module_context->instance);
+    $cm = get_record('course_modules', 'id', $module_context->instanceid);
     if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', $module_context)) return false;
     
     //group consistency check : checks the following situations about groups
index da9e5e78fad2c853354c72777a25fa71a09c9fa5..cc632c80af4a9304fcf84ce064a81491c3d370b5 100644 (file)
@@ -223,7 +223,7 @@ function glossary_check_text_access($path, $itemtype, $this_id, $user, $group_id
     $glossary = get_record('glossary', 'id', $entry->glossaryid);
     $course = get_record('course', 'id', $glossary->course);
     $module_context = get_record('context', 'id', $context_id);
-    $cm = get_record('course_modules', 'id', $module_context->instance);
+    $cm = get_record('course_modules', 'id', $module_context->instanceid);
     if (!$cm->visible && !has_capability('moodle/course:viewhiddenactivities', $module_context)) return false;
     
     //approval check : entries should be approved for being viewed, or belongs to the user unless the viewer can approve them or manage them 
index 98722bf62ca3661459ddef4c28b95c341e024b80..53dc4ac10ea508bea3ffca5510ec8cb9ac912537 100644 (file)
@@ -295,7 +295,7 @@ function resource_check_text_access($path, $itemtype, $this_id, $user, $group_id
     
     $r = get_record('resource', 'id', $this_id);
     $module_context = get_record('context', 'id', $context_id);
-    $cm = get_record('course_modules', 'id', $module_context->instance);
+    $cm = get_record('course_modules', 'id', $module_context->instanceid);
 
     //check if found course module is visible
     if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', $module_context)){
index b1f2bc5231f08c18e44880b869dc427e38c383ef..ad12228d671f6c91fcf250b677be55e7b1d4eb93 100644 (file)
@@ -252,7 +252,7 @@ function techproject_check_text_access($path, $entry_type, $this_id, $user, $gro
     $techproject = get_record('techproject', 'id', $this_id);
     $course = get_record('course', 'id', $techproject->course);
     $module_context = get_record('context', 'id', $context_id);
-    $cm = get_record('course_modules', 'id', $module_context->instance);
+    $cm = get_record('course_modules', 'id', $module_context->instanceid);
     if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', $module_context)) return false;
     
     //group consistency check : checks the following situations about groups
index 145111c03f12e48446180aa7a0b0fb498ae76cfc..3e743f69083400bff5dc265a3586a14c93fa2a5c 100644 (file)
@@ -233,7 +233,7 @@ function wiki_check_text_access($path, $itemtype, $this_id, $user, $group_id, $c
     $entry = get_record('wiki_entries', 'id', $page->wiki);
     $course = get_record('course', 'id', $entry->course);
     $module_context = get_record('context', 'id', $context_id);
-    $cm = get_record('course_modules', 'id', $module_context->instance);
+    $cm = get_record('course_modules', 'id', $module_context->instanceid);
     if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', $module_context)) return false;
     
     //group consistency check : checks the following situations about groups