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:

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

  1. In MMC, select Personalization and Membership and right-click the computer node to which you want to add the server.

  2. Click New.

  3. Click Membership Server Instance.

  4. Type CommerceServer as the Membership Directory Name.

  5. Type password for the administrator’s password.

  6. 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.

  7. Accept the defaults for other settings.

  8. Rename this Membership Server instance as SBW Membership Server.

  9. 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

  1. Using MMC, select Membership Directory Manager and right-click Properties to point to the LDAP port number specified earlier (1005).

  2. Select Logon Anonymously when prompted for authentication.

  3. Right click ou=groups.

  4. Click New, and then click group to create a new group.

  5. Type latereg to name the new group.

  6. Accept all other defaults.

To create a new Web site

  1. Using MMC, select Internet Information Server and right-click the node of the computer to which you want to add the Web site.

  2. Click New.

  3. Click Web Site.

  4. Type SBW in the Web Site Description field.

  5. Set the HTTP port number to an unused port (for example, 6001).

  6. Set the home directory to the new folder you created earlier (C:\Whitepaper2\Sites).

  7. Accept all other defaults.

To start the Web site

  1. Using MMC, select Internet Information Server, and open the node of the computer that contains the Web site.

  2. Right-click SBW.

  3. Click Start.

To map this Web site to the SBW Membership Server

  1. Using MMC, select Internet Information Server, and open the node of the computer that contains the Web site.

  2. Right-click SBW.

  3. Click All Task.

  4. Select Membership Server Mapping.

  5. From the drop-down box, select SBW Membership Server.

To set up the database

  1. 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.

  2. Create a new SQL Server database.

  3. Create a Data Source Name (DSN) for the database by clicking the Start menu.

  4. Click Settings.

  5. Click Control Panel.

  6. Double-click the ODBC icon.

To create a new Commerce site foundation using the Site Foundation Wizard

  1. Using MMC, right-click the node of the computer to which you want to add the foundation.

  2. Click New.

  3. Click Commerce Site Foundation.

  4. Select the SBW Web site on which to create the foundation.

  5. Type administrator as the account name to use for accessing the Membership Directory.

  6. Type password as the account password.

  7. Type SBW_final as the Short Name and Display Name for the site.

  8. Select the Data Source Name (DSN) you created earlier as the data source.

  9. Click Finish.

To create a site manager member in the Membership Directory using the New User Wizard

  1. In the Membership Directory Manager, right-click ou=Members.

  2. Click New, and then click User.

  3. Type sbwAdmin to name the new user.

  4. Add the user password attribute for this member and type password as the account password.

  5. 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

  1. 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.

  2. Type administrator to log in.

  3. Type password as the password.

  4. Start the Commerce Site Builder Wizard.

  5. Select Registration when Ordering on the Features page of the Site Builder Wizard (page 7 of 14).

  6. On the final screen of the Site Builder Wizard (page 14 of 14), select Load Schema into Database and Load Sample Data into Database.

  7. 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

  1. Copy the following files from FolderA to the \SBW_final folder:

    Shopper_new.asp

    Shopper_update.asp

    Shopper_lookup.asp

  2. 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

  1. 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>
    
  2. 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>
    
  3. Change the text on line 200 from:
    <TD>Email:</TD>
    

    To:

    <TD>User Name:</TD>
    
  4. 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

  1. 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

  2. Copy the files from FolderB to the \SBW_final folder, and click Yes.

  3. 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:

To enable membership authentication

  1. Using MMC, select Internet Information Server, and open the node of the computer that contains the Web site.

  2. Expand the SBW Web site node, and click the SBW_final virtual directory node.

  3. Right-click each of the files for which you want to enable membership authentication.

  4. Click Properties.

  5. Click the Membership Authentication tab.

  6. Select the HTML Forms Authentication option and make sure that the Allow Anonymous check box is not checked.

  7. 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

  1. 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

  2. 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

  1. 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

  2. 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

  1. Rename the following FolderE files, removing the FolderE_ prefix from each file name:

    FolderE_list.asp

    Mgmt_header.asp

  2. 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

  1. Using MMC, select Internet Information Server, and open the node of the computer that contains the Web site.

  2. Expand the SBW Web site node, and click the SBW_final virtual directory node.

  3. Right-click Shopper_update.asp.

  4. Click Properties.

  5. Click the Membership Authentication tab.

  6. Select the HTML Forms Authentication option and make sure that the Allow Anonymous check box is not checked.

  7. 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

  1. 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

  2. Right-click the selected files, and select Properties.

  3. Click the Security tab, and click Permissions.

  4. Remove all access control entries for the Everyone group.

To add Read permissions for the Site_CommerceServer_latereg files

  1. Select the same files using Windows Explorer.

  2. Right-click the selected files, and then select Properties.

  3. Click the Security tab, and then click Permissions.

  4. Click Add.

  5. Select the local computer name from the list of domains.

  6. Select Site_CommerceServer_latereg from the list of names.

  7. Click Add.

  8. Check to be sure that Read is selected as the type of access, and click OK.

  9. 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.