Removed redundant require_capability and require_login, causing havoc on new module page.

This commit is contained in:
nicolasconnault
2009-07-02 07:49:12 +00:00
parent 5fdb159e54
commit 9ee67e60b4
-2
View File
@@ -242,14 +242,12 @@
$fromform->coursemodule = $cm->id;
}
require_login($course); // needed to setup proper $COURSE
if (!empty($fromform->coursemodule)) {
$context = get_context_instance(CONTEXT_MODULE, $fromform->coursemodule);
} else {
$context = get_context_instance(CONTEXT_COURSE, $course->id);
}
require_capability('moodle/course:manageactivities', $context);
$fromform->course = $course->id;
$fromform->modulename = clean_param($fromform->modulename, PARAM_SAFEDIR); // For safety