core MDL-19799 Updated print_header and build_navigation to OUTPUT and PAGE equivalents
[moodle.git] / userpix / upgrade.php
CommitLineData
0f363686 1<?php // $Id$
2 // This script updates all users picturesi to remove black border.
3
4
5 include('../config.php');
6 include('../lib/gdlib.php');
7
8 require_login();
9
ef35441d 10 require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
0be6f678 11
5d910388 12 if (!$users = $DB->get_records("user", array("picture"=>"1"), "lastaccess DESC", "id,firstname,lastname")) {
28800f02 13 print_error('nousers');
0f363686 14 }
0be6f678 15
0f363686 16 $title = get_string("users");
0be6f678 17
70f25518 18 $PAGE->navbar->add($title);
19 $PAGE->set_title($title);
20 $PAGE->set_heading($title);
21 echo $OUTPUT->header();
0be6f678 22
0f363686 23 foreach ($users as $user) {
24 upgrade_profile_image($user->id);
25 $fullname = fullname($user);
26 echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&amp;course=1\"".
27 "title=\"$fullname\">";
5a254a29 28 require_once($CFG->libdir.'/filelib.php');
29 $userpictureurl = get_file_url($user->id.'/f1.jpg', null, 'user');
30 echo '<img src="'. $userpictureurl .'"'.
31 ' style="border:0px; width:100px; height:100px" alt="'.$fullname.'" />';
0f363686 32 echo "</a> \n";
33 }
0be6f678 34
7e0d6675 35 echo $OUTPUT->footer();
0f363686 36
37?>