Webqueryopen agent and redirection

My requirement is that I want only authorized users to open a form. I use the weqqueryopen agent to check if the user is authorized to open that form (using a lookup from some views) and based on the output I either open the form or need to show an error page to the user.

I am using the following in the webqueryopen agent to redirect, but this does not work

Print “[”+redirection_URL+“]”

Any ideas how I can achieve the above, I do not want in any way that it can be hacked…please help… thanks

Subject: Open the agent

Open the agent directly:

http://host/database/myagent?openagent

Calculate the authorization. Then use a Print statement in the agent to open the form or show the user the error page. (But what’s to prevent the user from just opening the form directly by entering its url?)

Subject: webqueryopen agent and redirection

Let’s see…

  1. Put all of the form elements on a subform (or more than one) and compute whether or not they show up. Use a meta or script redirect in computed text directly on the form.

  2. Do essentially the same thing, but with hide-whens.

  3. Use form security and Readers fields if the documents are to be similarly protected.

  4. Allow the form to be used only from a view that has restricted access. Form formulas in all other views would prevent the form from being used.

Note that none of these require an agent of any sort.