Subversion Repositories DevTools

Rev

Rev 5354 | Rev 6049 | 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
'|				          Default					 |
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 rsUser
24
'Dim objBtnControl
25
'Dim aTabBtnsDef
26
'------------ CONSTANTS DECLARATION -----------
27
'------------ VARIABLE INIT -------------------
28
'Set objBtnControl = New ActionButtonControl
29
'------------ CONDITIONS ----------------------
30
'----------------------------------------------
31
%>
32
<%
33
'------------ RUN BEFORE PAGE RENDER ----------
34
objPMod.PersistInQryString ("tree")
35
'----------------------------------------------
36
%>
37
<%
38
If (Request("action") <> "") Then
39
	'-- Select Action
40
 
41
	Select Case Request("action")
42
		Case "btnRemoveAccount"
43
			Call OpenInWindow ( "_RemoveUserAccount.asp?user_id_list="& Request("user_id_list") &"&rfile="& SCRIPT_NAME &"&"& objPMod.ComposeURL() )
44
	End Select
45
 
46
End If
47
%>
48
<html>
49
<head>
50
<title>Access Manager</title>
51
<link rel="shortcut icon" href="<%=FavIcon%>"/>
52
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
53
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
54
<link href="scripts/access_manager.css" rel="stylesheet" type="text/css">
55
<script language="JavaScript" src="scripts/common.js"></script>
56
 
57
</head>
58
 
59
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
60
<!-- HEADER ++++++++++++++++++++++ -->
61
<!--#include file="_header.asp"-->
62
<!-- +++++++++++++++++++++++++++++ -->
63
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
64
  <tr>
65
    <td width="1%" valign="top" background="images/bg_bage_pane.gif">
66
	<!-- TREE NAVIGATOR ++++++++++++++++++++++++++++++++++++++++++++ -->
67
	<!--#include file="_treeNavigator.asp"-->  
68
	<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
69
	</td>
70
    <td width="1" background="images/bg_drk_gray_border.gif"><img src="images/spacer.gif" width="1" height="600"></td>
71
    <td width="100%" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="9">
72
	<form name="FormName" method="post" action="<%=SCRIPT_NAME%>">
73
      <tr>
74
        <td background="images/bg_drk_bage_pane.gif">
75
		  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
76
 
77
            <tr>
78
              <td nowrap class="body_txt">
79
			    <!-- BUTTONS CONTROL +++++++++++++++++++ -->
80
				<%
81
				'-- Define Action buttons on this tab
82
				aTabBtnsDef = Array("btnNewAccount", "btnRemoveAccount", "height=14", "btnDisableAccount" )
83
 
84
				Call LoadTabActionButtons ( aTabBtnsDef, objBtnControl )
85
				If  NOT canActionControl("canCreateUser") Then objBtnControl.AllActive = "N"
86
 
87
				objBtnControl.Render( aTabBtnsDef )
88
				%>
89
				<!-- +++++++++++++++++++++++++++++++++++ -->
90
			  </td>
91
              <td align="right" nowrap class="section_ttl">User Accounts</td>
92
            </tr>
93
          </table>
94
		</td>
95
      </tr>
96
      <tr>
97
        <td>
98
		<%
99
		Dim startPosition, pageNumber, navigator, totalRecords, lastRecord
100
		Const MAX_ROWS = 50	' Maximum number of rows displayed
101
 
102
		'--- Set filters ---
103
		If Request("filter") <> "" Then
104
			OraDatabase.Parameters.Add "FULL_NAME", 	"%"& Request("filter") &"%",	ORAPARM_INPUT, ORATYPE_VARCHAR2
105
			OraDatabase.Parameters.Add "USER_NAME", 	Request("filter") &"%",			ORAPARM_INPUT, ORATYPE_VARCHAR2
106
			OraDatabase.Parameters.Add "DOMAIN_NAME", 	Request("filter") &"%",			ORAPARM_INPUT, ORATYPE_VARCHAR2
107
		Else
108
			OraDatabase.Parameters.Add "FULL_NAME", 	NULL,	ORAPARM_INPUT, ORATYPE_VARCHAR2
109
			OraDatabase.Parameters.Add "USER_NAME", 	NULL,	ORAPARM_INPUT, ORATYPE_VARCHAR2
110
			OraDatabase.Parameters.Add "DOMAIN_NAME", 	NULL,	ORAPARM_INPUT, ORATYPE_VARCHAR2
111
		End If
112
 
113
 
114
		Set rsUser = OraDatabase.DbCreateDynaset( GetQuery ("GetUserList.sql") , ORADYN_DEFAULT )
115
 
116
		'--- Get page number ---
117
		pageNumber = 0
118
		If Request("pg") <> "" Then 
119
		pageNumber = CInt(Request("pg"))
120
		End If
121
 
122
 
123
		'--- Set Cursor start position ---
124
		startPosition = pageNumber * MAX_ROWS + 1
125
		If (NOT rsUser.BOF) AND (NOT rsUser.EOF) Then
126
			rsUser.MoveTo ( startPosition )		' Set starting cursor point
127
 
128
		End If
129
 
130
 
131
		'--- Construct Navigator
132
		navigator = ""
133
		If (NOT rsUser.BOF) AND (NOT rsUser.EOF) Then
134
			totalRecords = rsUser.RecordCount	' Get total number of records
135
 
136
			'--- Create "Previous" link
137
			If pageNumber > 0 Then
138
				navigator = navigator &"<a href='"& SCRIPT_NAME &"?pg="& pageNumber - 1 &"&"& objPMod.ComposeURL &"' class='body_link' title='Show Previous Page'>&laquo; Previous</a>"
139
			End If
140
 
141
			'--- Create "Next" link
142
			If ( startPosition + MAX_ROWS ) < totalRecords Then
143
				navigator = navigator &"&nbsp;&nbsp;<a href='"& SCRIPT_NAME &"?pg="& pageNumber + 1 &"&"& objPMod.ComposeURL &"' class='body_link' title='Show Next Page'>Next &raquo;</a>"
144
			End If
145
 
146
		End If
147
 
148
 
149
		'--- Calculate Last Record ---
150
		If totalRecords > 0 Then
151
			lastRecord = ( startPosition - 1 + MAX_ROWS ) _
152
						+ ( CInt( ( startPosition - 1 + MAX_ROWS )/totalRecords > 1) ) * ( ( startPosition - 1 + MAX_ROWS ) - totalRecords )
153
		End If
154
		%>
155
		<table width="100%"  border="0" cellspacing="0" cellpadding="0">
156
		<%If Request("updated") = "ok" Or Request("removed") = "ok" Then%>
157
          <tr>
158
            <td colspan="9" align="center" class="notification_row">
159
                <%
160
                If Request("updated") = "ok" Then
161
                    Response.Write("User Account Details Updated Successfully")
162
                Else
163
                    Response.Write("User Account(s) Removed Successfully")
164
                End If
165
                %>
166
            </td>
167
          </tr>
168
        <%End If%>  
169
          <tr>
170
            <td align="left" class="body_row">
171
			<%
172
			If totalRecords > 0 Then 
173
				Response.write "Showing "& startPosition &" - "& lastRecord &" of "& totalRecords
174
			Else
175
				Response.write "No Results."
176
			End If
177
			%></td>
178
            <td align="right" class="body_scol"><%=navigator%></td>
179
          </tr>
180
        </table>          
181
		 <!-- DETAILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
182
		 <table width="100%"  border="0" cellspacing="3" cellpadding="0">
183
          <tr>
184
		  	<td width="1%" background="images/bg_table_col.gif"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
185
            <td width="1%" background="images/bg_table_col.gif"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
186
            <td width="30%" background="images/bg_table_border.gif">
187
			<table width="100%"  border="0" cellspacing="1" cellpadding="2">
188
              <tr>
189
                <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Full Name </td>
190
              </tr>
191
            </table></td>
192
            <td width="25%" align="left" nowrap background="images/bg_table_col.gif" class="body_col">Email</td>
193
            <td width="25%" align="left" nowrap background="images/bg_table_col.gif" class="body_col">User Name</td>
194
            <td width="20%" align="left" nowrap background="images/bg_table_col.gif" class="body_col">Domain</td>
195
			<td width="1%" align="left" nowrap background="images/bg_table_col.gif" class="body_col">Last Request</td>
196
			<td width="1%" align="center" nowrap background="images/bg_table_col.gif" class="body_colhead">Edit</td>
197
			<td width="1%" align="center" nowrap background="images/bg_table_col.gif" class="body_colhead">Roles</td>
198
          </tr>
199
		  <%
200
		  '--- Render rows ---
201
		  Do While (NOT rsUser.BOF) AND (NOT rsUser.EOF)
202
		  		If rsUser.RowPosition => (startPosition + MAX_ROWS) Then Exit Do	' Limit the number of rows displayed
203
		  %>
204
          <tr>
205
		  	<td align="center"><input type="checkbox" name="user_id_list" value="<%=rsUser("user_id")%>"></td>
206
            <td align="center"><%=UserOnlineIcon ( rsUser("user_online"), rsUser("last_request") )%></td>
207
            <td nowrap class="body_row"><a href="User_General.asp?user_id=<%=rsUser("user_id")%>&<%=objPMod.ComposeURL%>" class="body_link"><%=Eval( rsUser("user_image") )  &  rsUser("full_name")%></a></td>
208
            <td nowrap><a href="mailto:<%=rsUser("user_email")%>" class="body_link"><%=rsUser("user_email")%></a></td>
209
            <td class="body_rowg"><%=rsUser("user_name")%></td>
210
            <td class="body_rowg"><%=rsUser("domain")%></td>
211
			<td class="body_rowg" nowrap><%=LastRequest ( rsUser("last_request") )%></td>
212
			<td align="center">
213
            <% If canActionControl("canEditUserDetails") Then%>
214
                <a href="javascript:;" onClick="MM_openBrWindow('wEditAccount.asp?user_id=<%=rsUser("user_id")%>&rfile=<%=SCRIPT_NAME%>&<%=objPMod.ComposeURL%>','EditAccount','scrollbars=yes,resizable=yes,width=600,height=350')"><%=LIMG_EDIT%></a>
215
            <%Else%>
216
                <%=LIMG_EDIT_OFF%>   
217
            <%End If%>
218
            </td>
219
			<td align="center"><a href="User_Roles.asp?user_id=<%=rsUser("user_id")%>&<%=objPMod.ComposeURL%>" title="See User Roles"><%=LIMG_ROLE%></a></td>
220
          </tr>
221
		  <%rsUser.MoveNext%>
222
 
223
		  <%If (NOT rsUser.BOF) AND (NOT rsUser.EOF) Then%>
224
          <tr>
225
            <td colspan="9" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
226
          </tr>
227
		  <%End If%>
228
 
229
		  <%
230
		  Loop
231
 
232
 
233
		  OraDatabase.Parameters.Remove "FULL_NAME"
234
		  OraDatabase.Parameters.Remove "USER_NAME"
235
		  OraDatabase.Parameters.Remove "DOMAIN_NAME"
236
 
237
		  rsUser.Close()
238
		  Set rsUser = Nothing
239
		  %>
240
          <tr>
241
            <td colspan="9" background="images/bg_table_border.gif">
242
			 <table width="100%"  border="0" cellspacing="1" cellpadding="2">
243
              <tr>
244
                <td nowrap background="images/bg_table_col.gif"><img src="images/spacer.gif" width="1" height="1"></td>
245
              </tr>
246
             </table>
247
			</td>
248
          </tr>
249
         </table>	 
250
		 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
251
		 <table width="100%"  border="0" cellspacing="0" cellpadding="0">
252
          <tr>
253
            <td align="right" class="body_scol"><%=navigator%></td>
254
          </tr>
255
        </table>
256
         <br></td>
257
      </tr>
258
	  <%=objPMod.ComposeHiddenTags()%>
259
	  <input type="hidden" name="action" value="true">
260
	</form>
261
    </table></td>
262
  </tr>
263
</table>
264
<!-- FOOTER ++++++++++++++++++++++ -->
265
<!--#include file="_footer.asp"-->
266
<!-- +++++++++++++++++++++++++++++ -->
267
</body>
268
</html>
269
<%
270
'------------ RUN AFTER PAGE RENDER -----------
271
'----------------------------------------------
272
%>
2 rsolanki 273
<!--#include file="common/globals_destructor.asp"-->