"MDL-14129,fix print_error"
[moodle.git] / userpix / upgrade.php
index c423181..e83f2fd 100644 (file)
@@ -7,16 +7,16 @@
 
     require_login();
 
-    require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
-    
-    if (!$users = get_records("user", "picture", "1", "lastaccess DESC", "id,firstname,lastname")) {
-        error("no users!");
+    require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
+
+    if (!$users = $DB->get_records("user", array("picture"=>"1"), "lastaccess DESC", "id,firstname,lastname")) {
+        print_error('nousers');
     }
-    
+
     $title = get_string("users");
-    
-    print_header($title, $title, $title);
-    
+
+    print_header($title, $title, build_navigation(array(array('name' => $title, 'link' => null, 'type' => 'misc'))));
+
     foreach ($users as $user) {
         upgrade_profile_image($user->id);
         $fullname = fullname($user);
@@ -31,7 +31,7 @@
         }
         echo "</a> \n";
     }
-    
+
     print_footer();
 
 ?>