Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / userpix / upgrade.php
bloba1fd2bae06a8e102cec32d88297ef3c8a060e153
1 <?php // $Id$
2 // This script updates all users picturesi to remove black border.
5 include('../config.php');
6 include('../lib/gdlib.php');
8 require_login();
10 require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
12 if (!$users = get_records("user", "picture", "1", "lastaccess DESC", "id,firstname,lastname")) {
13 error("no users!");
16 $title = get_string("users");
18 print_header($title, $title, build_navigation(array(array('name' => $title, 'link' => null, 'type' => 'misc'))));
20 foreach ($users as $user) {
21 upgrade_profile_image($user->id);
22 $fullname = fullname($user);
23 echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&amp;course=1\"".
24 "title=\"$fullname\">";
25 require_once($CFG->libdir.'/filelib.php');
26 $userpictureurl = get_file_url($user->id.'/f1.jpg', null, 'user');
27 echo '<img src="'. $userpictureurl .'"'.
28 ' style="border:0px; width:100px; height:100px" alt="'.$fullname.'" />';
29 echo "</a> \n";
32 print_footer();