OKAY! THIS IS IT! MOODLE 1.6!
[moodle.git] / userpix / upgrade.php
blob95e6b124b02d573354119254bc076fcfc878c636
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 if (!isadmin()) {
11 error("Currently only the administrator can access this page!");
15 if (!$users = get_records("user", "picture", "1", "lastaccess DESC", "id,firstname,lastname")) {
16 error("no users!");
19 $title = get_string("users");
21 print_header($title, $title, $title);
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\">";
28 if ($CFG->slasharguments) { // Use this method if possible for better caching
29 echo '<img src="'. $CFG->wwwroot .'/user/pix.php/'.$user->id.'/f1.jpg"'.
30 ' border="0" width="100" height="100" alt="'.$fullname.'" />';
31 } else {
32 echo '<img src="'. $CFG->wwwroot .'/user/pix.php?file=/'. $user->id .'/f1.jpg"'.
33 ' border="0" width="100" height="100" alt="'.$fullname.'" />';
35 echo "</a> \n";
38 print_footer();