<%@LANGUAGE="VBSCRIPT"%> <% '===================================================== ' Masquerade Screen ' Masquerade as another user ' Aquire the permission of another user ' An Administration type of function useful for proving the capabilities of a user '===================================================== %> <% Option explicit Response.Expires = 0 %> <% '------------ VARIABLE DEFINITION ------------- Dim canMasquerade '------------ CONSTANTS DECLARATION ----------- '------------ VARIABLE INIT ------------------- canMasquerade = canActionControl("Masquerade") '------------ CONDITIONS ---------------------- '---------------------------------------------- %> <% '---------------------------------------------------------------------------------------------------------------------------------------------- Sub Logon () On Error Resume Next objEH.Try() Call objAccessControl.MasqueradeAsUser ( Request("user_name"), objAccessControl.UserName ) objEH.Catch() End Sub '---------------------------------------------------------------------------------------------------------------------------------------------- Sub AccessManagerMessage ( nMessage ) Dim sMessage On Error Resume Next objEH.Try() Select Case CInt( nMessage ) Case 1 Err.Raise 8, _ "Application Access Denied !", "Please contact the Administrator to gain access to this application." Case 2 Err.Raise 8, _ "Page Access Denied !", "Please contact the Administrator to gain access to this page." Case 3 Err.Raise 8, _ "Application is Off-Line !", "This application is currently off-line for maintenance.
Contact the Administrator for further details." Case 4 Err.Raise 8, _ "You are Not Authorised !", "You are not authorised to perform this action.
Contact the Administrator for further details." End Select objEH.Catch() End Sub '---------------------------------------------------------------------------------------------------------------------------------------------- %> <% '------------ RUN BEFORE PAGE RENDER ---------- objPMod.PersistInQryString ( aPersistList ) If NOT canActionControl("Masquerade") Then Call RaiseMsg(enum_WMSG_ERROR, "Access Denied to this function.

One a user has switched roles the Masquerading function may not be available.") End If ' --- RUN onPostBack --- If CBool(Request("action")) Then Call Logon () If objEH.Finally Then If Request("rfile") <> "" Then Call OpenInWindow ( Request("rfile") &"?LOGIN=ok"& objPMod.ComposeURLWithout("rfile") ) Else Call OpenInWindow ( "index.asp" ) End If End If End If ' Display Access Manager messages ' Call AccessManagerMessage( Request("message") ) '---------------------------------------------- %> Release Manager <%=objPMod.ComposeHiddenTags()%>
 Masquerade as another user
Please enter a Username

Username