Manage Learn to apply best practices and optimize your operations.

Using A Secure $$Viewtemplatedefault

Usually you would create a "$$ViewTemplate for" for every accessible view in a
web environment. And then create a $$ViewTemplateDefault telling the user that
this "page" is not accessible to prevent users from opening standard views such
as ($All).
With this tip you do not have to create all these $$ViewTemplates but can use
the Default one and restrict access by using the view name. If the accessed
view is not for public use the user is redirected to the $$ReturnGeneralError
page.

Comments to the code:
Row 1. Check if the ViewName starts with a number. I have used this simple
method to determine if a view is public or not. You can check for explicit view
names if you wish. Returns "0" if not valid and any other number if valid.
Row 2. Set the URL to redirect to. I've used the $$ReturnGeneralError form for
this but you can customise to anything.

Row 3. The HTML code that will refresh the browser (frame) if tmpIsValid is a
number greater than 0.
Put this code in the $$HTMLHead field of the $$ViewTemplateDefault form.

tmpIsValid := @TextToNumber( "0" + @Left( @ViewTitle; 1));

tmpURL := "/" + @ReplaceSubstring( @Subset( @DbName; -1); " ":"\\"; "+":"/") +
"/$$ReturnGeneralError";

"&LThtml>&LThead>" +
@If( tmpIsValid > 0;
"";
"&LTMETA HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=" + tmpURL + "\">"
)+
"</head></html>"

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close