fix access check function for documents bug $context->instance to $context->instanceid

This commit is contained in:
diml 2007-10-07 19:34:59 +00:00
parent d622930b39
commit 39cfb0b068
5 changed files with 5 additions and 5 deletions

View 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

View 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

View 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)){

View 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

View 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