MDL-21695 adding help strings
[moodle.git] / userpix / upgrade.php
blob8017dcccb2fe074cd2235b3c89bf86fdde7c0a47
1 <?php
2 // This script updates all users picturesi to remove black border.
5 include('../config.php');
6 include('../lib/gdlib.php');
8 $PAGE->set_url('/userpix/upgrade.php');
10 require_login();
12 require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
14 if (!$users = $DB->get_records("user", array("picture"=>"1"), "lastaccess DESC", "id,firstname,lastname")) {
15 print_error('nousers');
18 $title = get_string("users");
20 $PAGE->navbar->add($title);
21 $PAGE->set_title($title);
22 $PAGE->set_heading($title);
23 echo $OUTPUT->header();
25 foreach ($users as $user) {
26 upgrade_profile_image($user->id);
27 $fullname = fullname($user);
28 echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&amp;course=1\"".
29 "title=\"$fullname\">";
30 require_once($CFG->libdir.'/filelib.php');
31 $userpictureurl = get_file_url($user->id.'/f1.jpg', null, 'user');
32 echo '<img src="'. $userpictureurl .'"'.
33 ' style="border:0px; width:100px; height:100px" alt="'.$fullname.'" />';
34 echo "</a> \n";
37 echo $OUTPUT->footer();