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