Fixed firstname lastname to call to fullname function
[moodle.git] / userpix / index.php
CommitLineData
dbaf630a 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)
7
8
9 include('../config.php');
10
11 require_login();
12
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!");
16 }
17
18
19 if (!$users = get_records("user", "picture", "1", "lastaccess DESC", "id,firstname,lastname")) {
20 error("no users!");
21 }
22
23 $title = get_string("users");
24
25 print_header($title, $title, $title);
26
27 foreach ($users as $user) {
839f2456 28 echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&amp;course=1\"".
92e754eb 29 "title=\"".fullname($user)."\">";
dbaf630a 30 echo "<img border=0 src=\"$CFG->wwwroot/user/pix.php/$user->id/f1.jpg\" ".
92e754eb 31 "width=100 height=100 alt=\"".fullname($user)."\" />";
dbaf630a 32 echo "</a> \n";
33 }
34
35 print_footer();
05f53652 36
37?>