MDL-24938 fixed missing context ino
authorPetr Skoda <skodak@moodle.org>
Fri, 29 Oct 2010 20:08:29 +0000 (20:08 +0000)
committerPetr Skoda <skodak@moodle.org>
Fri, 29 Oct 2010 20:08:29 +0000 (20:08 +0000)
userpix/index.php

index 9c234a6..652df70 100644 (file)
@@ -13,10 +13,11 @@ $PAGE->set_url('/userpix/index.php');
 require_login();
 
 /// Remove the following three lines if you want everyone to access it
-require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
+$syscontext = get_context_instance(CONTEXT_SYSTEM);
+require_capability('moodle/site:config', $syscontext);
 
 $title = get_string("users");
-
+$PAGE->set_context($syscontext);
 $PAGE->navbar->add($title);
 $PAGE->set_title($title);
 $PAGE->set_heading($title);
@@ -27,7 +28,6 @@ foreach ($rs as $user) {
     $fullname = fullname($user);
     echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&amp;course=1\" ".
          "title=\"$fullname\">";
-    require_once($CFG->libdir.'/filelib.php');
     echo $OUTPUT->user_picture($user);
     echo "</a> \n";
 }