Skip to content

Commit

Permalink
MDL-23613 fixed wrong access control
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Aug 2, 2010
1 parent 470f4c3 commit 196c045
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions repository/repository_ajax.php
Expand Up @@ -39,8 +39,6 @@
die(json_encode($err));
}

require_login();

/// Parameters
$action = optional_param('action', '', PARAM_ALPHA);
$repo_id = optional_param('repo_id', 0, PARAM_INT); // Repository ID
Expand All @@ -59,6 +57,10 @@
$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');
Expand Down

0 comments on commit 196c045

Please sign in to comment.