1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
<?php
/**
*
* Page to view latest logins to the site
*
* WARNING: this should probably be moved to /stats/ for consistency
*
* SourceForge: Breaking Down the Barriers to Open Source Development
* Copyright 1999-2001 (c) VA Linux Systems
* http://sourceforge.net
*
* @version $Id: lastlogins.php 2503 2003-12-17 17:02:25Z tperdue $
*
*/
require_once('pre.php');
session_require(array('group'=>'1','admin_flags'=>'A'));
$res_logins = db_query("SELECT us.user_id AS user_id,
us.ip_addr AS ip_addr,
us.time AS time,
users.user_name AS user_name FROM user_session us,users
WHERE us.user_id=users.user_id AND
us.user_id>0 AND us.time>0 ORDER BY us.time DESC",50);
if (!$res_logins || db_numrows($res_logins) < 1) {
exit_error('Error',$Language->getText('stats_lastlogins','no_records').db_error());
}
$HTML->header(array('title'=>$Language->getText('stats_lastlogins','last_logins')));
print '<h3>'.$Language->getText('stats_lastlogins','most_recent_open').'</h3>';
?>
<table width="100%" cellspacing="0" cellpadding="0">
<th><?php echo $Language->getText('stats_lastlogins','date'); ?></th>
<th><?php echo $Language->getText('stats_lastlogins','username'); ?></th>
<th><?php echo $Language->getText('stats_lastlogins','source_ip'); ?></th>
<?php
$alt=true;
while ($row_logins = db_fetch_array($res_logins)) {
$fontcolor="white";
if ($alt == true) {
$fontcolor="lightgrey";
}
$alt = !$alt;
print '<tr>';
print '<td bgcolor='.$fontcolor.'>'.date($sys_datefmt, $row_logins['time']).'</td>';
print '<td bgcolor='.$fontcolor.'>'.$row_logins['user_name'].'</td>';
print '<td bgcolor='.$fontcolor.'>'.$row_logins['ip_addr'].'</td>';
print '</tr>';
print '</font>';
}
?>
</table>
<?php
$HTML->footer(array());
?>
|