LogonForm.csp

To download the CSP files from this tutorial, click TutorialSamples.zip. For more information, see Code examples.


<% @language=JavaScript %>

<link REL=STYLESHEET TYPE='text/css' HREF='tut.css'>

<HTML>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">

<!-- #include file=helper_js.csp -->

<BODY>

<H1>Logon Page</H1>

<%

//Retrieve the APS to which to connect.

var APS;

APS = Request.ServerVariables.Item("WCS_NAME_SERVER");

Response.Write ("APS: " + APS + "<BR>");

Response.Write ("<FORM Name=logonForm Action='Logon.csp?APS=" + APS + "' Target='_top' Method=POST>");

%>


User Name <BR>

<INPUT Type=text Size=30 Name="UserID" Value="">


<P>Password <BR>

<INPUT Type=password Size=30 Name="Password" Value="">


<P>Authentication Type <BR>

<SELECT Name="Aut">

<OPTION Value="secEnterprise">Enterprise

<OPTION Value="secWindowsNT">Windows NT

</SELECT>


<P><INPUT Name=sa Type=submit Value="Logon">

</FORM>

</BODY>

</HTML>



Remarks

You do not need to prompt the users for the name of their APS. Instead, this name should be returned from the Web Component Server (WCS) through the WCS_NAME_SERVER server variable.

APS = Request.ServerVariables.Item("WCS_NAME_SERVER");

This insures that the user is logging on to a cluster that the WCS is registered with. If the user logs on to a server that is outside this cluster, communication will not occur between the WCS and the APS.

Name

Each of the controls must have a Name to identify itself. The following code snippet illustrates this.

<input type=text size=30 name="UserID" value="">

These names are needed in order to retrieve the values at a later stage.

Action

The logon form includes an Action.

<FORM name=logonForm action='Logon.csp?APS="& APS &"' target='_top' method=POST>.

The action is to load the file Logon.csp and post the APS name and the values of the text boxes to this page. The Logon.csp page is where the authentication and logon script will be placed to log a user on to the Crystal Enterprise system. Writing this page is your next step. Note that in a fashion similar to ASP, the Logon.csp page is given an argument APS, which will be retrieved in this page by the Request.QueryString method. The argument is indicated by the question mark symbol in the URL string, and is the name of the APS to which the user will log on. This will be discussed in more detail later on in the tutorial.

Go to next step:

Authenticating and logging on the user



Crystal Decisions, Inc.
http://www.crystaldecisions.com
Support services:
http://support.crystaldecisions.com