<% 'This code is copyright (c) Internet Business Solutions SL, all rights reserved. 'The contents of this file are protect under law as the intellectual property 'of Internet Business Solutions SL. Any use, reproduction, disclosure or copying 'of any kind without the express and written permission of Internet Business 'Solutions SL is forbidden. 'Author: Vince Reid, vince@virtualred.net if storesessionvalue="" then storesessionvalue="virtualstore" if Session("loggedon") <> storesessionvalue OR disallowlogin=TRUE then response.end Response.Charset = "8859-1" success=true Set rs = Server.CreateObject("ADODB.RecordSet") Set cnn=Server.CreateObject("ADODB.Connection") cnn.open sDSN alreadygotadmin = getadminsettings() countryCode = origCountryCode Function ParseUPSLicenseOutput(xmlDoc, rootNodeName, byRef thetext, byRef errormsg) Dim noError, nodeList, e, i, j, k, l, n, t, t2 noError = True errormsg = "" gotxml=false thetext="" Set t2 = xmlDoc.getElementsByTagName(rootNodeName).Item(0) ' response.write Replace(Replace(xmlDoc.xml,"<")&"
" for j = 0 to t2.childNodes.length - 1 Set n = t2.childNodes.Item(j) if n.nodename="Response" then For i = 0 To n.childNodes.length - 1 Set e = n.childNodes.Item(i) if e.nodeName="ResponseStatusCode" then noError = Int(e.firstChild.nodeValue)=1 end if if e.nodeName="Error" then errormsg = "" For k = 0 To e.childNodes.length - 1 Set t = e.childNodes.Item(k) Select Case t.nodeName Case "ErrorSeverity" if t.firstChild.nodeValue="Transient" then errormsg = "This is a temporary error. Please wait a few moments then refresh this page.
" & errormsg Case "ErrorDescription" errormsg = errormsg & t.firstChild.nodeValue End Select Next end if ' response.write "The Nodename is : " & e.nodeName & ":" & e.firstChild.nodeValue & "
" Next elseif n.nodename="AccessLicenseNumber" then thetext = n.firstChild.nodeValue elseif n.nodename="AccessLicenseText" then thetext = n.firstChild.nodeValue if mysqlserver then rs.CursorLocation = 3 rs.Open "SELECT * FROM admin WHERE adminID=1",cnn,1,3,&H0001 rs.Fields("adminUPSLicense")=n.firstChild.nodeValue rs.Update rs.Close elseif n.nodename="UserId" then thetext = n.firstChild.nodeValue end if Next ParseUPSLicenseOutput = noError end Function if request.form("upsstep")="4" then Set docXML = Server.CreateObject("MSXML2.DOMDocument") sSQL = "SELECT adminUPSLicense FROM admin WHERE adminID=1" rs.Open sSQL,cnn,0,1 sXML = "" sXML = sXML & "Ecomm Plus UPS Reg1.0001" sXML = sXML & "AccessLicenseAllTools" sXML = sXML & "" & Request.Form("company") & "" sXML = sXML & "
" & Request.Form("address") & "" if Trim(Request.Form("address2"))<>"" then sXML = sXML & "" & Request.Form("address2") & "" sXML = sXML & "" & Request.Form("city") & "" if Trim(Request.Form("country"))="US" OR Trim(Request.Form("country"))="CA" then sXML = sXML & "" & Request.Form("usstate") & "" else sXML = sXML & "XX" end if if Trim(Request.Form("postcode"))<>"" then sXML = sXML & "" & Request.Form("postcode") & "" sXML = sXML & "" & Request.Form("country") & "
" sXML = sXML & "" & Request.Form("contact") & "" & Request.Form("ctitle") & "" sXML = sXML & "" & Request.Form("email") & "" & Request.Form("telephone") & "" sXML = sXML & "" & Request.Form("websiteurl") & "" if Trim(Request.Form("upsaccount"))<>"" then sXML = sXML & "" & Request.Form("upsaccount") & "" sXML = sXML & "BB9341E83CC05B12" sXML = sXML & "" & Request.Form("countryCode") & "" & Request.Form("languageCode") & "" sXML = sXML & "" & rs("adminUPSLicense") & "" sXML = sXML & "" sXML = sXML & "RateXML1.0TrackXML1.0" sXML = sXML & "" & Request.Form("upsrep") & "Ecommerce Plus TemplatesInternet Business Solutions SL2.5" sXML = sXML & "
" docXML.loadXML(sXML) rs.Close ' response.write Replace(Replace(docXML.xml,"<")&"
" ' response.flush set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP") objHttp.open "POST", "https://www.ups.com/ups.app/xml/License", false objHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" on error resume next err.number=0 objHttp.Send docXML on error goto 0 If err.number <> 0 OR objHttp.status <> 200 Then errormsg = "Error, couldn't connect to UPS server
" & objHttp.status & ": (" & objHttp.statusText & ") " & err.number & ": (" & err.Description & ")" success = false Else saveLCID = Session.LCID Session.LCID = 1033 'response.write Replace(Replace(objHttp.responseText,"<")&"
" success = ParseUPSLicenseOutput(objHttp.responseXML, "AccessLicenseResponse", accessnumber, errormsg) Session.LCID = saveLCID End If set objHttp = nothing if success then sSQL = "UPDATE admin SET adminUPSAccess='"&accessnumber&"'" cnn.Execute(sSQL) noloops=0 Randomize upperbound = "999999" lowerbound = "100000" thepw = "ecp" & Int((upperbound - lowerbound + 1) * Rnd + lowerbound) theuser = "ecu" & Int((upperbound - lowerbound + 1) * Rnd + lowerbound) do while theuser<>"" AND success AND noloops < 5 saveuser = theuser sXML = "" sXML = sXML & "Ecomm Plus UPS Reg1.0001" sXML = sXML & "Registersuggest" sXML = sXML & ""&theuser&""&thepw&"" sXML = sXML & "" & Request.Form("contact") & "" sXML = sXML & "" & Request.Form("company") & "" sXML = sXML & "" & Request.Form("ctitle") & "
" sXML = sXML & "" & Request.Form("address") & "" if Trim(Request.Form("address2"))<>"" then sXML = sXML & "" & Request.Form("address2") & "" sXML = sXML & "" & Request.Form("city") & "" if Trim(Request.Form("country"))="US" OR Trim(Request.Form("country"))="CA" then sXML = sXML & "" & Request.Form("usstate") & "" else sXML = sXML & "XX" end if if Trim(Request.Form("postcode"))<>"" then sXML = sXML & "" & Request.Form("postcode") & "" sXML = sXML & "" & Request.Form("country") & "
" sXML = sXML & "" & Request.Form("telephone") & "" sXML = sXML & "" & Request.Form("email") & "" 'if Trim(Request.Form("upsaccount"))<>"" then sXML = sXML & "" & Request.Form("upsaccount") & "" sXML = sXML & "
" 'response.write Replace(Replace(sXML,"<")&"
" set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP") objHttp.open "POST", "https://www.ups.com/ups.app/xml/Register", false objHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" on error resume next err.number=0 objHttp.Send sXML on error goto 0 If err.number <> 0 OR objHttp.status <> 200 Then errormsg = "Error, couldn't connect to UPS server
" & objHttp.status & ": (" & objHttp.statusText & ") " & err.number & ": (" & err.Description & ")" success = false Else saveLCID = Session.LCID Session.LCID = 1033 'response.write Replace(Replace(objHttp.responseText,"<")&"
" success = ParseUPSLicenseOutput(objHttp.responseXML, "RegistrationResponse", theuser, errormsg) Session.LCID = saveLCID End If set objHttp = nothing noloops=noloops+1 loop end if Set docXML = nothing %>
<% if success then sSQL = "UPDATE admin SET adminUPSUser='"&upsencode(saveuser, "")&"',adminUPSpw='"&upsencode(thepw, "")&"'" cnn.Execute(sSQL) Application.Lock() Application("getadminsettings")="" Application.UnLock() %> <% else %> <% end if %>
UPS
 
 
 
 
<%=yyUPSWiz%> - <% if success then response.write yyRegSucc else response.write yyError %>
 

<%=yyRegSucc%> !

<%=yyUPSLi5%>

<%=yyUPSLi6%> www.ec.ups.com.

<%=yyUPSLi7%> <%=yyAdmMai%>.

<%=yyUPSLi8%> <%=yyClkHer%>.

 

 

<%=yySorErr%>

 

<%=errormsg%>

 

<%=yyTryBac%> <%=yyClkHer%>.

 

<%=yyUPStm%>

<% elseif request.form("upsstep")="3" AND request.form("doagree")="1" then %>
" /> " />
UPS
 
 
 
 
<%=yyUPSWiz%> - <%=yyStep%> 2
 
<%=yyConNam%> :
<%=yyTitle%> :
<%=yyComNam%> :
<%=yyStrAdd%> :
<%=yyAddr2%> :
<%=yyCity%> :
<%=yyState%> <%=yyUSCan%> :
<%=yyCountry%> :
<%=yyPCode%> :
<%=yyTelep%> :
<%=yyWebURL%> :
<%=yyEmail%> :
<%=yyUPSac%> :
<%=yyUPSsr%>
<%=yyYes%> <%=yyNo%>

       

<%=yyUPSop%> <%=yyClkHer%> <%=yyUPScl%>
<%=yyUPSMI%> <%=yyClkHer%>.
<%=yyUPshp%> <%=yyClkHer%>

<%=yyUPStm%>

<% elseif request.form("upsstep")="2" then languageCode="EN" if countryCode="AR" OR countryCode="ES" OR countryCode="MX" OR countryCode="CA" OR countryCode="DO" OR countryCode="GT" OR countryCode="CR" OR countryCode="CO" OR countryCode="PA" OR countryCode="PR" OR countryCode="CL" then languageCode="ES" elseif countryCode="AT" OR countryCode="DE" then languageCode="DE" elseif countryCode="PT" OR countryCode="BR" then languageCode="PT" elseif countryCode="FR" OR countryCode="CH" OR countryCode="BE" then languageCode="FR" elseif countryCode="CN" OR countryCode="HK" then languageCode="ZH" elseif countryCode="DK" then languageCode="DA" elseif countryCode="FI" then languageCode="FI" elseif countryCode="GR" then languageCode="EL" elseif countryCode="IN" then languageCode="GU" elseif countryCode="IL" then languageCode="IW" elseif countryCode="IT" then languageCode="IT" elseif countryCode="JP" then languageCode="JA" elseif countryCode="MY" then languageCode="MS" elseif countryCode="NL" then languageCode="NL" elseif countryCode="NO" then languageCode="NO" elseif countryCode="KR" then languageCode="KO" elseif countryCode="SE" then languageCode="SV" elseif countryCode="TH" then languageCode="TH" end if sXML = "" sXML = sXML & "AllToolsEcomm Plus UPS License1.0001" sXML = sXML & "AccessLicenseBB9341E83CC05B12" sXML = sXML & ""&countryCode&""&languageCode&"" sXML = sXML & "RateXML1.0TrackXML1.0" ' response.write Replace(Replace(sXML,"<")&"
" set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP") objHttp.open "POST", "https://www.ups.com/ups.app/xml/License", false objHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" on error resume next err.number=0 objHttp.Send sXML on error goto 0 lictext = "" If err.number <> 0 OR objHttp.status <> 200 Then errormsg = "Error, couldn't connect to UPS server
" & objHttp.status & ": (" & objHttp.statusText & ") " & err.number & ": (" & err.Description & ")" success = false Else saveLCID = Session.LCID Session.LCID = 1033 success = ParseUPSLicenseOutput(objHttp.responseXML, "AccessLicenseAgreementResponse", lictext, errormsg) Session.LCID = saveLCID End If set objHttp = nothing %>
<% if success then %> <% else %> <% end if %>
  <%=yyUPSWiz%> - <%=yyStep%> 1
 


<%=yyUPSTer%>

<%=yyAgree%>       <%=yyNoAgre%>

 

<%=yySorErr%>

 

<%=errormsg%>

 

<% if success then %>            <% end if %>

<%=yyUPSop%> <%=yyClkHer%> <%=yyUPScl%>
<%=yyUPSMI%> <%=yyClkHer%>.
<%=yyUPshp%> <%=yyClkHer%>.

<%=yyUPStm%>

<% else %>

 
<%=yyUPSWiz%>
 

 

      

<%=yyUPSop%> <%=yyClkHer%> <%=yyUPScl%>
<%=yyUPSMI%> <%=yyClkHer%>.
<%=yyUPshp%> <%=yyClkHer%>.

<%=yyUPStm%>

<% end if cnn.Close set rs = nothing set cnn = nothing %>