2009-10-15 03:43:28 +00:00
|
|
|
<?php
|
2005-07-22 14:12:32 +00:00
|
|
|
// This script updates all users picturesi to remove black border.
|
|
|
|
|
|
|
|
|
|
|
|
include('../config.php');
|
|
|
|
include('../lib/gdlib.php');
|
|
|
|
|
2010-01-16 15:39:56 +00:00
|
|
|
$PAGE->set_url('/userpix/upgrade.php');
|
2009-10-15 03:43:28 +00:00
|
|
|
|
2005-07-22 14:12:32 +00:00
|
|
|
require_login();
|
|
|
|
|
2008-04-22 06:24:14 +00:00
|
|
|
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2008-05-30 22:11:31 +00:00
|
|
|
if (!$users = $DB->get_records("user", array("picture"=>"1"), "lastaccess DESC", "id,firstname,lastname")) {
|
2008-06-15 09:19:10 +00:00
|
|
|
print_error('nousers');
|
2005-07-22 14:12:32 +00:00
|
|
|
}
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2005-07-22 14:12:32 +00:00
|
|
|
$title = get_string("users");
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2009-09-07 07:20:14 +00:00
|
|
|
$PAGE->navbar->add($title);
|
|
|
|
$PAGE->set_title($title);
|
|
|
|
$PAGE->set_heading($title);
|
|
|
|
echo $OUTPUT->header();
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2005-07-22 14:12:32 +00:00
|
|
|
foreach ($users as $user) {
|
|
|
|
upgrade_profile_image($user->id);
|
|
|
|
$fullname = fullname($user);
|
|
|
|
echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=1\"".
|
|
|
|
"title=\"$fullname\">";
|
2008-07-10 09:55:11 +00:00
|
|
|
require_once($CFG->libdir.'/filelib.php');
|
|
|
|
$userpictureurl = get_file_url($user->id.'/f1.jpg', null, 'user');
|
|
|
|
echo '<img src="'. $userpictureurl .'"'.
|
|
|
|
' style="border:0px; width:100px; height:100px" alt="'.$fullname.'" />';
|
2005-07-22 14:12:32 +00:00
|
|
|
echo "</a> \n";
|
|
|
|
}
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2009-08-06 14:21:34 +00:00
|
|
|
echo $OUTPUT->footer();
|