%
Dim rType
Dim SP
Dim RS
Dim TransactionID
Dim Conn
Dim rsPremier
Dim strHigh
Dim strLow
Dim strTemp
Dim strHex
Dim strPremierID
strPremierID = 0
Call CCreateConnection
Call CGetPremierID
Err.Clear
Function Clean(What)
dim a
dim NewStr
For a = 1 To Len(What)
If (Mid(What,a,1) = "'") Then
NewStr = NewStr & "''"
ElseIf (asc(Mid(What,a,1)) <> 34) Then
NewStr = NewStr & Mid(What,a,1)
End If
Next
Clean = NewStr
End Function
%>
<% If (oPassMgrObj.IsAuthenticated(TimeWindow, ForceLogin)) Then %>
<%
rType = 0
If (Request.Cookies("OCA")("Type") = "bluescreen") Then
rType = 1
ElseIf (Request.Cookies("OCA")("Type") = "appcompat") Then
rType = 2
ElseIf (Request.Cookies("OCA")("Type") = "shutdown") Then
rType = 3
End If
Set SP = CreateObject("ADODB.Command")
Set RS = CreateObject("ADODB.Recordset")
With SP
.ActiveConnection = Conn
.CommandText = "SetCustomer"
.CommandType = &H0004
.CommandTimeout = strGlobalCommandTimeout
.Parameters.Append .CreateParameter("@HighID", 3, &H0001, , oPassMgrObj.Profile("MemberIdHigh"))
.Parameters.Append .CreateParameter("@LowID", 3, &H0001, , oPassMgrObj.Profile("MemberIdLow"))
.Parameters.Append .CreateParameter("@EMail", 202, &H0001, 128, Request.Form("EMail"))
.Parameters.Append .CreateParameter("@Contact", 202, &H0001, 32, Request.Form("Contact"))
.Parameters.Append .CreateParameter("@Phone", 202, &H0001, 16, Request.Form("Phone"))
.Parameters.Append .CreateParameter("@PremierID", 202, &H0001, 16, strPremierID)
.Parameters.Append .CreateParameter("@Lang", 202, &H0001, 4, strAbb)
.Execute
End With
If (Err.Number <> 0) Then
Response.Write "
" & L_COMMENTS_UNABLE_TOCONNECT_ERRORMESSAGE & "
" Response.Write "" & L_COMMENTS_DATABASE_FAILED_TEXT & "
" & L_COMMENTS_UNABLE_TOCONNECT_ERRORMESSAGE & "
" Response.Write "" & L_COMMENTS_DATABASE_FAILED_TEXT & "
Transaction:" & TransactionID & "
Err Desc:" & Err.Description & "
Err Num:" & Err.number
'Response.Write "
State:" & RS.state & "
High:" & oPassMgrObj.Profile("MemberIdHigh")
'Response.Write "
Low:" & oPassMgrObj.Profile("MemberIdLow") & "
Description:" & Request.Form("Description")
'Response.Write "
Type:" & rType
'Response.Write "
Conn:" & Conn.state
'Response.End
RS.Close
End If
Private Sub CGetPremierID
on error resume next
'Response.Cookies("intCustomerPremierID") = 0
strHigh = CStr(Hex(oPassMgrObj.Profile("MemberIdHigh")))
strLow = Cstr(Hex(oPassMgrObj.Profile("MemberIdLow")))
if Len(strHigh) > 8 then
strHigh = right(strHigh, 8)
end if
if len(strLow) > 8 then
strLow = right(strHigh, 8)
end if
if Len(strHigh) < 8 then
strTemp = String(8 - len(strHigh), "0")
strHigh =strTemp & strHigh
end if
if Len(strLow) < 8 then
strTemp = string(8 - len(strLow), "0")
strLow = strTemp & strLow
end if
'Response.write "Cookies:" & Request.Cookies("intCustomerPremierID") & "
"
strHex = strHigh & strLow
set rsPremier = Conn.Execute("Exec GetPremierID '" & strHex & "'")
if Conn.Errors.Count > 0 then
strPremierID = 0
Exit Sub
End if
if rsPremier.State = adStateOpen then
if rsPremier.RecordCount > 0 then
strPremierID = rsPremier.Fields(0).Value
else
if Request.Cookies("intCustomerPremierID") = 0 or Request.Cookies("intCustomerPremierID") = "" then
strPremierID = 0
else
strPremierID = CInt(Request.Cookies("intCustomerPremierID") )
end if
end if
else
if Request.Cookies("intCustomerPremierID") = 0 or Request.Cookies("intCustomerPremierID") = "" then
strPremierID = 0
else
strPremierID = Cint(Request.Cookies("intCustomerPremierID") )
end if
end if
End Sub
Private Sub CCreateConnection
Set Conn = Server.CreateObject("ADODB.Connection")
set rsPremier = Server.CreateObject("ADODB.Recordset")
With Conn
.ConnectionString = strCustomer
.CursorLocation = adUseClient
.ConnectionTimeout = strGlobalConnectionTimeout
.Open
End With
If (Err.Number <> 0) Then
Response.Write "ERROR: [" & Err.Number & "]" & Err.Description
Call CDestroyObjects
Response.End
End If
End Sub
Private Sub CDestroyObjects
Conn.Close
Set Conn = Nothing
End Sub
Set SP = Nothing
Set RS = Nothing
%>
<% Else %>
<%=L_CERCUST_PASSPORT_TITLE_TEXT%>
<%=L_CERCUST_PASS_PORT_TEXT%> <%=L_WELCOME_PASSPORT_LINK_TEXT%>
<%=oPassMgrObj.LogoTag(Server.URLEncode(ThisPageURL),TimeWindow,ForceLogin,CoBrandArgs,strLCID,Secure)%>