Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5354 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|                wRemoveFromApplication             |
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
<!--#include file="common/_user_common.asp"-->
18
<%
19
'------------ ACCESS CONTROL ------------------
20
%>
21
<!--#include file="_access_control_general.asp"-->
22
<%
23
'------------ VARIABLE DEFINITION -------------
24
Dim objFormCollector
25
'------------ CONSTANTS DECLARATION -----------
26
'------------ VARIABLE INIT -------------------
27
Set objFormCollector = CreateObject("Scripting.Dictionary")
28
'------------ CONDITIONS ----------------------
29
'----------------------------------------------
30
%>
31
<%
32
'--------------------------------------------------------------------------------------------------------------------------
33
Sub RemoveFromApplication ()
34
	On Error Resume Next
35
 
36
	OraDatabase.Parameters.Add "USER_ID_LIST", 	Request("user_id"), 	ORAPARM_INPUT, ORATYPE_VARCHAR2
37
	OraDatabase.Parameters.Add "APP_ID", 		Request("app_id"), 			ORAPARM_INPUT, ORATYPE_NUMBER
38
 
39
	objEH.TryORA ( OraSession )
40
 
41
		OraDatabase.ExecuteSQL "BEGIN   pk_User.Remove_Application_User ( :USER_ID_LIST, :APP_ID, NULL );   END;"
42
 
43
	objEH.CatchORA ( OraSession )
44
 
45
	OraDatabase.Parameters.Remove "USER_ID_LIST"
46
	OraDatabase.Parameters.Remove "APP_ID"
47
 
48
End Sub
49
'--------------------------------------------------------------------------------------------------------------------------
50
Sub DisplayApplicationCombo()
51
	Dim rsQry, sqlStr
52
 
53
	OraDatabase.Parameters.Add "USER_ID", 	Request("user_id"),	ORAPARM_INPUT, ORATYPE_NUMBER
54
 
55
	sqlStr = "SELECT ua.app_id, ap.application_name FROM applications ap, user_applications ua " &_
56
					 "WHERE ap.app_id = ua.app_id  AND ua.user_id = :USER_ID"
57
 
58
	Set rsQry = OraDatabase.DbCreateDynaset( sqlStr, cint(0))
59
 
60
		If rsQry.BOF OR rsQry.EOF Then
61
			Response.write "<option value='-1' selected>No Applications Available</option>"& VBNewLine
62
		Else
63
			Response.write "<option class='body_txt' selected value='"& rsQry("app_id") &"'>"& rsQry("application_name") &"</option>"& VBNewLine
64
			rsQry.MoveNext
65
		End If
66
 
67
    While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
68
 
69
		Response.write "<option class='body_txt' value='"& rsQry("app_id") &"'>"& rsQry("application_name") &"</option>"& VBNewLine
70
 
71
		rsQry.MoveNext
72
    WEnd
73
 
74
	' Clean up
75
	rsQry.Close()
76
	Set rsQry = nothing
77
 
78
	OraDatabase.Parameters.Remove "USER_ID"
79
 
80
End Sub
81
'--------------------------------------------------------------------------------------------------------------------------
82
%>
83
<%
84
'------------ RUN BEFORE PAGE RENDER ----------
85
Call GetUserDetails ( parUser_id, objUserCollector )
86
 
87
If Request("action") <> "" AND Request("app_id") <> "-1" Then
88
 
89
		Call RemoveFromApplication()
90
 
91
		If objEH.Finally Then
92
			Call OpenInParentWindow ( Request("rfile") &"?"& objPMod.ComposeURLWith("user_id,tree") )
93
			Call CloseWindow()
94
		End If
95
 
96
End If
97
'----------------------------------------------
98
%>
99
<html>
100
<head>
101
<title>Access Manager</title>
102
<link rel="shortcut icon" href="<%=FavIcon%>"/>
103
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
104
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
105
<link href="scripts/access_manager.css" rel="stylesheet" type="text/css">
106
<script language="JavaScript" src="scripts/common.js"></script>
107
</head>
108
 
109
<body background="images/bg_bage_pane.gif" leftmargin="0" topmargin="0" onLoad="self.focus();">
110
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
111
  <tr>
112
    <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="images/i_application_lrg.gif" width="18" height="18" hspace="0" align="absmiddle" border="0" >&nbsp;Remove Application User</span> <br>
113
    Select application name. 
114
    </td>
115
  </tr>
116
  <form name="FormName" method="post" action="<%=SCRIPT_NAME%>">
117
  <tr>
118
    <td background="images/bg_drk_bage_pane.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
119
      <tr>
120
        <td>&nbsp;</td>
121
        <td align="right"><input name="btn" type="submit" class="form_btn" value="Remove" onClick="return confirmAction('Are you sure you want to remove this user from this application?');">
122
          <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();"></td>
123
      </tr>
124
    </table></td>
125
  </tr>
126
 
127
  <tr>
128
    <td background="images/bg_form.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
129
      <tr>
130
        <td width="1%"><img src="images/spacer.gif" width="60" height="200"></td>
131
        <td width="100%"><table width="100%"  border="0" cellspacing="2" cellpadding="0">
132
          <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
133
          <%If NOT objEH.Finally Then%>
134
          <tr>
135
            <td class="form_iname">&nbsp;</td>
136
            <td>
137
              <%objEH.DisplayMessage()%>
138
            </td>
139
          </tr>
140
          <%End If%>
141
          <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
142
          <tr>
143
						<td colspan="2" class="body_ttl3">Remove <%=objUserCollector("full_name")%> from Application:</td>
144
          </tr>
145
          <tr>
146
						<td><img src="images/spacer.gif" height="10"></td>
147
          </tr>
148
          <tr>
149
						<td nowrap class="form_iname" valign="top">Application Name</td>
150
						<td valign="top" align="left">
151
							<select name='app_id' class='form_iname'>
152
								<%Call DisplayApplicationCombo()%>
153
							</select>
154
						</td>
155
          </tr>
156
          <tr>
157
            <td width="30%" class="form_iname">&nbsp;</td>
158
            <td width="70%">&nbsp;</td>
159
          </tr>
160
        </table></td>
161
      </tr>
162
    </table></td>
163
  </tr>
164
  <%=objPMod.ComposeHiddenTags()%>
165
  <input type="hidden" name="action" value="true">
166
  </form>
167
</table>
168
</body>
169
</html>
170
<%
171
'------------ RUN AFTER PAGE RENDER -----------
172
Set objFormCollector = Nothing
173
'----------------------------------------------
174
%>
175
<!--#include file="common/globals_destructor.asp"-->