Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
6240 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'   Masquerade Screen
5
'   Masquerade as another user
6
'   Aquire the permission of another user
7
'   An Administration type of function useful for proving the capabilities of a user
8
'=====================================================
9
%>
10
<%
11
Option explicit
12
Response.Expires = 0
13
%>
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/qstr.asp"-->
17
<!--#include file="common/common_subs.asp"-->
18
<!--#include file="_access_control_general.asp"-->
19
<%
20
'------------ VARIABLE DEFINITION -------------
21
Dim canMasquerade
22
'------------ CONSTANTS DECLARATION -----------
23
'------------ VARIABLE INIT -------------------
24
canMasquerade = canActionControl("Masquerade")
25
'------------ CONDITIONS ----------------------
26
'----------------------------------------------
27
%>
28
<%
29
'----------------------------------------------------------------------------------------------------------------------------------------------
30
Sub Logon ()
31
	On Error Resume Next
32
 
33
	objEH.Try()
34
 
35
	Call objAccessControl.MasqueradeAsUser ( Request("user_name"), objAccessControl.UserName )
36
 
37
	objEH.Catch()
38
 
39
End Sub
40
'----------------------------------------------------------------------------------------------------------------------------------------------
41
Sub AccessManagerMessage ( nMessage )
42
	Dim sMessage
43
	On Error Resume Next
44
 
45
	objEH.Try()
46
		Select Case CInt( nMessage )
47
			Case 1
48
				Err.Raise 8, _
49
					"Application Access Denied !", "Please contact the <a href='mailto:"& ADMIN_EMAIL &"' class='body_link'>Administrator</a> to gain access to this application."
50
			Case 2
51
				Err.Raise 8, _
52
					"Page Access Denied !", "Please contact the <a href='mailto:"& ADMIN_EMAIL &"' class='body_link'>Administrator</a> to gain access to this page."
53
			Case 3
54
				Err.Raise 8, _
55
					"Application is Off-Line !", "This application is currently off-line for maintenance. <br>Contact the <a href='mailto:"& ADMIN_EMAIL &"' class='body_link'>Administrator</a> for further details."
56
 
57
			Case 4
58
				Err.Raise 8, _
59
					"You are Not Authorised !", "You are not authorised to perform this action. <br>Contact the <a href='mailto:"& ADMIN_EMAIL &"' class='body_link'>Administrator</a> for further details."
60
 
61
		End Select
62
	objEH.Catch()
63
 
64
End Sub
65
'----------------------------------------------------------------------------------------------------------------------------------------------
66
%>
67
<%
68
'------------ RUN BEFORE PAGE RENDER ----------
69
objPMod.PersistInQryString ( aPersistList )
70
 
71
If NOT canActionControl("Masquerade") Then
72
    Call RaiseMsg(enum_WMSG_ERROR, "Access Denied to this function.<p>One a user has switched roles the Masquerading function may not be available.")
73
End If
74
 
75
' --- RUN onPostBack ---
76
If CBool(Request("action")) Then
77
 
78
	Call Logon ()
79
 
80
	If objEH.Finally Then
81
		If Request("rfile") <> "" Then
82
			Call OpenInWindow ( Request("rfile") &"?LOGIN=ok"& objPMod.ComposeURLWithout("rfile") )
83
		Else
84
			Call OpenInWindow ( "index.asp" )
85
		End If
86
 
87
	End If
88
End If
89
 
90
' Display Access Manager messages 
91
'
92
Call AccessManagerMessage( Request("message") )
93
 
94
'----------------------------------------------
95
%>
96
<html>
97
<head>
98
<title>Release Manager</title>
99
<link rel="shortcut icon" href="<%=FavIcon%>"/>
100
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
101
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
102
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
103
<link rel="stylesheet" href="images/navigation.css" type="text/css">
104
<script language="JavaScript" src="images/common.js"></script>
105
<!--#include file="_jquery_includes.asp"-->
106
</head>
107
<body leftmargin="0" topmargin="0" onLoad="FormName.user_name.focus();">
108
<!-- HEADER ++++++++++++++++ -->
109
<!--#include file="_header.asp"-->
110
<!-- +++++++++++++++++++++++ -->
111
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
112
<form name="FormName" method="post" action="<%=ScriptName%>" >
113
  <tr>
114
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="42"></td>
115
  </tr>
116
  <tr>
117
    <td align="center" valign="middle" bgcolor="#FFFFFF">
118
	<!-- LOGIN FROM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
119
    <table width="570" border="0" cellspacing="0" cellpadding="0">
120
      <tr>
121
        <td align="right">
122
            <a href="<%=ACCESS_MANAGER_URL%>" title="Access Manager Home">
123
                <img src="icons/img_auth_by_access_manager.gif" width="103" height="26" hspace="2" vspace="3" border="0">
124
            </a>
125
        </td>
126
      </tr>
127
    </table>
128
      <table width="570" border="0" cellspacing="0" cellpadding="1">
129
        <tr>
130
          <td background="images/bg_bage_2.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
131
            <tr>
132
              <td bgcolor="#FFFFFF"><table width="100%"  border="0" cellspacing="0" cellpadding="10">
133
                <tr>
134
                  <td class="body_txt"><span class="body_h1">
135
                    <img src="icons/i_user_lrg.gif" width="13" height="17" align="absmiddle">
136
                    &nbsp;Masquerade as another user</span> <br>
137
                    Please enter a Username <br>
138
                    <hr width="100%" size="1" noshade color="#ACA899">
139
                </tr>
140
                <tr>
141
                  <td align="center" valign="top">
142
				  <table width="100"  border="0" cellspacing="2" cellpadding="0">
143
                      <tr>
144
                        <td width="10%" nowrap class="form_iname">Username</td>
145
                        <td width="1%"><input name="user_name" type="text" class="form_item" size="20"></td>
146
                      </tr>
147
                      <tr>
148
                        <td nowrap class="form_iname" valign="top">&nbsp;</td>
149
                        <td valign="top">&nbsp;</td>
150
                      </tr>
151
                  </table></td>
152
                </tr>
153
                <tr>
154
                  <td background="images/bg_login.gif">
155
				  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
156
                      <tr>
157
                        <td><%=ProgressBar()%></td>
158
                        <td align="right">
159
                            <input name="btn" type="submit" class="form_btn" value="Login" onclick="MM_validateForm('user_name','Username','R');return document.MM_returnValue"></td>
160
                      </tr>
161
                  </table></td>
162
                </tr>
163
              </table>
164
			  </td>
165
            </tr>
166
          </table></td>
167
        </tr>
168
      </table>
169
	  <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
170
	  </td>
171
  </tr>
172
  <tr>
173
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="42"></td>
174
  </tr>
175
<%=objPMod.ComposeHiddenTags()%>
176
<input type="hidden" name="action" value="true">
177
</form>  
178
</table>
179
<!-- FOOTER -->
180
<!--#include file="_footer.asp"-->
181
</body>
182
</html>