Manage Learn to apply best practices and optimize your operations.

LotusScript Code To Prevent Users from Using ?Openagent

The following piece of LotusScript code at the start of the agent will prevent users from invoking the ?OpenAgent action URL directly.

Set session = New NotesSession
Set docContext = session.DocumentContext
REM -------------------------------------
REM Don?t allow invocation of this agent from just any HTTP
REM Referrer. The referrer must be from our server.
REM --------------------------------------
If Not(Instr(1, Ucase(docContext.HTTP_Referer(0)),
Ucase(docContext.Server_Name(0))) > 0) And _
Not(Instr(1, Ucase(docContext.HTTP_Referer(0)),
Ucase(docContext.HTTP_HOST(0))) > 0) Then
Print {<H1>Error</H1>Unauthorized Exception<P><HR>}
Print {</BODY></HTML>}
Exit Sub
End If

Dig Deeper on Domino Resources - Part 6



  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury