Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 rsolanki 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|			          wGrantRole				 	 |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
%>
13
<!--#include file="common/globals.asp"-->
14
<!--#include file="common/config.asp"-->
15
<!--#include file="common/common_subs.asp"-->
16
<!--#include file="common/_popup_window_common.asp"-->
17
<%
18
'------------ ACCESS CONTROL ------------------
19
%>
20
<!--#include file="_access_control_general.asp"-->
21
<%
22
'------------ VARIABLE DEFINITION -------------
23
Dim parApp_id
24
Dim rsQry
25
Dim objFormCollector
26
'------------ CONSTANTS DECLARATION -----------
27
Const LIMG_ROLE = "<img src='images/i_role.gif' width='16' height='16' hspace='2' border='0' align='absmiddle'>"
28
'------------ VARIABLE INIT -------------------
29
Set objFormCollector = CreateObject("Scripting.Dictionary")
30
parApp_id = Request("app_id")
31
'------------ CONDITIONS ----------------------
32
'----------------------------------------------
33
%>
34
<%
35
'--------------------------------------------------------------------------------------------------------------------------
36
Sub GrantRole ()
37
	On Error Resume Next
38
 
39
	OraDatabase.Parameters.Add "ROLE_ID_LIST", 		Request("role_id_list"), 	ORAPARM_INPUT, ORATYPE_VARCHAR2
40
	OraDatabase.Parameters.Add "USER_ID", 			Request("user_id"), 		ORAPARM_INPUT, ORATYPE_NUMBER
41
 
42
 
43
	objEH.TryORA ( OraSession )
44
 
45
	OraDatabase.ExecuteSQL _
46
	"BEGIN pk_Role.Grant_Role ( :ROLE_ID_LIST, :USER_ID ); END;"	
47
 
48
	objEH.CatchORA ( OraSession )
49
 
50
 
51
	OraDatabase.Parameters.Remove "ROLE_ID_LIST"
52
	OraDatabase.Parameters.Remove "USER_ID"
53
 
54
End Sub
55
'--------------------------------------------------------------------------------------------------------------------------
56
%>
57
<%
58
'------------ RUN BEFORE PAGE RENDER ----------
59
' --- Get Form details from DB (for edit forms only) ---
60
'-------------------------------------------------------
61
 
62
' --- Load Validation Rules ---
63
 
64
 
65
' --- Enter Form Validation Rule Changes here... ----
66
'----------------------------------------------------
67
 
68
If CBool(Request("action")) Then
69
	If objForm.IsValidOnPostBack Then
70
		' --- Form is Valid ---
71
		Call GrantRole()
72
 
73
		If objEH.Finally Then
74
			Call OpenInParentWindow ( Request("rfile") &"?"& objPMod.ComposeURL() )
75
			Call CloseWindow()
76
		End If
77
 
78
	End If
79
End If
80
'----------------------------------------------
81
%>
82
<html>
83
<head>
84
<title>Access Manager</title>
85
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
86
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
87
<link href="scripts/access_manager.css" rel="stylesheet" type="text/css">
88
<script language="JavaScript" src="scripts/common.js"></script>
89
</head>
90
 
91
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" onLoad="self.focus();">
92
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
93
  <tr>
94
    <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>
95
    Select Role from the list and click "Grant". </td>
96
  </tr>
97
  <form name="FormName" method="post" action="<%=SCRIPT_NAME%>">
98
  <tr>
99
    <td background="images/bg_drk_bage_pane.gif">
100
	<table width="100%"  border="0" cellspacing="0" cellpadding="0">
101
      <tr>
102
        <td>&nbsp;</td>
103
        <td align="right"><input name="btn" type="submit" class="form_btn" value="Grant">
104
          <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();"></td>
105
      </tr>
106
    </table></td>
107
  </tr>
108
  <tr>
109
    <td>
110
 
111
		<table width="300"  border="0" cellspacing="2" cellpadding="0">
112
          <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
113
          <%If NOT objEH.Finally Then%>
114
          <tr>
115
            <td>
116
              <%objEH.DisplayMessage()%>
117
            </td>
118
          </tr>
119
          <%End If%>
120
          <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
121
        </table>
122
 
123
		 <!-- DETAILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
124
		 <table width="100%"  border="0" cellspacing="3" cellpadding="0">
125
          <tr>
126
		  	<td width="1%" background="images/bg_table_col.gif"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
127
            <td width="30%" background="images/bg_table_border.gif"><table width="100%"  border="0" cellspacing="1" cellpadding="2">
128
              <tr>
129
                <td align="right" nowrap background="images/bg_table_col.gif" class="body_col">Role</td>
130
              </tr>
131
            </table></td>
132
            <td width="70%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Description</td>
133
          </tr>
134
		  <%
135
		  OraDatabase.Parameters.Add "USER_ID", Request("user_id"),	ORAPARM_INPUT, ORATYPE_NUMBER 
136
		  OraDatabase.Parameters.Add "APP_ID", parApp_id,	ORAPARM_INPUT, ORATYPE_NUMBER 
137
 
138
		  Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("GetUserRoleList.sql"), ORADYN_DEFAULT )
139
 
140
		  OraDatabase.Parameters.Remove "APP_ID"
141
		  OraDatabase.Parameters.Remove "USER_ID"
142
 
143
 
144
 
145
		  While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
146
		  %>
147
          <tr>
148
		  	<td align="center"><input type="checkbox" name="role_id_list" value="<%=rsQry("role_id")%>"></td>
149
            <td nowrap class="body_row"><%=LIMG_ROLE &  rsQry("role_name")%></td>
150
            <td class="body_rowlite"><%=rsQry("comments")%></td>
151
          </tr>
152
		  <%rsQry.MoveNext%>
153
 
154
		  <%If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then%>
155
          <tr>
156
            <td colspan="3" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
157
          </tr>
158
		  <%End If%>
159
 
160
		  <%
161
		  WEnd
162
 
163
 
164
		  %>
165
          <tr>
166
            <td colspan="3" background="images/bg_table_border.gif">
167
			 <table width="100%"  border="0" cellspacing="1" cellpadding="2">
168
              <tr>
169
                <td nowrap background="images/bg_table_col.gif"><img src="images/spacer.gif" width="1" height="1"></td>
170
              </tr>
171
             </table>
172
			</td>
173
          </tr>
174
         </table>	 	 
175
		 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
176
 
177
 
178
	</td>
179
  </tr>
180
  <%=objPMod.ComposeHiddenTags()%>
181
  <input type="hidden" name="action" value="true">
182
  </form>
183
</table>
184
</body>
185
</html>
186
<%
187
'------------ RUN AFTER PAGE RENDER -----------
188
Set objFormCollector = Nothing
189
'----------------------------------------------
190
%>
191
<!--#include file="common/globals_destructor.asp"-->