Service Pack 2 Changes for Sitelets
After you install Commerce Server 2002 Service Pack 2, you need to the update the following code in the sitelets.
- Open the ProfileLib.asp file located in: %COMMERCE_SERVER_ROOT%\SDK\Samples\Classic ASP\<Sitelet Name>\source\include.
- Replace this line:
objAuthMgr.SetUserID fTicketType, strUserId
with this code:
If fTicketType = 1 Then
objAuthMgr.SetProfileTicket strUserId, fCookieSupport
End If
Following is the way the code should appear after you update it. The code in bold is the new code.
'------------------------------------------------------------------------------
' LogOnUser
'
' Description:
' Used for giving the newly created user an auth ticket.
'
' Parameters:
' [in] strUserName - User name to logon
' [in] strUserPwd - Password for user
' [in] fCookieSupport - Flag for cookie support
' [in] strTimeout - Timeout for logon
' [in] fTicketType - Flag for type of ticket
'
' Returns:
' Boolean
'
' Notes:
' <none>
'------------------------------------------------------------------------------
Function LogOnUser( _
ByVal strUserName, _
ByVal strUserPwd, _
ByVal fCookieSupport, _
ByVal strTimeout, _
ByVal fTicketType _
)
On Error Resume Next
Dim objAuthMgr
Dim objProfile
Dim strUserId
Set objAuthMgr = InitAuthMgr(Application("MSCSSiteName"))
If Err.number <> 0 Then
Call RaiseError( _
Err.number, _
Err.description, _
Request.ServerVariables("SCRIPT_NAME"), _
"LogOnUser()" _
)
Exit Function
End If
Set objProfile = GetProfile(USER_LOGON_NAME, strUserName, PROFILE_TYPE_USER)
If Err.number <> 0 Then
'if GetProfile failed, the user doesn't exist
LogOnUser = False
Exit Function
End If
If (objProfile.Fields(USER_PASSWORD).Value = strUserPwd) Then
strUserId = objProfile.Fields(USER_ID).Value
objAuthMgr.SetAuthTicket strUserId, fCookieSupport, strTimeout
If fTicketType = 1 ThenobjAuthMgr.SetProfileTicket strUserId, fCookieSupport End If
Set objAuthMgr = nothing
Else
LogOnUser = False
Exit Function
End If
If Err.number <> 0 Then
Call RaiseError( _
Err.number, _
Err.description, _
Request.ServerVariables("SCRIPT_NAME"), _
"LogOnUser()" _
)
Exit Function
End If
LogOnUser = True
End Function
Copyright © 2005 Microsoft Corporation.
All rights reserved.