]> andersk Git - sql-web.git/blob - admin/main.php
added phpMyAdmin to menu
[sql-web.git] / admin / main.php
1 <?php
2
3 require_once('../mitsql.cfg.php');
4 require_once('mitsql.lib.php');
5
6 if ((isAdmin() || isImpersonating()) && isset($i_impersonate)) {
7         impersonate($i_impersonate);
8         redirectStart();
9         exit;
10 }
11
12 if (!isAdmin()) redirectStart();
13
14 //                              INNER JOIN UserStat ON User.UserId = UserStat.UserId
15 $sql = sprintf("SELECT User.UserId,Username,Name,dSignup,nBytes
16                                 FROM User
17                                 NATURAL JOIN UserStat
18                                 WHERE bEnabled=1
19                                 ORDER BY dSignup");
20 $users = fetchRows(DBSelect($sql),'UserId');
21
22 include 'tpl/head.php';
23
24 echo '<table cellspacing="3">';
25 foreach($users as $id=>$user) {
26         echo '<tr><td>',
27                 $user['UserId'],
28                 '</td><td>',
29                 '<a href="do/admin/main',newQSA(array('impersonate'=>$id)),'">',
30                 $user['Username'],
31                 '</a></td><td>',
32                 $user['Name'],
33                 '</td><td>',
34                 sprintSize($user['nBytes']),
35                 '</td><td>',
36                 $user['dSignup'],
37                 '</td></tr>';
38 }
39 echo '</table>';
40
41 include 'tpl/foot.php';
42
43 ?>
This page took 0.106642 seconds and 5 git commands to generate.