Skip to content

Commit

Permalink
MDL-20925 fixed input validation and course ajax now fully respects t…
Browse files Browse the repository at this point in the history
…he disable course ajax option
  • Loading branch information
skodak committed Nov 21, 2009
1 parent 9208e5e commit 73f67f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions course/rest.php
Expand Up @@ -44,7 +44,12 @@
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

Expand Down
2 changes: 1 addition & 1 deletion lib/ajax/ajaxcourse.js
Expand Up @@ -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);
}


Expand Down

0 comments on commit 73f67f3

Please sign in to comment.