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
'|			          User Privileges				 |
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/_user_common.asp"-->
17
<%
18
'------------ ACCESS CONTROL ------------------
19
%>
20
<!--#include file="_access_control_general.asp"-->
21
<%
22
'------------ VARIABLE DEFINITION -------------
23
Dim rsQry
24
Dim ActiveCombo
25
Dim VisibleCombo
26
Dim currObj_id
27
Dim isNewGroup
28
Dim isVisibleComboDisabled
29
Dim isActiveComboDisabled
30
'------------ CONSTANTS DECLARATION -----------
31
'------------ VARIABLE INIT -------------------
32
'------------ CONDITIONS ----------------------
33
'----------------------------------------------
34
%>
35
<%
36
'--------------------------------------------------------------------------------------------------------------------------------------------
37
Sub SetPermissionCombos ( nObj_id, bNewGroup, cIsRoleVariation, _
38
						  ByRef isVisibleComboDisabled, ByRef isActiveComboDisabled, _
39
						  cVisible, cActive, _
40
						  ByRef outVisibleCombo, ByRef outActiveCombo )
41
	Dim i, selected
42
 
43
 
44
	' --- Reset combos "disabled" if necessary ---
45
	If bNewGroup AND IsNull( cIsRoleVariation ) Then
46
		isVisibleComboDisabled  = ""
47
		isActiveComboDisabled = ""
48
	End If
49
 
50
 
51
 
52
	' --- Visible Combo ---
53
	outVisibleCombo = ""
54
	outVisibleCombo = outVisibleCombo &"<select name='VIS_"& nObj_id &"' class='form_iname' "& isVisibleComboDisabled &">"
55
 
56
	For i = 0 To UBound( arrVisiblePermissions ) Step NumberofPermissionFields
57
		selected = ""
58
		If arrVisiblePermissions( INXperm_val + i ) = cVisible Then
59
			selected = "selected"
60
		End If
61
 
62
		outVisibleCombo = outVisibleCombo &"<option class='"& arrVisiblePermissions( INXperm_style + i ) &"' "& selected &" value='"& arrVisiblePermissions( INXperm_val + i ) &"'>"& arrVisiblePermissions( INXperm_text + i ) &"</option>"& VBNewLine
63
	Next
64
 
65
	outVisibleCombo = outVisibleCombo &"</select>"
66
 
67
 
68
 
69
	' --- Active Combo ---
70
	outActiveCombo = ""
71
	outActiveCombo = outActiveCombo &"<select name='ACT_"& nObj_id &"' class='form_iname' "& isActiveComboDisabled &">"
72
 
73
	For i = 0 To UBound( arrActivePermissions ) Step NumberofPermissionFields
74
		selected = ""
75
		If arrActivePermissions( INXperm_val + i ) = cActive Then
76
			selected = "selected"
77
		End If
78
 
79
		outActiveCombo = outActiveCombo &"<option class='"& arrActivePermissions( INXperm_style + i ) &"' "& selected &" value='"& arrActivePermissions( INXperm_val + i ) &"'>"& arrActivePermissions( INXperm_text + i ) &"</option>"& VBNewLine
80
	Next
81
 
82
	outActiveCombo = outActiveCombo &"</select>"
83
 
84
 
85
 
86
 
87
	' --- Set combos "disabled" if role variation is present ---
88
	If bNewGroup AND NOT IsNull( cIsRoleVariation ) Then
89
		isVisibleComboDisabled  = "disabled"
90
		isActiveComboDisabled = "disabled"
91
	End If
92
 
93
End Sub
94
'--------------------------------------------------------------------------------------------------------------------------------------------
95
%>
96
<%
97
'------------ RUN BEFORE PAGE RENDER ----------
98
Call GetUserDetails ( parUser_id, objUserCollector )
99
'----------------------------------------------
100
%>
101
<html>
102
<head>
103
<title>Access Manager</title>
104
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
105
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
106
<link href="scripts/access_manager.css" rel="stylesheet" type="text/css">
107
<script language="JavaScript" src="scripts/common.js"></script>
108
 
109
</head>
110
 
111
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
112
<!-- HEADER ++++++++++++++++++++++ -->
113
<!--#include file="_header.asp"-->
114
<!-- +++++++++++++++++++++++++++++ -->
115
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
116
  <tr>
117
    <td width="1%" valign="top" background="images/bg_bage_pane.gif">
118
	<!-- TREE NAVIGATOR ++++++++++++++++++++++++++++++++++++++++++++ -->
119
	<!--#include file="_treeNavigator.asp"-->  
120
	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
121
	</td>
122
    <td width="1" background="images/bg_drk_gray_border.gif"><img src="images/spacer.gif" width="1" height="600"></td>
123
    <td width="100%" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="9">
124
      <tr>
125
        <td background="images/bg_drk_bage_pane.gif">
126
		  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
127
            <tr>
128
              <td nowrap class="body_txt">
129
			    <!-- BUTTONS CONTROL +++++++++++++++++++ -->
130
				<!-- +++++++++++++++++++++++++++++++++++ -->
131
			  </td>
132
              <td align="right" nowrap class="section_ttl"><%=PARENT_TITLE%></td>
133
            </tr>
134
          </table>
135
		</td>
136
      </tr>
137
	  <tr>
138
        <td class="menu_crumbttl"><%Call RenderTitle ( objUserCollector )%></td>
139
      </tr>
140
      <tr>
141
        <td>
142
		 <!-- DETAILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
143
		 	<!-- TAB CONTROLS ++++++++++++++++++++++ -->
144
			<!--#include file="_tabs_definition.asp"-->
145
			<%
146
			Set objTabControl = New TabControl
147
			objTabControl.TemplateDoc = ReadFile( Server.MapPath("controls/ERGTabStyleMac/mac_style.html") ) ' Supply tab style definition
148
			objTabControl.TabStyle = "StyleMac"
149
			objTabControl.AddTabDefnition ( arrUserAccount )
150
			objTabControl.SelectByName ( "User Permissions" )
151
			objTabControl.Render ()
152
			%>
153
			<!-- END OF TAB CONTROLS +++++++++++++++ -->
154
		 <table width="100%"  border="0" cellspacing="0" cellpadding="0">
155
          <tr>
156
            <td width="1" background="images/bg_gray_border.gif"><img src="images/spacer.gif" width="1" height="500"></td>
157
            <td width="100%" valign="top">
158
			  <table width="100%"  border="0" cellspacing="10" cellpadding="0">
159
                <tr>
160
                  <td>
161
				  <!-- TAB DETAILS +++++++++++++++++++++++++++++ -->
162
				    <%Call Messenger ( "Any permission changes will be appled to this user only!", 3, 400 )%><br>
163
					<table width="100%"  border="0" cellspacing="3" cellpadding="0">
164
					<form name="UserPrivileges" action="_SetRoleVariationPermissions.asp" method="post">
165
			          <tr>
166
					  	<td width="1%" background="images/bg_table_col.gif"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
167
			            <td width="20%" background="images/bg_table_border.gif"><table width="100%"  border="0" cellspacing="1" cellpadding="2">
168
			              <tr>
169
			                <td align="right" nowrap background="images/bg_table_col.gif" class="body_col">Role Name</td>
170
			              </tr>
171
			            </table></td>
172
						<td width="20%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Control Name</td>
173
						<td width="1%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Permissions</td>
174
						<td width="60%" align="right" background="images/bg_table_col.gif" class="body_col"></td>
175
			          </tr>
176
					  <%
177
					  OraDatabase.Parameters.Add "USER_ID",  parUser_id, ORAPARM_INPUT, ORATYPE_NUMBER 
178
					  OraDatabase.Parameters.Add "APP_ID",   parApp_id,	 ORAPARM_INPUT, ORATYPE_NUMBER 
179
 
180
					  Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("UserPermissions.sql") , ORADYN_DEFAULT )
181
					  currObj_id = -1
182
					  isNewGroup = FALSE
183
					  isVisibleComboDisabled = ""
184
					  isActiveComboDisabled = ""
185
 
186
					  While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
187
					  %>
188
 
189
					  <%If currObj_id <> CInt(rsQry("obj_id")) Then%>
190
					  <%isNewGroup = TRUE%>
191
					  <tr>
192
						<td nowrap colspan="5" class="body_row" bgcolor="F5F5F5"><%=LIMG_CONTROL  &  rsQry("obj_name")%></td>
193
			          </tr>
194
					  <%currObj_id = CInt(rsQry("obj_id"))%>
195
					  <%End If%>
196
 
197
					  <%Call SetPermissionCombos ( rsQry("role_id") &"_"& rsQry("obj_id"), _
198
					  							   isNewGroup, rsQry("is_role_variation"), _
199
												   isVisibleComboDisabled, isActiveComboDisabled, _
200
					  							   rsQry("visible_value"), rsQry("active_value"), _
201
												   VisibleCombo, ActiveCombo )%>
202
			          <tr>
203
					  	<td align="center"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
204
						<td nowrap class="body_row"><a href="Role_Privileges.asp?role_id=<%=rsQry("role_id")%><%=objPMod.ComposeURLWithout("role_id")%>" title="See this Role Permissions" class="body_link"><%If IsNull( rsQry("is_role_variation") ) Then%><%=LIMG_ROLE%><%Else%><%=LIMG_SPEC_ROLE%><%End If%><%=rsQry("role_name")%></a></td>
205
						<td nowrap class="body_row"><a href="Control_Privileges.asp?obj_id=<%=rsQry("obj_id")%><%=objPMod.ComposeURLWithout("obj_id")%>" title="See this Control Permissions" class="body_link"><%=LIMG_CONTROL  &  rsQry("obj_name")%></a></td>
206
						<td class="body_txt" nowrap background='images/bg_bage_pane.gif'>&nbsp;&nbsp;<%=VisibleCombo%>&nbsp;&nbsp;<%=ActiveCombo%>&nbsp;&nbsp;</td>
207
						<td class="body_rowg"></td>
208
			          </tr>
209
					  <%
210
					  isNewGroup = FALSE
211
					  rsQry.MoveNext
212
					  %>
213
 
214
			          <tr>
215
			            <td colspan="5" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
216
			          </tr>
217
					  <%
218
					  WEnd
219
 
220
					  OraDatabase.Parameters.Remove "USER_ID"
221
					  OraDatabase.Parameters.Remove "APP_ID"
222
					  %>
223
					  <tr>
224
					  	<td class="body_txt"></td>
225
						<td class="body_txt"></td>
226
						<td class="body_txt"></td>
227
						<td align="center" background='images/bg_bage_pane.gif'><input type="submit" name="btn" value="Apply" class="form_btn"></td>
228
						<td class="body_txt"></td>
229
			          </tr>
230
			          <tr>
231
			            <td colspan="5" background="images/bg_table_border.gif">
232
						 <table width="100%"  border="0" cellspacing="1" cellpadding="2">
233
			              <tr>
234
			                <td nowrap background="images/bg_table_col.gif"><img src="images/spacer.gif" width="1" height="1"></td>
235
			              </tr>
236
			             </table>
237
						</td>
238
			          </tr>
239
					 <%=objPMod.ComposeHiddenTags()%>
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"-->