MDL-17249 - feedbacks on the mainsite are not accessible

This commit is contained in:
agrabs 2008-11-16 20:48:08 +00:00
parent 6a1d6f2e71
commit 58627682fa
3 changed files with 11 additions and 11 deletions

View file

@ -75,6 +75,11 @@
$capabilities->complete = true; $capabilities->complete = true;
} }
//check whether the feedback is located and! started from the mainsite
if($course->id == SITEID AND !$courseid) {
$courseid = SITEID;
}
//check whether the feedback is mapped to the given courseid //check whether the feedback is mapped to the given courseid
if($course->id == SITEID AND !$capabilities->edititems) { if($course->id == SITEID AND !$capabilities->edititems) {
if($DB->get_records('feedback_sitecourse_map', array('feedbackid'=>$feedback->id))) { if($DB->get_records('feedback_sitecourse_map', array('feedbackid'=>$feedback->id))) {
@ -83,11 +88,6 @@
} }
} }
} }
//check whether the feedback is located and! started from the mainsite
if($course->id == SITEID AND !$courseid) {
$courseid = SITEID;
}
if($feedback->anonymous != FEEDBACK_ANONYMOUS_YES) { if($feedback->anonymous != FEEDBACK_ANONYMOUS_YES) {
if($course->id == SITEID) { if($course->id == SITEID) {

View file

@ -10,7 +10,7 @@
*/ */
$module->version = 2008073002; // The current module version (Date: YYYYMMDDXX) $module->version = 2008073003; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2008072401; // Requires this Moodle version $module->requires = 2008072401; // Requires this Moodle version
$feedback_version_intern = 1; //this version is used for restore older backups $feedback_version_intern = 1; //this version is used for restore older backups
$module->cron = 0; // Period for cron to check this module (secs) $module->cron = 0; // Period for cron to check this module (secs)

View file

@ -36,6 +36,11 @@
$capabilities->complete = true; $capabilities->complete = true;
} }
//check whether the feedback is located and! started from the mainsite
if($course->id == SITEID AND !$courseid) {
$courseid = SITEID;
}
//check whether the feedback is mapped to the given courseid //check whether the feedback is mapped to the given courseid
if($course->id == SITEID AND !$capabilities->edititems) { if($course->id == SITEID AND !$capabilities->edititems) {
if($DB->get_records('feedback_sitecourse_map', array('feedbackid'=>$feedback->id))) { if($DB->get_records('feedback_sitecourse_map', array('feedbackid'=>$feedback->id))) {
@ -45,11 +50,6 @@
} }
} }
//check whether the feedback is located and! started from the mainsite
if($course->id == SITEID AND !$courseid) {
$courseid = SITEID;
}
if($feedback->anonymous != FEEDBACK_ANONYMOUS_YES) { if($feedback->anonymous != FEEDBACK_ANONYMOUS_YES) {
if($course->id == SITEID) { if($course->id == SITEID) {
require_login($course->id, true); require_login($course->id, true);