Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-20925 fixed input validation and course ajax now fully respects t…

…he disable course ajax option
  • Loading branch information...
commit 73f67f3e9bb85b80d472ab925e6adaaad271a524 1 parent 9208e5e
@skodak skodak authored
Showing with 6 additions and 1 deletion.
  1. +5 −0 course/rest.php
  2. +1 −1  lib/ajax/ajaxcourse.js
View
5 course/rest.php
@@ -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
View
2  lib/ajax/ajaxcourse.js
@@ -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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.