Skip to content

Commit

Permalink
"MDL-19118, fixed the code of requiring moodle course object"
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongsheng Cai committed Mar 17, 2010
1 parent 6ee744b commit 6aee047
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions comment/comment_post.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,16 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/*
* Handling all ajax request for comments API
* Handling new comments from non-js comments interface
*/
require_once('../config.php');
require_once($CFG->dirroot . '/comment/lib.php');

$contextid = optional_param('contextid', SYSCONTEXTID, PARAM_INT);
list($context, $course, $cm) = get_context_info_array($contextid);

$context = get_context_instance_by_id($contextid);
if ($context->contextlevel == CONTEXT_MODULE) {
$cm = get_coursemodule_from_id('', $context->instanceid);
} else {
$cm = null;
}
require_login($course, true, $cm);

$err = new stdclass;

if (!confirm_sesskey()) {
print_error('invalidsesskey');
}
Expand Down

0 comments on commit 6aee047

Please sign in to comment.