Enabling Membership on a Site Builder Wizard Site (with Late Registration)
September 1999
Microsoft Corporation
Introduction
You can use the Site Builder Wizard (SBW) to create a copy of a sample site or to create a custom site containing only the options you want. The SBW generates all the files and database tables for the new site and saves them on the server. It can even generate sample data and load it into the database. The sample script files are located in the \ResKit\Code\Membership\WizGen folder of the root Resource Kit directory after you download and install the Site Server 3.0 Commerce Edition Resource Kit.
When you enable Membership features on a Site Builder Wizard site, you can register the users of your site and manage user data, protect and share user data, verify users’ identities, and control access to content on your site. Membership provides the basis for your site’s delivery of personalized content to your users.
When users are registered, their names and attributes are listed in the Membership Directory. Registered users can view content that is personalized according to their attributes. They can be put into groups and given selective access to all the varieties of protected information. The registered user’s name and password or client certificate authenticate the user upon logon.
Before you begin the procedure described in this paper, you should know how to:
- Create a new Membership Server from Microsoft® Management Console (MMC).
For information, see "Membership Features", "Creating Membership Servers," and "To add a Membership Server to an Existing Membership Directory" in the Site Server 3.0 Commerce Edition documentation.
- Create a new Web site using the New Web Site Wizard.
For information, see "To Create a Virtual Web Site" in the Site Server 3.0 Commerce Edition documentation.
- Map a Web site to a server.
For information, see "Mapping Application Servers to Membership Servers" and "To Map an Application Server to a Membership Server from MMC" in the Site Server 3.0 Commerce Edition documentation.
- Create an SQL database.
For information, see "To Create the SQL Database", "Creating the Database," and "Preparing the Database" in the Site Server 3.0 Commerce Edition documentation.
- Create a Data Source Name (DSN).
For information, see "To Create a System Data Source Name" in the Site Server 3.0 Commerce Edition documentation.
- Create a new Commerce site foundation using the Site Foundation Wizard (SFW).
For information, see "Creating the Site Foundation" in the Site Server 3.0 Commerce Edition documentation.
- Create a new group in the Membership Directory.
For information, see "Creating and Deleting Groups in the Membership Directory" and "To Create a New Group from MMC" in the Site Server 3.0 Commerce Edition documentation.
- Enable Membership Authentication.
For information, see "Authentication" and "Managing Authentication" in the Site Server 3.0 Commerce Edition documentation.
Note All names for directories, passwords, Web sites, servers, groups, and so on, must be typed exactly as shown because they are hard-coded in files within the site’s \Manager folder.
This paper describes how to:
Create a Complete Web Site
First, you must create a complete Web site.
To create a new membership server using the New Membership Server Wizard
- In MMC, select Personalization and Membership and right-click the computer node to which you want to add the server.
- Click New.
- Click Membership Server Instance.
- Type CommerceServer as the Membership Directory Name.
- Type password for the administrator’s password.
- Accept the LDAP port specified by the wizard. In this example, the port number is 1005 and is hard-coded in the site’s \Manager folder. If you select a different port number, make sure that you replace 1005 with that number.
- Accept the defaults for other settings.
- Rename this Membership Server instance as SBW Membership Server.
- Create and name a new folder (for example: C:\Whitepaper2\Sites). If necessary, substitute the drive letter that contains your Site Server installation for C:\.
To create a new group in the Membership Directory Service
- Using MMC, select Membership Directory Manager and right-click Properties to point to the LDAP port number specified earlier (1005).
- Select Logon Anonymously when prompted for authentication.
- Right click ou=groups.
- Click New, and then click group to create a new group.
- Type latereg to name the new group.
- Accept all other defaults.
To create a new Web site
- Using MMC, select Internet Information Server and right-click the node of the computer to which you want to add the Web site.
- Click New.
- Click Web Site.
- Type SBW in the Web Site Description field.
- Set the HTTP port number to an unused port (for example, 6001).
- Set the home directory to the new folder you created earlier (C:\Whitepaper2\Sites).
- Accept all other defaults.
To start the Web site
- Using MMC, select Internet Information Server, and open the node of the computer that contains the Web site.
- Right-click SBW.
- Click Start.
To map this Web site to the SBW Membership Server
- Using MMC, select Internet Information Server, and open the node of the computer that contains the Web site.
- Right-click SBW.
- Click All Task.
- Select Membership Server Mapping.
- From the drop-down box, select SBW Membership Server.
To set up the database
- Using SQL Enterprise Manager, make sure that SQL Server is running.
If SQL Server is running, the icon in the Server Manager window displays a green light.
If SQL Server isn’t running, right-click the name of the SQL Server computer, and then click Start on the shortcut menu.
- Create a new SQL Server database.
- Create a Data Source Name (DSN) for the database by clicking the Start menu.
- Click Settings.
- Click Control Panel.
- Double-click the ODBC icon.
To create a new Commerce site foundation using the Site Foundation Wizard
- Using MMC, right-click the node of the computer to which you want to add the foundation.
- Click New.
- Click Commerce Site Foundation.
- Select the SBW Web site on which to create the foundation.
- Type administrator as the account name to use for accessing the Membership Directory.
- Type password as the account password.
- Type SBW_final as the Short Name and Display Name for the site.
- Select the Data Source Name (DSN) you created earlier as the data source.
- Click Finish.
To create a site manager member in the Membership Directory using the New User Wizard
- In the Membership Directory Manager, right-click ou=Members.
- Click New, and then click User.
- Type sbwAdmin to name the new user.
- Add the user password attribute for this member and type password as the account password.
- On the final page of the New User Wizard, add the user to the SBW_final_# group (# is the Web site instance number of the Web site on which the SBW_final site was created).
To finish building the site
- On the Finish page of the Site Foundation Wizard, click the Site Builder Wizard link. Or, point your browser to http://Localhost:6001/Final/Manager/Default.asp.
- Type administrator to log in.
- Type password as the password.
- Start the Commerce Site Builder Wizard.
- Select Registration when Ordering on the Features page of the Site Builder Wizard (page 7 of 14).
- On the final screen of the Site Builder Wizard (page 14 of 14), select Load Schema into Database and Load Sample Data into Database.
- Go to http://Host_name:6001/SBW_final/Default.asp (in which Host_name is the name of the local server) to browse the store and ensure that everything works as planned.
Change the Registration Pages
You should have five folders, named FolderA through FolderE, in the directory in which you extracted the downloaded file. You need to replace the files in \SBW_final with the files in those folders.
FolderA Files
First, replace the files in \SBW_final with the corresponding files in FolderA.
To replace the files in the \SBW_final folder with the files in FolderA
- Copy the following files from FolderA to the \SBW_final folder:
Shopper_new.asp
Shopper_update.asp
Shopper_lookup.asp
- Click Yes to replace the existing files in the \SBW_final folder.
You must edit Shopper_lookup.asp to prompt for User Name instead of Email (because Membership uses the user name instead of the e-mail name to identify a user).
To edit Shopper_lookup.asp
- Change the text on line 176 from:
<TD COLSPAN="2">If you are a returning shopper, please provide your email and password.</TD>
To:
<TD COLSPAN="2">If you are a returning shopper, please provide your User Name and password.</TD>
- Change the text on line 184 from:
There is no shopper with that email and/or password. Please try again.<BR>
To:
There is no shopper with that User Name and/or password. Please try again.<BR>
- Change the text on line 200 from:
<TD>Email:</TD>
To:
<TD>User Name:</TD>
- Browse the site to be sure that everything works as expected.
Now the store will use the Membership Directory as well as the SBW_final_shopper table to store shopper information. Only the required fields will be filled in the SBW_final_shopper table. You can choose to fill in the optional fields if you want to. The registration page uses Membership Design-time Controls (DTCs).
FolderB Files
Next, replace the files in \SBW_final with the corresponding files in FolderB.
To replace the files in the \SBW_final folder with the files in FolderB
- Rename the following FolderB files, removing the FolderB_ prefix from each file name:
FolderB_default.asp
FolderB_formslogin.asp
FolderB_product.asp
FolderB_shopper_new.asp
- Copy the files from FolderB to the \SBW_final folder, and click Yes.
- Edit Formslogin.asp to prompt for User Name instead of Email by changing line 175 from:
<TD>Email:</TD>
To:
<TD>User Name:</TD>
When you finish copying the files from FolderB to \SBW_final, you must set the membership authentication type to HTML Forms Authentication on the following files:
- Basket.asp
- Payment.asp
- Shipping.asp
- Xt_orderform_additem.asp
- Xt_orderform_clearitems.asp
- Xt_orderform_delitems.asp
- Xt_orderform_editquantities.asp
- Xt_orderform_prepare.asp
- Xt_orderform_purchase.asp
To enable membership authentication
- Using MMC, select Internet Information Server, and open the node of the computer that contains the Web site.
- Expand the SBW Web site node, and click the SBW_final virtual directory node.
- Right-click each of the files for which you want to enable membership authentication.
- Click Properties.
- Click the Membership Authentication tab.
- Select the HTML Forms Authentication option and make sure that the Allow Anonymous check box is not checked.
- Browse the site to be sure that everything works as expected.
FolderC Files
Replace the files in \SBW_final with the corresponding files in FolderC.
To replace files in the \SBW_final folder with the files in FolderC
- Rename the following FolderC files, removing the FolderC_ prefix from each file name in which it occurs:
Formslogin.asp
I_header.asp
I_util.asp
Product.asp
FolderC_xt_orderform_additem.asp
FolderC_xt_orderform_purchase.asp
- Copy the files from FolderC to \SBW_final, and click Yes to replace the existing files.
FolderD Files
Replace the files in the \SBW_final\Manager folder with the corresponding files in FolderD.
To replace the files in the \SBW_final\Manager folder with the files in FolderD
- Rename the following FolderD files, removing the FolderD_ prefix from each file name:
FolderD_shopper_day.asp
FolderD_shopper_list.asp
FolderD_shopper_month.asp
FolderD_shopper_view.asp
- Copy the files from FolderD to the \SBW_final\Manager folder, and click Yes to replace the existing files.
FolderE Files
Replace the files in the \SBW_final\Manager\Include folder with the corresponding files in FolderE.
To replace the files in the \SBW_final\Manager\include folder with the files in FolderE
- Rename the following FolderE files, removing the FolderE_ prefix from each file name:
FolderE_list.asp
Mgmt_header.asp
- Copy the files from FolderE to the \SBW_final\Manager\Include folder, and click Yes to replace the existing files.
After you have made the necessary changes to the registration pages, you need to enable membership authentication on the Shopper_update.asp file.
To enable Membership Authentication on the Shopper_update.asp file
- Using MMC, select Internet Information Server, and open the node of the computer that contains the Web site.
- Expand the SBW Web site node, and click the SBW_final virtual directory node.
- Right-click Shopper_update.asp.
- Click Properties.
- Click the Membership Authentication tab.
- Select the HTML Forms Authentication option and make sure that the Allow Anonymous check box is not checked.
- Browse the site to be sure that everything works as expected.
Restrict Access to Registered Users
Finally, you must restrict access to registered users.
To remove Everyone Read permissions
- Select the following files, using Windows Explorer:
Basket.asp
Payment.asp
Shipping.asp
Xt_orderform_additem.asp
Xt_orderform_clearitems.asp
Xt_orderform_delitems.asp
Xt_orderform_editquantities.asp
Xt_orderform_prepare.asp
Xt_orderform_purchase.asp
- Right-click the selected files, and select Properties.
- Click the Security tab, and click Permissions.
- Remove all access control entries for the Everyone group.
To add Read permissions for the Site_CommerceServer_latereg files
- Select the same files using Windows Explorer.
- Right-click the selected files, and then select Properties.
- Click the Security tab, and then click Permissions.
- Click Add.
- Select the local computer name from the list of domains.
- Select Site_CommerceServer_latereg from the list of names.
- Click Add.
- Check to be sure that Read is selected as the type of access, and click OK.
- Click OK again in the File Permissions dialog box.
Your site is now membership-enabled. Browse the store by visiting http://Host_name:6001/SBW_final/Default.asp, where Host_name is the name of the local server.
Information in this document, including URL and other Internet web site references, is subject to change without notice. The entire risk of the use or the results of the use of this resource kit remains with the user. This resource kit is not supported and is provided as is without warranty of any kind, either express or implied. The example companies, organizations, products, people and events depicted herein are fictitious. No association with any real company, organization, product, person or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.
© 1999-2000 Microsoft Corporation. All rights reserved.
Microsoft, Windows and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries/regions.
The names of actual companies and products mentioned herein may be the trademarks of their respective owners.