adding a way to test the user image border removal code. Needs some speed
[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
10 if (!isadmin()) {
11 error("Currently only the administrator can access this page!");
12 }
13
14
15 if (!$users = get_records("user", "picture", "1", "lastaccess DESC", "id,firstname,lastname")) {
16 error("no users!");
17 }
18
19 $title = get_string("users");
20
21 print_header($title, $title, $title);
22
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.'" />';
34 }
35 echo "</a> \n";
36 }
37
38 print_footer();
39
40?>