Subversion Repositories DevTools

Rev

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