Skip to content
Browse files

rss MDL-24509 added call to require_login()

  • Loading branch information...
1 parent c637291 commit 52cede73ab82c6d9cabf1d8a32dccdab69e23185 Andrew Davis committed Oct 4, 2010
Showing with 10 additions and 2 deletions.
  1. +10 −2 rss/file.php
View
12 rss/file.php
@@ -71,14 +71,22 @@
$user = get_complete_user_data('id', $userid);
session_set_user($user); //for login and capability checks
-
// Check the context actually exists
-$context = get_context_instance_by_id($contextid);
+list($context, $course, $cm) = get_context_info_array($contextid);
+
if (!$context) {
rss_error();
}
$PAGE->set_context($context);
+try {
+ $autologinguest = true;
+ $setwantsurltome = true;
+ $preventredirect = true;
+ require_login($course, $autologinguest, $cm, $setwantsurltome, $preventredirect);
+} catch (Exception $e) {
+ rss_error('rsserrorauth');
+}
// Work out which component in Moodle we want (from the frankenstyle name)
$componentdir = get_component_directory($componentname);

0 comments on commit 52cede7

Please sign in to comment.
Something went wrong with that request. Please try again.