MDL-23613 fixed wrong access control

This commit is contained in:
Petr Skoda
2010-08-02 12:30:36 +00:00
parent 470f4c30b7
commit 196c0451ee
+4 -2
View File
@@ -39,8 +39,6 @@ if (!isloggedin()) {
die(json_encode($err));
}
require_login();
/// Parameters
$action = optional_param('action', '', PARAM_ALPHA);
$repo_id = optional_param('repo_id', 0, PARAM_INT); // Repository ID
@@ -59,6 +57,10 @@ $saveas_path = optional_param('savepath', '/', PARAM_PATH); // save as file
$search_text = optional_param('s', '', PARAM_CLEANHTML);
$linkexternal = optional_param('linkexternal', '', PARAM_ALPHA);
list($context, $course, $cm) = get_context_info_array($contextid);
require_login($course, false, $cm);
$PAGE->set_context($context);
/// Headers to make it not cacheable
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');