RAD Studio
ContentsIndex
PreviousUpNext
Setting Pages to Require Logins

Once you have a working login page, you must require logins for those pages which need controlled access. The easiest way to have a page require logins is to design that requirement into the page. When you first create a Web page module, check the Login Required box in the Page section of the New WebSnap Page Module dialog box. 

If you create a page without requiring logins, you can change your mind later.

To require logins after a Web page module has been created:

  1. Open the source code file associated with the Web page module in the editor.
  2. Scroll down to the implementation section. In the parameters for the WebRequestHandler.AddWebModuleFactory command, find the creator of the TWebPageInfo object. It should look like this:

TWebPageInfo.Create([wpPublished {, wpLoginRequired}], '.html')

  1. Uncomment the wpLoginRequired portion of the parameter list by removing the curly braces. The TWebPageInfo creator should now look like this:

TWebPageInfo.Create([wpPublished , wpLoginRequired], '.html')

 

static TWebPageInit WebInit(__classid(TAdapterPageProducerPage3), crOnDemand, caCache, PageAccess << wpPublished << wpLoginRequired, ".html", "", "", "", "");

To remove the login requirement from a page, reverse the process and recomment the wpLoginRequired portion of the creator.

Note: You can use the same process to make the page published or not. Simply add or remove comment marks around the wpPublished portion as needed.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!