Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

672 lines
16 KiB

  1. <!--#INCLUDE file="..\include\asp\top.asp"-->
  2. <!--#INCLUDE file="..\include\inc\browserTest.inc"-->
  3. <!--#include file="..\include\asp\head.asp"-->
  4. <!--#INCLUDE file="..\include\inc\customerstrings.inc"-->
  5. <%
  6. Dim cnConnection
  7. Dim rsCustomer
  8. Dim iIncident
  9. Dim strPreviousPage
  10. Dim rsPremier
  11. Dim strHex
  12. Dim strName
  13. Dim strPhone
  14. Dim strEmail
  15. Dim strHigh
  16. Dim strLow
  17. Dim strTemp
  18. Call CVerifyEntry
  19. Call CVerifyPassport
  20. Call CCreateObjects
  21. Call CCreateConnection
  22. if cnConnection.State = adStateOpen then
  23. Call CGetPremierID
  24. if Request.Cookies("Misc")("auto") = "True" then
  25. Call CSetPassport
  26. else
  27. Response.Cookies("Misc")("auto") = "False"
  28. End If
  29. End If
  30. Call CSetPreviousPage
  31. Call CGetCustomerProfile
  32. Call CDestroyObjects
  33. '_____________________________________________________________________________________________________________________
  34. 'Sub Procedures
  35. Private Sub CSetPreviousPage
  36. on error resume next
  37. strPreviousPage = Request.ServerVariables("SCRIPT_NAME")
  38. strPreviousPage = Right(strPreviousPage, len(strPreviousPage) - Instrrev(strPreviousPage, "/"))
  39. Response.Cookies("Misc")("PreviousPage") = strPreviousPage
  40. End Sub
  41. Private Sub CGetCustomerProfile
  42. on error resume next
  43. if oPassMgrObj.Profile("MemberIdHigh") <> "" and oPassMgrObj.Profile("MemberIdLow")<> "" then
  44. Set rsCustomer = cnConnection.execute("Exec GetCustomer " & oPassMgrObj.Profile("MemberIdHigh") & ", " & oPassMgrObj.Profile("MemberIdLow"))
  45. set rsCustomer.ActiveConnection = Nothing
  46. if rsCustomer.State = adStateOpen then
  47. if rsCustomer.RecordCount > 0 then
  48. strEmail = rsCustomer("EMail")
  49. strName = rsCustomer("Contact")
  50. strPhone = rsCustomer("Phone")
  51. if Request.Cookies("intCustomerPremierID") = 0 then
  52. if IsNull(rsCustomer("PremierID")) = false then
  53. Response.Cookies("intCustomerPremierID") = rsCustomer("PremierID")
  54. end if
  55. end if
  56. else
  57. strName = oPassMgrObj.Profile("MemberName")
  58. strPhone = ""
  59. strEmail = oPassMgrObj.Profile("PreferredEmail")
  60. end if
  61. else
  62. strName = oPassMgrObj.Profile("MemberName")
  63. strPhone = ""
  64. strEmail = oPassMgrObj.Profile("PreferredEmail")
  65. end if
  66. end if
  67. End Sub
  68. Private Sub CSetPassport
  69. on error resume next
  70. if Request.Cookies("Misc")("auto") = "True" then
  71. if oPassMgrObj.Profile("MemberIdHigh") <> "" and oPassMgrObj.Profile("MemberIdLow") <> "" then
  72. iIncident = Request.Cookies("Misc")("txtIncidentID")
  73. cnConnection.Execute("Exec SetPassport " & oPassMgrObj.Profile("MemberIdHigh") & ", " & oPassMgrObj.Profile("MemberIdLow") & ", " & iIncident)
  74. if cnConnection.Errors.Count > 0 then
  75. cnConnection.Errors.Clear
  76. Exit Sub
  77. End if
  78. end if
  79. end if
  80. End Sub
  81. Private Sub CGetPremierID
  82. on error resume next
  83. Response.Cookies("intCustomerPremierID") = 0
  84. strHigh = CStr(Hex(oPassMgrObj.Profile("MemberIdHigh")))
  85. strLow = Cstr(Hex(oPassMgrObj.Profile("MemberIdLow")))
  86. if Len(strHigh) > 8 then
  87. strHigh = right(strHigh, 8)
  88. end if
  89. if len(strLow) > 8 then
  90. strLow = right(strHigh, 8)
  91. end if
  92. if Len(strHigh) < 8 then
  93. strTemp = String(8 - len(strHigh), "0")
  94. strHigh =strTemp & strHigh
  95. end if
  96. if Len(strLow) < 8 then
  97. strTemp = string(8 - len(strLow), "0")
  98. strLow = strTemp & strLow
  99. end if
  100. strHex = strHigh & strLow
  101. set rsPremier = cnConnection.Execute("Exec GetPremierID '" & strHex & "'")
  102. if cnConnection.Errors.Count > 0 then
  103. Response.Cookies("intCustomerPremierID") = 0
  104. Exit Sub
  105. End if
  106. if rsPremier.State = adStateOpen then
  107. if rsPremier.RecordCount > 0 then
  108. Response.Cookies("intCustomerPremierID") = rsPremier.Fields(0).Value
  109. else
  110. Response.Cookies("intCustomerPremierID") = 0
  111. end if
  112. else
  113. Response.Cookies("intCustomerPremierID") = 0
  114. end if
  115. End Sub
  116. Private Sub CVerifyEntry
  117. on error resume next
  118. if Trim(Request.Cookies("Misc")("PreviousPage")) <> "locate.asp" and Trim(Request.Cookies("Misc")("PreviousPage")) <> "submit.asp" then
  119. if Request.Cookies("Misc")("privacy") <> "1" then
  120. Response.Redirect("https://" & Request.ServerVariables("SERVER_NAME") & "/secure/sprivacy.asp")
  121. Response.End
  122. end if
  123. end if
  124. End Sub
  125. Private Sub CVerifyPassport
  126. on error Resume next
  127. If oPassMgrObj.IsAuthenticated(TimeWindow, ForceLogin) = false then
  128. Response.Cookies("Misc")("P") = "1"
  129. Response.Write "<br><br><div class='clsDiv'><p class='clsPTitle'>" & L_CUSTOMER_PASSPORT_TITLE_TEXT
  130. Response.Write "</p><p class='clsPBody'>" & L_CUSTOMER_PASSPORT_INFO_TEXT
  131. Response.Write "<A class='clsALinkNormal' href='" & L_FAQ_PASSPORT_LINK_TEXT & "'>" & L_WELCOME_PASSPORT_LINK_TEXT & "</A><BR><BR>"
  132. Response.write oPassMgrObj.LogoTag2(Server.URLEncode(ThisPageURL), TimeWindow, ForceLogin, CoBrandArgs, strLCID, Secure)
  133. Response.Write "</P></div><div id='divHiddenFields' name='divHiddenFields'>"
  134. Response.Write "</div>"
  135. %>
  136. <!--#include file="..\include\asp\foot.asp"-->
  137. <%
  138. Response.End
  139. end if
  140. End Sub
  141. Private Sub CCreateObjects
  142. on error resume next
  143. set cnConnection = CreateObject("ADODB.Connection")'Create Connection Object
  144. set rsCustomer = CreateObject("ADODB.Recordset")'Create Recordset Object
  145. set rsPremier = CreateObject("ADODB.Recordset")
  146. End Sub
  147. Private Sub CDestroyObjects
  148. on error resume next
  149. if rsCustomer.State = adStateOpen then rsCustomer.Close
  150. set rsCustomer = nothing
  151. if rsPremier.State = adStateOpen then rsPremier.Close
  152. set rsPremier = nothing
  153. if cnConnection.State = adStateOpen then cnConnection.Close
  154. set cnConnection = nothing
  155. End Sub
  156. Private Sub CCreateConnection
  157. on error resume next
  158. with cnConnection
  159. .ConnectionString = strCustomer
  160. .CursorLocation = adUseClient
  161. .ConnectionTimeout = strGlobalConnectionTimeout
  162. .Open
  163. end with 'Catch errors and display to user
  164. if cnConnection.State = adStateClosed then
  165. Response.Write "<br><div class='divLoad'><p class='clsPTitle'>" & L_COMMENTS_UNABLE_TOCONNECT_ERRORMESSAGE & "</p>"
  166. Response.Write "<p class='clsPBody'>" & L_COMMENTS_CONNECTION_FAILED_TEXT & "</p></div>"
  167. cnConnection.Errors.Clear
  168. Call CDestroyObjects
  169. %>
  170. <!--#include file="..\include\asp\foot.asp"-->
  171. <%
  172. Response.End
  173. end if
  174. End Sub
  175. If oPassMgrObj.IsAuthenticated(TimeWindow, ForceLogin) = true then
  176. Response.Cookies("Misc")("P") = "0"
  177. '_____________________________________________________________________________________________________________________
  178. %>
  179. <div class="clsDiv">
  180. <P id="PTitle" class="clsPTitle">
  181. <% = L_CUSTOMER_IN_FORMATION_TEXT %>
  182. </P>
  183. <p class="clsPBody">
  184. <% = L_CUSTOMER_CON_TACT_TEXT %>
  185. </p>
  186. <p class="clsPBody">
  187. <% = L_CUSTOMER_CONTACT_INFORMATION_TEXT %>
  188. <br>
  189. <% = Server.HTMLEncode(rsCustomer("Contact")) %>
  190. </p>
  191. <p class="clsPBody"><Label For=txtName><% = L_CUSTOMER_NAME_INFO_EDITBOX %></Label><br>
  192. <%
  193. strName = Replace(strName, Chr(34), "&quot;")
  194. if Len(strName) = 4 and strName = "~|~|" then
  195. %>
  196. <Input name="txtName" id="txtName" maxlength=32 type="text" class="clsTextBox">
  197. <%
  198. else
  199. if Session.CodePage = 932 then
  200. %>
  201. <Input name="txtName" id="txtName" maxlength=32 type="text" class="clsTextBox" value="<%Response.Write strName%>">
  202. <%
  203. else
  204. %>
  205. <Input name="txtName" id="txtName" maxlength=32 type="text" class="clsTextBox" value="<%Response.Write Server.HTMLEncode(strName)%>">
  206. <%
  207. end if
  208. end if
  209. %>
  210. </P>
  211. <p class="clsPBody"><Label For=txtEmail><% = L_CUSTOMER_E_MAIL_EDITBOX %></Label><br>
  212. <%
  213. if Len(strEmail) = 4 and strEmail = "~|~|" then
  214. %>
  215. <Input name="txtEmail" id="txtEmail" maxlength=128 type="text" class="clsTextBox">
  216. <%
  217. else
  218. if Session.CodePage = 932 then
  219. %>
  220. <Input name="txtEmail" id="txtEmail" maxlength=128 type="text" class="clsTextBox" value="<% Response.Write strEmail %>">
  221. <%
  222. else
  223. %>
  224. <Input name="txtEmail" id="txtEmail" maxlength=128 type="text" class="clsTextBox" value="<% Response.Write Server.HTMLEncode(strEmail) %>">
  225. <%
  226. end if
  227. end if
  228. %>
  229. </P>
  230. <p class="clsPBody"><Label For=txtPhone><% = L_CUSTOMER_PH_ONE_EDITBOX %></Label><br>
  231. <%
  232. if Len(strPhone) = 4 and strPhone = "~|~|" then
  233. %>
  234. <Input name="txtPhone" id="txtPhone" maxlength=16 type="text" class="clsTextBox">
  235. <%
  236. else
  237. if Session.CodePage = 932 then
  238. %>
  239. <Input name="txtPhone" id="txtPhone" maxlength=16 type="text" class="clsTextBox" value="<% Response.Write strPhone %>">
  240. <%
  241. else
  242. %>
  243. <Input name="txtPhone" id="txtPhone" maxlength=16 type="text" class="clsTextBox" value="<% Response.Write Server.HTMLEncode(strPhone) %>">
  244. <%
  245. end if
  246. end if
  247. %>
  248. </P>
  249. <%
  250. if Request.Cookies("Misc")("auto") = "True" then
  251. %>
  252. <br>
  253. <div>
  254. <Table class="clstblLinks">
  255. <thead>
  256. <tr>
  257. <td>
  258. </td>
  259. <td>
  260. </td>
  261. </tr>
  262. </thead>
  263. <tbody>
  264. <tr>
  265. <td nowrap class="clsTDLinks">
  266. <A class="clsALink" href="http://<% =Request.ServerVariables("SERVER_NAME") %>/welcome.asp"><% = L_LOCATE_CANCEL_LINK_TEXT %></a>
  267. </td>
  268. <td nowrap class="clsTDLinks">
  269. <A class="clsALink" href="JAVASCRIPT:onautosubmit_click();"><% =L_CUSTOMER_NEXT_LINK_TEXT %></a>
  270. </td>
  271. </tr>
  272. </tbody>
  273. </table>
  274. </div>
  275. <br>
  276. <%
  277. else
  278. %>
  279. <P class="clsPSubTitle">
  280. <% = L_CUSTOMER_LO_CATE_TEXT %>
  281. </P>
  282. <p class="clsPBody">
  283. <% = L_CUSTOMER_LOCATE_INFO_TEXT %>
  284. </P>
  285. <P class="clsPBody">
  286. <Table>
  287. <thead>
  288. <tr>
  289. <td>
  290. </td>
  291. <td>
  292. </td>
  293. <td>
  294. </td>
  295. </tr>
  296. </thead>
  297. <tbody class="clstblLinks">
  298. <tr>
  299. <td nowrap class="clsTDLinks">
  300. <A class="clsALink" href="http://<% =Request.ServerVariables("SERVER_NAME") %>/welcome.asp"><% = L_LOCATE_CANCEL_LINK_TEXT %></a>
  301. </td>
  302. <td nowrap class="clsTDLinks">
  303. <A class="clsALink" href="JAVASCRIPT:privacy_onclick();"><% = L_LOCATE_PREVIOUS_LINK_TEXT%></a>
  304. </td>
  305. <td nowrap class="clsTDLinks">
  306. <A class="clsALink" href="JAVASCRIPT:onsubmit_click();"><% = L_CUSTOMER_NEXT_LINK_TEXT %></a>
  307. </td>
  308. </tr>
  309. </tbody>
  310. </table>
  311. </p>
  312. <%
  313. end if
  314. %>
  315. </div>
  316. <SCRIPT LANGUAGE=javascript>
  317. <!--
  318. window.onload = BodyLoad;
  319. function BodyLoad()
  320. {
  321. var oTimeExpiresNow = new Date();
  322. if(txtName.value == "")
  323. {
  324. strName = "txtCustomerName=~|~|" ;
  325. }
  326. else
  327. {
  328. strName = "txtCustomerName=" + escape(txtName.value);
  329. }
  330. if(txtPhone.value=="")
  331. {
  332. strPhone = "txtCustomerPhone=~|~|";
  333. }
  334. else
  335. {
  336. strPhone = "txtCustomerPhone=" + escape(txtPhone.value);
  337. }
  338. if(txtEmail.value=="")
  339. {
  340. strEmail = "txtCustomerEmail=~|~|";
  341. }
  342. else
  343. {
  344. strEmail = "txtCustomerEmail=" + escape(txtEmail.value);
  345. }
  346. //SaveData();document.cookie = "Misc=Test2=Two&Test3=Three";
  347. document.cookie = "Customer=~|~|";
  348. document.cookie = "Customer=" + strEmail + "&" + strPhone + "&" + strName;
  349. //DisplayCookies();
  350. }
  351. function verifycontent()
  352. {
  353. if(txtEmail.value != "")
  354. {
  355. var OK = 0;
  356. var High = 0;
  357. var str;
  358. var Prev = 0;
  359. str = txtEmail.value;
  360. OK = 1;
  361. High = str.indexOf('.');
  362. if (High == -1)
  363. {
  364. OK = 0;
  365. }
  366. Prev = High;
  367. while (Prev != -1)
  368. {
  369. Prev = str.indexOf('.', Prev + 1);
  370. if (Prev != -1)
  371. {
  372. High = Prev;
  373. }
  374. }
  375. if (str.length == (High + 1))
  376. {
  377. OK = 0;
  378. }
  379. Prev = str.indexOf('@');
  380. if ((Prev == -1) || (Prev > High))
  381. {
  382. OK = 0;
  383. Prev = str.indexOf('@', Prev + 1);
  384. }
  385. //*************Return Results******************
  386. if (Prev != -1)
  387. {
  388. OK = 0;
  389. return true;
  390. }
  391. else
  392. {
  393. alert("<% = L_CUSTOMER_NO_EMAIL_ERRORMESSAGE %>");
  394. txtEmail.focus();
  395. return false;
  396. }
  397. }
  398. }
  399. function onautosubmit_click()
  400. {
  401. var strEmail;
  402. var bolResults;
  403. var strSearch;
  404. var strPhone;
  405. var x;
  406. var iLength;
  407. var iPos;
  408. var strEventName;
  409. var bolQuotes;
  410. var strEmail;
  411. var strName;
  412. var strPhone;
  413. bolQuotes = false;
  414. strEventName = txtName.value;
  415. for(x=0;x<strEventName.length;x++)
  416. {
  417. if(strEventName.charCodeAt(x) == 34)
  418. {
  419. bolQuotes = true;
  420. }
  421. }
  422. if(bolQuotes == true)
  423. {
  424. alert("<% = L_CUSTOMER_QUOTE_INSTRING_ERRORMESSAGE %>");
  425. txtName.focus();
  426. return;
  427. }
  428. strEventName = txtPhone.value;
  429. for(x=0;x<strEventName.length;x++)
  430. {
  431. if(strEventName.charCodeAt(x) == 34)
  432. {
  433. bolQuotes = true;
  434. }
  435. }
  436. if(bolQuotes == true)
  437. {
  438. alert("<% = L_CUSTOMER_QUOTE_INSTRING_ERRORMESSAGE %>");
  439. txtPhone.focus();
  440. return;
  441. }
  442. strEventName = txtEmail.value;
  443. for(x=0;x<strEventName.length;x++)
  444. {
  445. if(strEventName.charCodeAt(x) == 34)
  446. {
  447. bolQuotes = true;
  448. }
  449. }
  450. if(bolQuotes == true)
  451. {
  452. alert("<% = L_CUSTOMER_QUOTE_INSTRING_ERRORMESSAGE %>");
  453. txtEmail.focus();
  454. return;
  455. }
  456. if(verifycontent() == false)
  457. {
  458. return;
  459. }
  460. if(txtName.value == "")
  461. {
  462. strName = "txtCustomerName=~|~|" ;
  463. }
  464. else
  465. {
  466. strName = "txtCustomerName=" + escape(txtName.value);
  467. }
  468. if(txtPhone.value=="")
  469. {
  470. strPhone = "txtCustomerPhone=~|~|";
  471. }
  472. else
  473. {
  474. strPhone = "txtCustomerPhone=" + escape(txtPhone.value);
  475. }
  476. if(txtEmail.value=="")
  477. {
  478. strEmail = "txtCustomerEmail=~|~|";
  479. }
  480. else
  481. {
  482. strEmail = "txtCustomerEmail=" + escape(txtEmail.value);
  483. }
  484. //SaveData();document.cookie = "Misc=Test2=Two&Test3=Three";
  485. document.cookie = "Customer=~|~|";
  486. document.cookie = "Customer=" + strEmail + "&" + strPhone + "&" + strName;
  487. window.navigate("submit.asp");
  488. }
  489. function onsubmit_click()
  490. {
  491. var strEventName;
  492. var bolQuotes;
  493. var strEmail;
  494. var strName;
  495. var strPhone;
  496. bolQuotes = false;
  497. strEventName = txtName.value;
  498. for(x=0;x<strEventName.length;x++)
  499. {
  500. if(strEventName.charCodeAt(x) == 34)
  501. {
  502. bolQuotes = true;
  503. }
  504. }
  505. if(bolQuotes == true)
  506. {
  507. alert("<% = L_CUSTOMER_QUOTE_INSTRING_ERRORMESSAGE %>");
  508. txtName.focus();
  509. return;
  510. }
  511. strEventName = txtPhone.value;
  512. for(x=0;x<strEventName.length;x++)
  513. {
  514. if(strEventName.charCodeAt(x) == 34)
  515. {
  516. bolQuotes = true;
  517. }
  518. }
  519. if(bolQuotes == true)
  520. {
  521. alert("<% = L_CUSTOMER_QUOTE_INSTRING_ERRORMESSAGE %>");
  522. txtPhone.focus();
  523. return;
  524. }
  525. strEventName = txtEmail.value;
  526. for(x=0;x<strEventName.length;x++)
  527. {
  528. if(strEventName.charCodeAt(x) == 34)
  529. {
  530. bolQuotes = true;
  531. }
  532. }
  533. if(bolQuotes == true)
  534. {
  535. alert("<% = L_CUSTOMER_QUOTE_INSTRING_ERRORMESSAGE %>");
  536. txtEmail.focus();
  537. return;
  538. }
  539. if(verifycontent() == false)
  540. {
  541. return;
  542. }
  543. if(txtName.value == "")
  544. {
  545. strName = "txtCustomerName=~|~|" ;
  546. }
  547. else
  548. {
  549. strName = "txtCustomerName=" + escape(txtName.value);
  550. }
  551. if(txtPhone.value=="")
  552. {
  553. strPhone = "txtCustomerPhone=~|~|";
  554. }
  555. else
  556. {
  557. strPhone = "txtCustomerPhone=" + escape(txtPhone.value);
  558. }
  559. if(txtEmail.value=="")
  560. {
  561. strEmail = "txtCustomerEmail=~|~|";
  562. }
  563. else
  564. {
  565. strEmail = "txtCustomerEmail=" + escape(txtEmail.value);
  566. }
  567. //SaveData();document.cookie = "Misc=Test2=Two&Test3=Three";
  568. document.cookie = "Customer=~|~|";
  569. document.cookie = "Customer=" + strEmail + "&" + strPhone + "&" + strName;
  570. window.navigate("locate.asp");
  571. }
  572. function privacy_onclick()
  573. {
  574. var strEmail;
  575. var strName;
  576. var strPhone;
  577. if(verifycontent() == false)
  578. {
  579. return;
  580. }
  581. if(txtName.value == "")
  582. {
  583. strName = "txtCustomerName=~|~|" ;
  584. }
  585. else
  586. {
  587. strName = "txtCustomerName=" + escape(txtName.value);
  588. }
  589. if(txtPhone.value=="")
  590. {
  591. strPhone = "txtCustomerPhone=~|~|";
  592. }
  593. else
  594. {
  595. strPhone = "txtCustomerPhone=" + escape(txtPhone.value);
  596. }
  597. if(txtEmail.value=="")
  598. {
  599. strEmail = "txtCustomerEmail=~|~|";
  600. }
  601. else
  602. {
  603. strEmail = "txtCustomerEmail=" + escape(txtEmail.value);
  604. }
  605. //SaveData();document.cookie = "Misc=Test2=Two&Test3=Three";
  606. document.cookie = "Customer=~|~|";
  607. document.cookie = "Customer=" + strEmail + "&" + strPhone + "&" + strName;
  608. window.navigate("sprivacy.asp");
  609. }
  610. function DisplayCookies()
  611. {
  612. // cookies are separated by semicolons
  613. var aCookie = document.cookie.split("; ");
  614. var aCrumb = "";
  615. for (var i=0; i < aCookie.length; i++)
  616. {
  617. aCrumb = aCrumb + aCookie[i] + "\r";
  618. }
  619. alert(aCrumb);
  620. }
  621. //-->
  622. </SCRIPT>
  623. <%
  624. End if
  625. %>
  626. <!--#include file="..\include\asp\foot.asp"-->