Location: PHPKode > projects > Web Application Gateway > wagateway/admin/users.php
<?

/*************************************************************************************

    COPYRIGHT NOTICE

    This copyright notice must appear at the top of all scripts which are part of
    the Web Application Gateway package.

    Copyright (C) 2001-2008 Gregory Engel
    
    All rights reserved
    
    8547 E Arapahoe Rd, #J-504
    Greenwood Village, CO  80112 USA
    hide@address.com

    This program 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.

    This program 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.

    The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
    A copy is included with the WAG package and is found in the text file gpl.txt

    You should have received a copy of the GNU General Public License (gpl.txt, gpl.html)
    along with the WAG distribution package; if not, the GNU General Public License can
    be found at http://www.gnu.org/copyleft/gpl.html, or by writing to:
    
    Free Software Foundation, Inc.
    59 Temple Place - Suite 330
    Boston, MA  02111-1307, USA.

    This script is part of the Web Application Gateway (WAG) Project. The WAG software
    is free, subject to 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.
    
    $Revision: 41 $
    $LastChangedDate: 2008-01-14 14:07:02 -0700 (Mon, 14 Jan 2008) $
    $LastChangedBy: gpeangel $
 
*************************************************************************************/

require("../common/access.php");
require("../common/dbconnect.php");

?>
<html>
<head>
<title><? echo $_SERVER["PHP_SELF"]; ?></title>
<script type="text/javascript" src="../js/wagsession.js"></script>
<link rel="stylesheet" type="text/css" href="../common/gateway.css" />
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
</head>

<body bgcolor="#ffffff">

<table bgcolor="#f5f5f5" border="0" cellpadding="4" cellspacing="0" style="margin-bottom: 15px;" width="100%">
    <tr>
        <td><b><a href="index.php" onmouseout="javascript:window.status=''; return true;" onmouseover="javascript:window.status=''; return true;" onmousemove="javascript:window.status='Administration';" target="_self">Administration</a></b></td>
        <td align="right"><a href="javascript:openHelpWindow('Help', '../help/users_help.php', '0');" onmouseout="javascript:window.status=''; return true;" onmouseover="javascript:window.status=''; return true;" onmousemove="javascript:window.status='Help';">Help</a></td>
    </tr>
</table>

<table bgcolor="#dcdcdc" border="0" cellpadding="4" cellspacing="0" style="border: solid black 1px;margin-bottom: 5px;" width="100%">
    <tr>
        <td align="center" width="1px"><img src="../common/images/users.png" /></td>
        <td valign="middle"><b>Users</b></td>
    </tr>
</table>

<fieldset style="background-color: #f5f5f5;">
    <legend><b>Available Users</b></legend>
    <li><a href="users_detail.php?usr_id=0" target="_self"><b>Add User</b></a></li>
    <?
    
    $where_clause = "";
    
    // Do not allow non-super admins, i.e. installation admin user, to modify the super admin account
    
    if ($_SESSION["WAGATEWAY"]["USR_ID"] != 1)
        {
        $where_clause = " WHERE usr_id <> 1";
        }
        
    $query = "SELECT * FROM ".$_SESSION["WAGATEWAY"]["DB_TABLE_PREFIX"]."Users".$where_clause." ORDER BY usr_last_name, usr_first_name, usr_logon_id";
    $result = mysql_query($query, $db_conn) or die (DBError($_SERVER["PHP_SELF"]."\n\n".$query."\n\n".mysql_errno().": ".mysql_error()));
    
    $row_count = mysql_num_rows($result);
    
    if ($row_count > 0)
        {
        ?>
        <table border="0" cellpadding="4" cellspacing="0" width="100%">
            <tr>
                <td style="border-bottom: solid black 1px; font-weight: bold;" width="300px">User Name (Logon ID)</td>
                <td align="center" style="border-bottom: solid black 1px; font-weight: bold;" width="150px">Date Added</td>
                <td align="center" style="border-bottom: solid black 1px; font-weight: bold;" width="150px">Date Last Login</td>
                <td style="border-bottom: solid black 1px; font-weight: bold;" width="*">&nbsp;</td>
            </tr>
        <?
        for ($i = 0; $i < $row_count; $i++)
            {
            $row = mysql_fetch_array($result);
            ?>
            <tr>
                <td><a href="users_detail.php?usr_id=<? echo $row["usr_id"]; ?>" target="_self"><? echo $row["usr_last_name"].", ".$row["usr_first_name"]." (".$row["usr_logon_id"].")"; ?></a></td>
                <td><? echo $row["usr_date_added"]; ?></td>
                <td><? echo $row["usr_last_logon"]; ?></td>
                <td>&nbsp;</td>
            </tr>
            <?
            }
        ?>
        </table>
        <?
        }
    ?>
</fieldset>

</body>
</html>
Return current item: Web Application Gateway