OK, well, this is pretty much it.
[moodle.git] / userpix / index.php
blobec4176091468c1c5b38f66a17321c150867ba4b1
1 <?php // $Id$
2 // This simple script displays all the users with pictures on one page.
3 // By default it is not linked anywhere on the site. If you want to
4 // make it available you should link it in yourself from somewhere.
5 // Remember also to comment or delete the lines restricting access
6 // to administrators only (see below)
9 include('../config.php');
11 require_login();
13 /// Remove the following three lines if you want everyone to access it
14 if (!isadmin()) {
15 error("Currently only the administrator can access this page!");
19 if (!$users = get_records("user", "picture", "1", "lastaccess DESC", "id,firstname,lastname")) {
20 error("no users!");
23 $title = get_string("users");
25 print_header($title, $title, $title);
27 foreach ($users as $user) {
28 echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=1\"".
29 "title=\"$user->firstname $user->lastname\">";
30 echo "<img border=0 src=\"$CFG->wwwroot/user/pix.php/$user->id/f1.jpg\" ".
31 "width=100 height=100 alt=\"$user->firstname $user->lastname\" />";
32 echo "</a> \n";
35 print_footer();