Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5296 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'
5
'   User Override
6
'   User_Override.asp
7
'
8
'=====================================================
9
%>
10
<%
11
Option explicit
12
Response.Expires = 0
13
%>
14
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/config.asp"-->
16
<!--#include file="common/common_subs.asp"-->
17
<!--#include file="common/_user_common.asp"-->
18
<%
19
'------------ ACCESS CONTROL ------------------
20
%>
21
<!--#include file="_access_control_general.asp"-->
22
<%
23
'------------ VARIABLE DEFINITION -------------
24
Dim RoleId
25
Dim sNode
26
Dim rsQry
27
Dim ActiveCombo
28
Dim VisibleCombo
29
Dim objAppCollector
30
'------------ CONSTANTS DECLARATION -----------
31
'------------ VARIABLE INIT -------------------
32
Set objAppCollector = CreateObject("Scripting.Dictionary")
33
'------------ CONDITIONS ----------------------
34
'----------------------------------------------
35
%>
36
<%
37
'------------------------------------------------------------------------------------------------------------------------------------------------------
38
Sub SetPermissionCombos ( nObj_id, cVisible, cActive, ByRef outVisibleCombo, ByRef outActiveCombo )
39
	Dim i, selected
40
 
41
 
42
	' --- Visible Combo ---
43
	outVisibleCombo = ""
44
	outVisibleCombo = outVisibleCombo &"<select name='VIS_"& nObj_id &"' class='form_iname'>"
45
 
46
	For i = 0 To UBound( arrVisiblePermissions ) Step NumberofPermissionFields
47
		selected = ""
48
		If arrVisiblePermissions( INXperm_val + i ) = cVisible Then
49
			selected = "selected"
50
		End If
51
 
52
		outVisibleCombo = outVisibleCombo &"<option class='"& arrVisiblePermissions( INXperm_style + i ) &"' "& selected &" value='"& arrVisiblePermissions( INXperm_val + i ) &"'>"& arrVisiblePermissions( INXperm_text + i ) &"</option>"& VBNewLine
53
	Next
54
 
55
	outVisibleCombo = outVisibleCombo &"</select>"
56
 
57
 
58
 
59
	' --- Active Combo ---
60
	outActiveCombo = ""
61
	outActiveCombo = outActiveCombo &"<select name='ACT_"& nObj_id &"' class='form_iname'>"
62
 
63
	For i = 0 To UBound( arrActivePermissions ) Step NumberofPermissionFields
64
		selected = ""
65
		If arrActivePermissions( INXperm_val + i ) = cActive Then
66
			selected = "selected"
67
		End If
68
 
69
		outActiveCombo = outActiveCombo &"<option class='"& arrActivePermissions( INXperm_style + i ) &"' "& selected &" value='"& arrActivePermissions( INXperm_val + i ) &"'>"& arrActivePermissions( INXperm_text + i ) &"</option>"& VBNewLine
70
	Next
71
 
72
	outActiveCombo = outActiveCombo &"</select>"
73
 
74
End Sub
75
'------------------------------------------------------------------------------------------------------------------------------------------------------
76
'-----------------------------------------------------------------------------------------------------------------
77
Sub GetUserRoleDetails ( nUser_id)
78
	Dim rsQry, query
79
	query = _
80
        "SELECT r.ROLE_ID " &_
81
        " FROM ROLES r, USER_ROLES ur WHERE " &_
82
        " r.IS_ROLE_VARIATION IS NOT NULL AND" &_
83
        " ur.ROLE_ID = r.ROLE_ID" &_
84
        " AND ur.USER_ID = " & nUser_id
85
 
86
	Set rsQry = OraDatabase.DbCreateDynaset( query , ORADYN_DEFAULT )
87
 
88
	If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
89
		RoleId   = rsQry("role_id")
90
	Else
91
		RoleId   = NULL
92
	End If
93
 
94
	rsQry.Close
95
	Set rsQry = Nothing
96
End Sub
97
%>
98
<%
99
'------------ RUN BEFORE PAGE RENDER ----------
100
Call GetUserDetails ( parUser_id, objUserCollector )
101
Call GetApplicationDetails ( parApp_id, objAppCollector )
102
Call GetUserRoleDetails ( parUser_id )
103
'----------------------------------------------
104
%>
105
<html>
106
<head>
107
<title>Access Manager</title>
108
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
109
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
110
<link href="scripts/access_manager.css" rel="stylesheet" type="text/css">
111
<script language="JavaScript" src="scripts/common.js"></script>
112
 
113
</head>
114
 
115
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
116
<!-- HEADER ++++++++++++++++++++++ -->
117
<!--#include file="_header.asp"-->
118
<!-- +++++++++++++++++++++++++++++ -->
119
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
120
  <tr>
121
    <td width="1%" valign="top" background="images/bg_bage_pane.gif">
122
	<!-- TREE NAVIGATOR ++++++++++++++++++++++++++++++++++++++++++++ -->
123
	<!--#include file="_treeNavigator.asp"-->  
124
	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
125
	</td>
126
    <td width="1" background="images/bg_drk_gray_border.gif"><img src="images/spacer.gif" width="1" height="600"></td>
127
    <td width="100%" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="9">
128
      <tr>
129
        <td background="images/bg_drk_bage_pane.gif">
130
		  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
131
            <tr>
132
              <td nowrap class="body_txt">
133
			    <!-- BUTTONS CONTROL +++++++++++++++++++ -->
134
				<!-- +++++++++++++++++++++++++++++++++++ -->
135
			  </td>
136
              <td align="right" nowrap class="section_ttl"><%=PARENT_TITLE%></td>
137
            </tr>
138
          </table>
139
		</td>
140
      </tr>
141
	  <tr>
142
        <td class="menu_crumbttl"><%Call RenderTitle ( objUserCollector )%> Application: <%=objAppCollector.Item ("application_name")%></td>
143
      </tr>
144
      <tr>
145
        <td>
146
		 <!-- DETAILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
147
		 	<!-- TAB CONTROLS ++++++++++++++++++++++ -->
148
			<!--#include file="_tabs_definition.asp"-->
149
			<%
150
			Set objTabControl = New TabControl
151
			objTabControl.TemplateDoc = ReadFile( Server.MapPath("controls/ERGTabStyleMac/mac_style.html") ) ' Supply tab style definition
152
			objTabControl.TabStyle = "StyleMac"
153
			objTabControl.AddTabDefnition ( arrUserAccount )
154
			objTabControl.SelectByName ( "User Override" )
155
			objTabControl.Render ()
156
			%>
157
			<!-- END OF TAB CONTROLS +++++++++++++++ -->
158
		 <table width="100%"  border="0" cellspacing="0" cellpadding="0">
159
          <tr>
160
            <td width="1" background="images/bg_gray_border.gif"><img src="images/spacer.gif" width="1" height="500"></td>
161
            <td width="100%" valign="top">
162
			  <table width="100%"  border="0" cellspacing="10" cellpadding="0">
163
                <tr>
164
                  <td>
165
				  <!-- TAB DETAILS +++++++++++++++++++++++++++++ -->
166
				    <%Call Messenger ( "Any permission changes will be appled to this user only!", 3, 400 )%><br>
167
					<table width="100%"  border="0" cellspacing="3" cellpadding="0">
168
					<form name="UserPrivileges" action="_SetUserOverridePermissions.asp" method="post">
169
			          <tr>
170
			            <td width="30%" background="images/bg_table_border.gif"><table width="100%"  border="0" cellspacing="1" cellpadding="2">
171
			              <tr>
172
			                <td align="right" nowrap background="images/bg_table_col.gif" class="body_col">Action Name</td>
173
			              </tr>
174
			            </table></td>
175
						<td width="1%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Permissions</td>
176
						<td width="70%" align="right" background="images/bg_table_col.gif" class="body_col">Description</td>
177
						<td width="1%" background="images/bg_table_col.gif"></td>
178
			          </tr>
179
					  <%
180
					  OraDatabase.Parameters.Add "USER_ID",  parUser_id, ORAPARM_INPUT, ORATYPE_NUMBER 
181
					  OraDatabase.Parameters.Add "APP_ID",   parApp_id,	 ORAPARM_INPUT, ORATYPE_NUMBER 
182
					  OraDatabase.Parameters.Add "ROLE_ID",  RoleId,	 ORAPARM_INPUT, ORATYPE_NUMBER 
183
 
184
					  Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("UserOverride.sql") , ORADYN_DEFAULT )
185
 
186
					  While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
187
					  	Call SetPermissionCombos ( rsQry("obj_id"), rsQry("visible_value"), rsQry("active_value"), VisibleCombo, ActiveCombo )
188
					  %>
189
 
190
			          <tr>
191
						<td nowrap class="body_row"><a href="Control_General.asp?obj_id=<%=rsQry("obj_id")%>&<%=objPMod.ComposeURL%>" class="body_link">
192
                            <%=Eval(rsQry("TYPE")) & rsQry("obj_name")%></a></td>
193
						<td class="body_txt" nowrap background='images/bg_bage_pane.gif'>&nbsp;&nbsp;<%=VisibleCombo%>&nbsp;&nbsp;<%=ActiveCombo%>&nbsp;&nbsp;</td>
194
						<td class="body_rowg"><%=rsQry("obj_description")%></td>
195
						<td>
196
                        <%If RoleId <> "" Then %>
197
                            <a href="Role_DataFiltering.asp?obj_id=<%=rsQry("obj_id")%>&role_id=<%=RoleId%>&<%=objPMod.ComposeURL%>" class="body_link"><%=EVal( rsQry("data_filter") )%></a></td>
198
                        <%End If%>
199
			          </tr>
200
					  <%
201
					  rsQry.MoveNext
202
					  %>
203
 
204
			          <tr>
205
			            <td colspan="5" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
206
			          </tr>
207
					  <%
208
					  WEnd
209
 
210
					  OraDatabase.Parameters.Remove "USER_ID"
211
					  OraDatabase.Parameters.Remove "APP_ID"
212
					  OraDatabase.Parameters.Remove "ROLE_ID"
213
					  %>
214
					  <tr>
215
						<td class="body_txt"></td>
216
						<td align="center" background='images/bg_bage_pane.gif'><input type="submit" name="btn" value="Apply" class="form_btn"></td>
217
						<td class="body_txt"></td>
218
			          </tr>
219
			          <tr>
220
			            <td colspan="5" background="images/bg_table_border.gif">
221
						 <table width="100%"  border="0" cellspacing="1" cellpadding="2">
222
			              <tr>
223
			                <td nowrap background="images/bg_table_col.gif"><img src="images/spacer.gif" width="1" height="1"></td>
224
			              </tr>
225
			             </table>
226
						</td>
227
			          </tr>
228
					 <%=objPMod.ComposeHiddenTags()%>
229
					 <input type="hidden" name="role_id" value="<%=RoleId%>">
230
					 <input type="hidden" name="rfile" value="<%=SCRIPT_NAME%>">
231
					 </form>
232
			         </table>
233
					 <SPAN class="body_txtg"><b>NOTE:</b> "User Specific" Role (<%=LIMG_SPEC_ROLE%>), will overwrite the permissions given by other roles.</SPAN>
234
				  <!-- +++++++++++++++++++++++++++++++++++++++++ -->
235
				  </td>
236
                </tr>
237
              </table>
238
			</td>
239
            <td width="1" background="images/bg_gray_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
240
          </tr>
241
         </table>
242
         <table width="100%"  border="0" cellspacing="0" cellpadding="0">
243
           <tr>
244
             <td background="images/bg_gray_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
245
           </tr>
246
         </table>
247
		 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
248
         <br></td>
249
      </tr>
250
    </table></td>
251
  </tr>
252
</table>
253
<!-- FOOTER ++++++++++++++++++++++ -->
254
<!--#include file="_footer.asp"-->
255
<!-- +++++++++++++++++++++++++++++ -->
256
</body>
257
</html>
258
<%
259
'------------ RUN AFTER PAGE RENDER -----------
260
'----------------------------------------------
261
%>
262
<!--#include file="common/globals_destructor.asp"-->