MDL-7861 still some icons left ;grr previous commid had wrong MDL id
[moodle.git] / userpix / upgrade.php
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, SITEID));
11     
12     if (!$users = get_records("user", "picture", "1", "lastaccess DESC", "id,firstname,lastname")) {
13         error("no users!");
14     }
15     
16     $title = get_string("users");
17     
18     print_header($title, $title, $title);
19     
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         if ($CFG->slasharguments) {        // Use this method if possible for better caching
26             echo '<img src="'. $CFG->wwwroot .'/user/pix.php/'.$user->id.'/f1.jpg"'.
27                  ' style="border:0px; width:100px; height:100px" alt="'.$fullname.'" />';
28         } else {
29             echo '<img src="'. $CFG->wwwroot .'/user/pix.php?file=/'. $user->id .'/f1.jpg"'.
30                  ' style="border:0px; width:100px; height:100px" alt="'.$fullname.'" />';
31         }
32         echo "</a> \n";
33     }
34     
35     print_footer();
37 ?>