Subversion Repositories DevTools

Rev

Rev 2 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                                  Login Trail                                          |
'|                                                   |
'=====================================================
%>
<%
Option explicit
Response.Expires = 0
%>
<!--#include file="common/globals.asp"-->
<!--#include file="common/config.asp"-->
<!--#include file="common/common_subs.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<%
'------------ VARIABLE DEFINITION -------------
Dim rsUser
'------------ CONSTANTS DECLARATION -----------
Const LIMG_LOGON_SUCCESS = "<img src='icons/i_logon_success.gif' width='18' height='18' hspace='2' border='0' align='absmiddle' title='User Logon Successful'>"
Const LIMG_LOGON_FAIL = "<img src='icons/i_logon_fail.gif' width='18' height='18' hspace='2' border='0' align='absmiddle' title='User Logon Fail'>"
Const LIMG_LOGOFF = "<img src='icons/i_logoff.gif' width='18' height='18' hspace='2' border='0' align='absmiddle' title='User Logoff'>"
Const LIMG_SESSION_EXPIRE = "<img src='icons/i_session_expire.gif' width='18' height='18' hspace='2' border='0' align='absmiddle' title='Session Timed Out'>"

'------------ VARIABLE INIT -------------------
'------------ CONDITIONS ----------------------
'----------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------
objPMod.PersistInQryString ("tree")
'----------------------------------------------
%>
<html>
<head>
<title>Access Manager</title>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="scripts/access_manager.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<!-- HEADER ++++++++++++++++++++++ -->
<!--#include file="_header.asp"-->
<!-- +++++++++++++++++++++++++++++ -->
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="1%" valign="top" background="images/bg_bage_pane.gif">
        <!-- TREE NAVIGATOR ++++++++++++++++++++++++++++++++++++++++++++ -->
        <!--#include file="_treeNavigator.asp"-->  
        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
        </td>
    <td width="1" background="images/bg_drk_gray_border.gif"><img src="images/spacer.gif" width="1" height="600"></td>
    <td width="100%" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="9">
      <tr>
        <td background="images/bg_drk_bage_pane.gif">
                  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td nowrap class="body_txt">
                            <!-- BUTTONS CONTROL +++++++++++++++++++ -->
                                <!-- +++++++++++++++++++++++++++++++++++ -->
                          </td>
              <td align="right" nowrap class="section_ttl">Login Trail</td>
            </tr>
          </table>
                </td>
      </tr>
      <tr>
        <td>
                <%
                Dim startPosition, pageNumber, navigator, totalRecords, lastRecord
                Const MAX_ROWS = 100    ' Maximum number of rows displayed
                
                
                Set rsUser = OraDatabase.DbCreateDynaset( GetQuery ("LoginTrail.sql") , ORADYN_DEFAULT )
                
                '--- Get page number ---
                pageNumber = 0
                If Request("pg") <> "" Then 
                pageNumber = CInt(Request("pg"))
                End If
                
                
                '--- Set Cursor start position ---
                startPosition = pageNumber * MAX_ROWS + 1
                If (NOT rsUser.BOF) AND (NOT rsUser.EOF) Then
                        rsUser.MoveTo ( startPosition )         ' Set starting cursor point
                        
                End If
                
                
                '--- Construct Navigator
                navigator = ""
                If (NOT rsUser.BOF) AND (NOT rsUser.EOF) Then
                        totalRecords = rsUser.RecordCount       ' Get total number of records
                        
                        '--- Create "Previous" link
                        If pageNumber > 0 Then
                                navigator = navigator &"<a href='"& SCRIPT_NAME &"?pg="& pageNumber - 1 &"&"& objPMod.ComposeURL &"' class='body_link' title='Show Previous Page'>&laquo; Previous</a>"
                        End If
                        
                        '--- Create "Next" link
                        If ( startPosition + MAX_ROWS ) < totalRecords Then
                                navigator = navigator &"&nbsp;&nbsp;<a href='"& SCRIPT_NAME &"?pg="& pageNumber + 1 &"&"& objPMod.ComposeURL &"' class='body_link' title='Show Next Page'>Next &raquo;</a>"
                        End If
                        
                End If
                
                
                '--- Calculate Last Record ---
                If totalRecords > 0 Then
                        lastRecord = ( startPosition - 1 + MAX_ROWS ) _
                                                + ( CInt( ( startPosition - 1 + MAX_ROWS )/totalRecords > 1) ) * ( ( startPosition - 1 + MAX_ROWS ) - totalRecords )
                End If
                %>
                <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr align="left">
            <td colspan="2" class="body_row">&nbsp;</td>
          </tr>
          <tr>
            <td align="left" class="body_row">
                        <%
                        If totalRecords > 0 Then 
                                Response.write "Showing "& startPosition &" - "& lastRecord &" of "& totalRecords
                        Else
                                Response.write "No Results."
                        End If
                        %></td>
            <td align="right" class="body_scol"><%=navigator%></td>
          </tr>
        </table>          
                 <!-- DETAILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                 <table width="100%"  border="0" cellspacing="3" cellpadding="0">
          <tr>
                        <td width="1%" background="images/bg_table_col.gif"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
            <td width="10%" background="images/bg_table_border.gif">
                        <table width="100%"  border="0" cellspacing="1" cellpadding="2">
              <tr>
                <td align="right" nowrap background="images/bg_table_col.gif" class="body_col">User Name</td>
              </tr>
            </table></td>
                        <td width="10%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Full Name</td>
            <td width="15%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Remote Address (IP)</td>
                        <td width="15%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Application</td>
                        <td width="10%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Date</td>
                        <td width="40%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Comments</td>
          </tr>
                  <%
                  '--- Render rows ---
                  Do While (NOT rsUser.BOF) AND (NOT rsUser.EOF)
                                If rsUser.RowPosition => (startPosition + MAX_ROWS) Then Exit Do        ' Limit the number of rows displayed
                  %>
          <tr>
                        <td align="center"><%=Eval(rsUser("event_icon"))%></td>
            <td nowrap class="body_row"><%=rsUser("user_name")%></td>
                        <td nowrap class="body_row"><a href="User_General.asp?user_id=<%=rsUser("user_id")%>&<%=objPMod.ComposeURL%>" class="body_link"><%=rsUser("full_name")%></a></td>
                        <td nowrap class="body_row"><a href="Computer_Users.asp?client_ip=<%=rsUser("client_ip")%>&<%=objPMod.ComposeURL%>" class="body_link"><%=rsUser("client_ip")%></a></td>
                        <td nowrap class="body_row"><%=rsUser("application_name")%></td>
                        <td nowrap class="body_row"><%=rsUser("stamp")%></td>
            <td class="body_rowlite"><%=rsUser("comments")%></td>
          </tr>
                  <%rsUser.MoveNext%>
                  
                  <%If (NOT rsUser.BOF) AND (NOT rsUser.EOF) Then%>
          <tr>
            <td colspan="7" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
          </tr>
                  <%End If%>
                  
                  <%
                  Loop
                  
                  
                  rsUser.Close()
                  Set rsUser = Nothing
                  %>
          <tr>
            <td colspan="7" background="images/bg_table_border.gif">
                         <table width="100%"  border="0" cellspacing="1" cellpadding="2">
              <tr>
                <td nowrap background="images/bg_table_col.gif"><img src="images/spacer.gif" width="1" height="1"></td>
              </tr>
             </table>
                        </td>
          </tr>
         </table>        
                 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                 <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="right" class="body_scol"><%=navigator%></td>
          </tr>
        </table>
         <br></td>
      </tr>
    </table></td>
  </tr>
</table>
<!-- FOOTER ++++++++++++++++++++++ -->
<!--#include file="_footer.asp"-->
<!-- +++++++++++++++++++++++++++++ -->
</body>
</html>
<%
'------------ RUN AFTER PAGE RENDER -----------
'----------------------------------------------
%>
<!--#include file="common/globals_destructor.asp"-->