Subversion Repositories DevTools

Rev

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

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                                wGrantRole                                     |
'|                                                   |
'=====================================================
%>
<%
Option explicit
Response.Expires = 0
%>
<!--#include file="common/globals.asp"-->
<!--#include file="common/config.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/_popup_window_common.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<%
'------------ VARIABLE DEFINITION -------------
Dim parApp_id
Dim rsQry
Dim objFormCollector
'------------ CONSTANTS DECLARATION -----------
Const LIMG_ROLE = "<img src='images/i_role.gif' width='16' height='16' hspace='2' border='0' align='absmiddle'>"
'------------ VARIABLE INIT -------------------
Set objFormCollector = CreateObject("Scripting.Dictionary")
parApp_id = Request("app_id")
'------------ CONDITIONS ----------------------
'----------------------------------------------
%>
<%
'--------------------------------------------------------------------------------------------------------------------------
Sub GrantRole ()
        On Error Resume Next
        
        OraDatabase.Parameters.Add "ROLE_ID_LIST",              Request("role_id_list"),        ORAPARM_INPUT, ORATYPE_VARCHAR2
        OraDatabase.Parameters.Add "USER_ID",                   Request("user_id"),             ORAPARM_INPUT, ORATYPE_NUMBER
        
        
        objEH.TryORA ( OraSession )
        
        OraDatabase.ExecuteSQL _
        "BEGIN pk_Role.Grant_Role ( :ROLE_ID_LIST, :USER_ID ); END;"    
        
        objEH.CatchORA ( OraSession )
        
        
        OraDatabase.Parameters.Remove "ROLE_ID_LIST"
        OraDatabase.Parameters.Remove "USER_ID"
        
End Sub
'--------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------
' --- Get Form details from DB (for edit forms only) ---
'-------------------------------------------------------

' --- Load Validation Rules ---


' --- Enter Form Validation Rule Changes here... ----
'----------------------------------------------------

If CBool(Request("action")) Then
        If objForm.IsValidOnPostBack Then
                ' --- Form is Valid ---
                Call GrantRole()
                
                If objEH.Finally Then
                        Call OpenInParentWindow ( Request("rfile") &"?"& objPMod.ComposeURL() )
                        Call CloseWindow()
                End If
                
        End If
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" onLoad="self.focus();">
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
  <tr>
    <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="images/i_role_lrg.gif" width="13" height="18" hspace="0" align="absmiddle" border="0">&nbsp;Grant Role </span> <br>
    Select Role from the list and click "Grant". </td>
  </tr>
  <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>&nbsp;</td>
        <td align="right"><input name="btn" type="submit" class="form_btn" value="Grant">
          <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>

                <table width="300"  border="0" cellspacing="2" cellpadding="0">
          <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
          <%If NOT objEH.Finally Then%>
          <tr>
            <td>
              <%objEH.DisplayMessage()%>
            </td>
          </tr>
          <%End If%>
          <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
        </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="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">Role</td>
              </tr>
            </table></td>
            <td width="70%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Description</td>
          </tr>
                  <%
                  OraDatabase.Parameters.Add "USER_ID", Request("user_id"),     ORAPARM_INPUT, ORATYPE_NUMBER 
                  OraDatabase.Parameters.Add "APP_ID", parApp_id,       ORAPARM_INPUT, ORATYPE_NUMBER 
                  
                  Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("GetUserRoleList.sql"), ORADYN_DEFAULT )
                  
                  OraDatabase.Parameters.Remove "APP_ID"
                  OraDatabase.Parameters.Remove "USER_ID"
                  
                  
                  
                  While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
                  %>
          <tr>
                        <td align="center"><input type="checkbox" name="role_id_list" value="<%=rsQry("role_id")%>"></td>
            <td nowrap class="body_row"><%=LIMG_ROLE &  rsQry("role_name")%></td>
            <td class="body_rowlite"><%=rsQry("comments")%></td>
          </tr>
                  <%rsQry.MoveNext%>
                  
                  <%If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then%>
          <tr>
            <td colspan="3" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
          </tr>
                  <%End If%>
                  
                  <%
                  WEnd
                  
                  
                  %>
          <tr>
            <td colspan="3" 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>                
                 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                
                
        </td>
  </tr>
  <%=objPMod.ComposeHiddenTags()%>
  <input type="hidden" name="action" value="true">
  </form>
</table>
</body>
</html>
<%
'------------ RUN AFTER PAGE RENDER -----------
Set objFormCollector = Nothing
'----------------------------------------------
%>
<!--#include file="common/globals_destructor.asp"-->