MDL-20925 fixed input validation and course ajax now fully respects the disable course ajax option

This commit is contained in:
Petr Skoda
2009-11-21 16:29:06 +00:00
parent 9208e5ed5e
commit 73f67f3e9b
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -44,7 +44,12 @@ $context = get_context_instance(CONTEXT_COURSE, $course->id);
require_login($course->id);
require_capability('moodle/course:update', $context);
if (!empty($CFG->disablecourseajax)) {
errorl_log('Course AJAX not allowed');
die;
}
require_sesskey();
// OK, now let's process the parameters and do stuff
+1 -1
View File
@@ -220,7 +220,7 @@ main_class.prototype.connect = function(method, urlStub, callback, body) {
callback = {};
}
}
return YAHOO.util.Connect.asyncRequest(method, this.portal.strings['wwwroot']+"/course/rest.php?courseId="+main.portal.id+"&"+urlStub, callback, body);
return YAHOO.util.Connect.asyncRequest(method, this.portal.strings['wwwroot']+"/course/rest.php?courseId="+main.portal.id+"&sesskey="+this.portal.strings['sesskey']+"&"+urlStub, callback, body);
}