Subversion Repositories DevTools

Rev

Rev 5512 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5354 dpurdie 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
<link rel="shortcut icon" href="<%=FavIcon%>"/>
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
		  <%
6265 dpurdie 135
		  OraDatabase.Parameters.Add "USER_ID_USER", objAccessControl.UserId,	ORAPARM_INPUT, ORATYPE_NUMBER 
5354 dpurdie 136
		  OraDatabase.Parameters.Add "USER_ID", Request("user_id"),	ORAPARM_INPUT, ORATYPE_NUMBER 
137
		  OraDatabase.Parameters.Add "APP_ID", parApp_id,	ORAPARM_INPUT, ORATYPE_NUMBER 
138
 
139
		  Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("GetUserRoleList.sql"), ORADYN_DEFAULT )
140
 
141
		  OraDatabase.Parameters.Remove "APP_ID"
142
		  OraDatabase.Parameters.Remove "USER_ID"
6265 dpurdie 143
		  OraDatabase.Parameters.Remove "USER_ID_USER"
5354 dpurdie 144
 
6265 dpurdie 145
          While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
146
                Dim bGranted : bGranted =  rsQry("granted") = 0 
147
                Dim bEnabled : bEnabled = (canActionControl("canAssignRoleToUser") OR rsQry("can_delegate")) AND NOT bGranted
148
                Dim ImageName : ImageName = iif(bEnabled, LIMG_ROLE, LIMG_ROLE_OFF)
5354 dpurdie 149
		  %>
150
          <tr>
6265 dpurdie 151
		  	<td align="center"><input type="checkbox" name="role_id_list" value="<%=rsQry("role_id")%>" <%=iif(bEnabled, "", " disabled ")%> <%=iif(bGranted, "checked", "")%>></td>
152
            <td nowrap class="body_row"><%=ImageName &  rsQry("role_name")%></td>
5354 dpurdie 153
            <td class="body_rowlite"><%=rsQry("comments")%></td>
154
          </tr>
155
          <tr>
156
            <td colspan="3" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
157
          </tr>
6265 dpurdie 158
 
159
		  <%rsQry.MoveNext%>
5354 dpurdie 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"-->