1 <?php # vim:ts=2:sw=2:et:
2 /* For licensing and copyright terms, see the file named LICENSE */
3 include '../../inc/common.php';
5 /* Note: individual user editing is carried out in web/user.php */
7 MTrackACL::requireAnyRights('User', 'modify');
9 mtrack_head("Administration - Users");
14 echo "<form method='get' action=\"{$ABSWEB}admin/user.php\">";
15 $find = htmlentities(trim($_GET['find']), ENT_QUOTES, 'utf-8');
17 <p>To find an user, enter their name, userid or email address in the box
18 below and click search; matches will be shown in the list below.
20 <input type="text" name="find" value="<?php echo $find ?>">
21 <button type="submit">Find User</button>
24 Select a user below to edit them, or click the "Add" button to create
31 $offset = isset($_GET['off']) ? (int)$_GET['off'] : 0;
35 "select distinct i.userid, fullname, email, active from userinfo i left join useraliases a on i.userid = a.userid where i.userid like '%$find%' or fullname like '%$find%' or email like '%$find%' or a.alias like '%$find%' order by active desc, i.userid limit $limit offset $offset";
37 $sql = "select userid, fullname, email, active from userinfo order by case active when 1 then 0 else 1 end, userid limit $limit offset $offset";
41 foreach (MTrackDB::q($sql) as $row) {
44 $name = htmlentities($row[1], ENT_QUOTES, 'utf-8');
45 $email = htmlentities($row[2], ENT_QUOTES, 'utf-8');
46 $class = $row[3] == '1' ? 'activeuser' : 'inactiveuser';
48 echo "<tr class='$class'>",
49 "<td>" . mtrack_username($uid, array('edit' => 1)) . "</td>" .
57 echo "<a href=\"{$ABSWEB}admin/user.php?off=" . ($offset - $limit) . "\">Previous</a> ";
59 echo "<a href=\"{$ABSWEB}admin/user.php?off=" . ($offset + $limit) . "\">Next</a>";
62 echo "<h2>Add User</h2>";
63 echo "<form method='get' action=\"{$ABSWEB}user.php\">";
65 <input type="hidden" name="edit" value="1">
67 To create a new user, enter the userid (typically the "short" login name) that
68 you want to use in the box below, and click "Create".
70 <input type="text" name="user" value="">
71 <button type="submit">Create User</button>