Subversion Repositories DevTools

Rev

Rev 2 | Rev 5354 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                    MultiRole Members              |
'|                                                   |
'=====================================================
%>
<%
Option explicit
Response.Expires = 0
%>
<!--#include file="common/globals.asp"-->
<!--#include file="common/config.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/_user_common.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<%
'------------ VARIABLE DEFINITION -------------
Dim rsUser
Dim objAppCollector
'------------ CONSTANTS DECLARATION -----------
'------------ VARIABLE INIT -------------------
Set objAppCollector = CreateObject("Scripting.Dictionary")
'------------ CONDITIONS ----------------------
'----------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------
Call GetApplicationDetails ( parApp_id, objAppCollector )

If (Request("action") <> "") Then
    '-- Select Action
    
    Select Case Request("action")
        Case "btnSubUser"
            Call OpenInWindow ( "_RemoveApplicationUser.asp?user_id_list="& Request("user_id_list") &"&everyone="& Request("everyone") &"&rfile="& SCRIPT_NAME &"&"& objPMod.ComposeURL() )
        
    End Select
    
End If
'----------------------------------------------
%>
<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">
<script language="JavaScript" src="scripts/common.js"></script>
</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">
    <form name="FormName" method="post" action="<%=SCRIPT_NAME%>">
      <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 +++++++++++++++++++ -->
                <%
                '-- Define Action buttons on this tab
                'aTabBtnsDef = Array("btnAddUser", "btnSubUser")
                
                'Call LoadTabActionButtons ( aTabBtnsDef, objBtnControl )
                
                'objBtnControl.Render( aTabBtnsDef )
                %>
                <!-- +++++++++++++++++++++++++++++++++++ -->
              </td>
              <td align="right" nowrap class="section_ttl"><%=objAppCollector.Item ("application_name")%></td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td class="menu_crumbttl"><img src="images/i_user_lrg.gif" border="0" align="absmiddle" hspace="4"><strong>Role Members</strong></td>
      </tr>
      <tr>
        <td>
         <!-- DETAILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
         <%
        Dim startPosition, pageNumber, navigator, totalRecords, lastRecord, listCount
        Const MAX_ROWS = 50 ' Maximum number of rows displayed
        listCount = UBound(Split(Request("role_id_list"),",")) + 1
        
        '--- Set filters ---
        
        OraDatabase.Parameters.Add "ROLE_ID_LIST",  Request("role_id_list"),    ORAPARM_INPUT, ORATYPE_NUMBER
        OraDatabase.Parameters.Add "ROLE_SUM",      listCount,                  ORAPARM_INPUT, ORATYPE_NUMBER
        
        
        Set rsUser = OraDatabase.DbCreateDynaset( GetQuery ("MultiRoleMembers.sql") , ORADYN_DEFAULT )
        
        
        OraDatabase.Parameters.Remove "ROLE_ID_LIST"
        OraDatabase.Parameters.Remove "ROLE_SUM"
        
        
        '--- 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> 
         <%
         If listCount > 1 Then
            Call Messenger ( "There are no users common to all the selected Roles", 3, 400 )
         Else
         %>
         <!-- 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="1%" background="images/bg_table_col.gif"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
            <td width="30%" 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">Full Name </td>
              </tr>
            </table></td>
            <td width="25%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Email</td>
            <td width="25%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">User Name</td>
            <td width="20%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Domain</td>
            <td width="1%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Last Request</td>
            <td width="1%" background="images/bg_table_col.gif"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
          </tr>
          <%If (Request("filter") = "") AND (rsUser.RecordCount > 0) Then%>
          <tr>
            <td align="center" background="images/bg_table_col.gif"><input type="checkbox" name="everyone" value="Y"></td>
            <td background="images/bg_table_col.gif"></td>
            <td nowrap class="body_row" background="images/bg_table_col.gif"><img src="images/i_accounts.gif" width="16" height="14" border="0" hspace="4" align="absmiddle">Everyone</td>
            <td background="images/bg_table_col.gif"></td>
            <td background="images/bg_table_col.gif"></td>
            <td background="images/bg_table_col.gif"></td>
            <td background="images/bg_table_col.gif"></td>
            <td background="images/bg_table_col.gif"></td>
            <td background="images/bg_table_col.gif"></td>
          </tr>
          <%End If%>
          <%
          '--- 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"><input type="checkbox" name="user_id_list" value="<%=rsUser("user_id")%>"></td>
            <td align="center"><%= UserOnlineIcon ( rsUser("user_online"), rsUser("last_request") )%></td>
            <td nowrap class="body_row"><a href="User_General.asp?user_id=<%=rsUser("user_id")%>&<%=objPMod.ComposeURL%>" class="body_link"><%=Eval( rsUser("user_image") )  &  rsUser("full_name")%></a></td>
            <td nowrap><a href="mailto:<%=rsUser("user_email")%>" class="body_link"><%=rsUser("user_email")%></a></td>
            <td class="body_rowg"><%=rsUser("user_name")%></td>
            <td class="body_rowg"><%=rsUser("domain")%></td>
            <td class="body_rowg" nowrap><%=LastRequest ( rsUser("last_request") )%></td>
            <td align="center"><a href="User_Roles.asp?user_id=<%=rsUser("user_id")%>&<%=objPMod.ComposeURL%>" title="See User Roles"><%=LIMG_ROLE%></a></td>
          </tr>
          <%rsUser.MoveNext%>
          
          <%If (NOT rsUser.BOF) AND (NOT rsUser.EOF) Then%>
          <tr>
            <td colspan="8" 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="8" 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>
         <%End If%>
         <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
         <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="right" class="body_scol"><%=navigator%></td>
          </tr>
        </table>
         <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
         <br></td>
      </tr>
      <%=objPMod.ComposeHiddenTags()%>
      <input type="hidden" name="action" value="true">
    </form>
    </table></td>
  </tr>
</table>
<!-- FOOTER ++++++++++++++++++++++ -->
<!--#include file="_footer.asp"-->
<!-- +++++++++++++++++++++++++++++ -->
</body>
</html>
<%
'------------ RUN AFTER PAGE RENDER -----------
'----------------------------------------------
%>
<!--#include file="common/globals_destructor.asp"-->