<?
###################################################
#Copyright (C) 2001 Stuart Wigley (hide@address.com)
#
#viewusers.php 18/04/2001
#
#This file is part of workbench.
#
#workbench is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#workbench is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with workbench; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#####################################################
session_start();
require_once("../config.php");
if ($HTTP_SESSION_VARS["login"] && session_is_registered("login")){
require_once("$path/connect.php");
require_once("$path/general.php");
include("$path/header.php");
?>
<table class="table3" cellspacing="0">
<tr class="rowtitle">
<td colspan="4"><h5>View Users</h5></td>
</tr>
<tr>
<td colspan="4"><p>This table shows all active user accounts.</p></td>
</tr>
<tr>
<td colspan="4"><hr></td>
</tr>
<tr class="rowtitle">
<td><h5>Name</h5></td>
<td><h5>Email</h5></td>
<td><h5>Group</h5></td>
<td><h5>Active</h5></td>
<td><h5>Last Login</h5></td>
</tr>
<?
$query = mysql_query("select * from users, groups where users.grpID = groups.grpID and users.isHidden != 'Y' order by users.sName") or die(mysql_error());
$bgcolor = "#dddddd";
while ($result = mysql_fetch_array($query))
{
if ($bgcolor == "#dddddd")
{
$bgcolor = "#eeeeee";
}
elseif ($bgcolor == "#eeeeee")
{
$bgcolor = "#dddddd";
}
echo("<tr bgcolor=\"$bgcolor\"><td>$result[sName], $result[fName]</td>");
echo("<td><a href=\"mailto:$result[email]\">$result[email]</a></td>");
echo("<td>$result[grpName]</td>");
if ( $result[isHidden] == "Y" )
{
echo("<td>No</td>");
}
else {
echo("<td>Yes</td>");
}
echo("<td>$result[lastLogin]</td></tr>");
}
?>
</table>
<?
include "../footer.php";
}
else{
include("$path/login.php");
}
?>