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.

430 lines
14 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\receivedstrings.inc"-->
  5. <%
  6. Dim cnConnection
  7. Dim cmComments
  8. Dim cmHash
  9. Dim cmIncident
  10. Dim strDescription
  11. Dim strFileName
  12. Dim sFileName
  13. Dim iPos
  14. Dim strTextEventName
  15. Dim strIncidentID
  16. Dim strSystem
  17. Dim strPreviousPage
  18. Dim strNotes
  19. Dim strComments
  20. Dim bolDatabaseError
  21. Dim oFileObj
  22. Dim strTempSourceFileName
  23. Dim strTempFileName
  24. Dim bol64Bit
  25. Dim strPrevLoadedFiles
  26. Dim strErrNumber
  27. Dim strErrDescription
  28. Dim strFailureNumber
  29. Dim strHash
  30. Dim strEventName
  31. Dim strName
  32. Dim strPhone
  33. Dim strEmail
  34. on error resume next
  35. If oPassMgrObj.IsAuthenticated(TimeWindow, ForceLogin) = false then
  36. Response.Redirect("http://" & Request.ServerVariables("SERVER_NAME") & "/welcome.asp")
  37. Response.End
  38. end if
  39. Call CVerifyEntry
  40. Call CSetPreviousPage
  41. Call CCreateObjects
  42. Call CGetFileName
  43. Call CCreateConnection
  44. if len(strDescription) > 512 then
  45. strDescription = left(strDescription, 512)
  46. end if
  47. CAll CSetMessage
  48. if Request.Cookies("Misc")("auto") = "True" then
  49. Call CSetCustomer
  50. End if
  51. Call CSetIncident
  52. if Request.Cookies("Misc")("unassoc") = "true" then
  53. Call CGetIncidentID
  54. end if
  55. Response.Cookies("Misc")("unassoc") = "false"
  56. if bolDatabaseError = true then
  57. Response.Write "<br><div class='divLoad'><p class='clsPTitle'>" & L_COMMENTS_DATABASE_FAILURE_ERRORMESSAGE & "</p>"
  58. Response.Write "<p class='clsPBody'>" & L_COMMENTS_DATABASE_FAILUREBODY_ERRORMESSAGE & "</p>"
  59. Response.Write "<p class='clsPBody'>Error Number:" & strErrNumber & "</p>"
  60. Response.Write "<p class='clsPBody'>Failure Number:" & strFailureNumber & "</p>"
  61. Response.Write "<p class='clsPBody'>Error Description:" & strErrDescription & "</p></div>"
  62. %>
  63. <!--#include file="..\include\asp\foot.asp"-->
  64. <%
  65. Response.End
  66. end if
  67. Call CDestroyObjects
  68. strFileName = split(Request.Cookies("ocaFileName"), ",")
  69. Response.Cookies("optFile") = 0
  70. '_____________________________________________________________________________________________________________________
  71. 'Sub Procedures
  72. Private Sub CSetMessage
  73. if Request.QueryString("Bit") = "1" then
  74. cnConnection.Execute("SetMessage " & clng(strIncidentID) & ", 10, 1")
  75. end if
  76. End Sub
  77. Private Sub CSetIncident
  78. on error resume next
  79. 'if Request.Cookies("Misc")("privacy") <> "True" then
  80. Call CSetHash
  81. 'end if
  82. strTextEventName = Request.Cookies("txtEventName")
  83. if Len(strTextEventName) = 4 and strTExtEventName = "~|~|" then
  84. strTextEventName = ""
  85. end if
  86. if len(strTextEventName) > 512 then strTextEventName = Left(strTextEventName, 512)
  87. if Request.Cookies("Misc")("auto") <> "True" then
  88. 'strSystem = Request.Cookies("selSystem")
  89. strSystem = Request.Cookies("selSystem")
  90. else
  91. strSystem = NULL
  92. 'strSystem = Request.Cookies("selSystem")
  93. end if
  94. if strSystem = "" then strSystem = 0
  95. if strSystem = "8" then strSystem = "10"
  96. strComments = Request.Cookies("txtComments")
  97. strNotes = Request.Cookies("txtNotes")
  98. if Len(strNotes) = 4 and strNotes = "~|~|" then
  99. strNotes = ""
  100. else
  101. strNotes = left(trim(strNotes), 1024)
  102. end if
  103. if Len(strComments) = 4 and strComments = "~|~|" then
  104. strComments = ""
  105. else
  106. strComments = left(trim(strComments), 1024)
  107. end if
  108. with cmIncident
  109. .ActiveConnection = cnConnection
  110. .CommandText = "SetIncident"
  111. .CommandType = adCmdStoredProc
  112. .CommandTimeout = strGlobalCommandTimeout
  113. .Parameters.Append .CreateParameter("@IncidentID", adInteger, adParamInput, , 0)
  114. .Parameters.Append .CreateParameter("@OSVersion", adVarWChar, adParamInput, 16, "")
  115. .Parameters.Append .CreateParameter("@Description", adVarWChar, adParamInput, 512, "")
  116. .Parameters.Append .CreateParameter("@Display", adVarWChar, adParamInput, 256, "")
  117. .Parameters.Append .CreateParameter("@Repro", adVarWChar, adParamInput, 1024, "")
  118. .Parameters.Append .CreateParameter("@Comments", adVarWChar, adParamInput, 1024, "")
  119. .Parameters.Append .CreateParameter("@TrackID", adVarWChar, adParamInput, 16, "")
  120. '.Execute
  121. end with
  122. with cmIncident
  123. .Parameters(0).Value = clng(strIncidentID)
  124. .Parameters(1).Value = trim(left(strSystem, 16))
  125. .Parameters(2).Value = trim(left(strTextEventName, 512))
  126. .Parameters(3).Value = trim(Left(sFileName, 256))
  127. .Parameters(4).Value = strNotes
  128. .Parameters(5).Value = strComments
  129. .Parameters(6).Value = trim(Hex(Date()) & Hex(strIncidentID))
  130. .Execute
  131. end with
  132. if cnConnection.Errors.Count > 0 then
  133. bolDatabaseError = true
  134. strErrNumber = cnConnection.Errors(0).Number
  135. strErrDescription = cnConnection.Errors(0).Description
  136. strFailureNumber = 1
  137. end if
  138. End Sub
  139. Private Sub CSetHash
  140. on error resume next
  141. strHash = Request.Cookies("strHash")
  142. with cmHash
  143. .ActiveConnection = cnConnection
  144. .CommandText = "SetHash"
  145. .CommandType = adCmdStoredProc
  146. .CommandTimeout = strGlobalCommandTimeout
  147. .Parameters.Append .CreateParameter("@IncidentID", adInteger, adParamInput, , clng(strIncidentID))
  148. .Parameters.Append .CreateParameter("@DumpHash", adVarWChar, adParamInput, 33, strHash)
  149. .Execute
  150. end with
  151. if cnConnection.Errors.Count > 0 then
  152. bolDatabaseError = true
  153. strErrNumber = cnConnection.Errors(0).Number
  154. strErrDescription = cnConnection.Errors(0).Description
  155. strFailureNumber = 2
  156. cnConnection.Errors.Clear
  157. end if
  158. End Sub
  159. Private Sub CSetCustomer
  160. on error resume next
  161. strName = Request.Cookies("Customer")("txtCustomerName")
  162. strPhone = Request.Cookies("Customer")("txtCustomerPhone")
  163. strEmail = Request.Cookies("Customer")("txtCustomerEmail")
  164. if Len(strName)=4 and strName="~|~|" then
  165. strName = ""
  166. end if
  167. if Len(strPhone)=4 and strPhone="~|~|" then
  168. strPhone = ""
  169. end if
  170. if Len(strEmail)=4 and strEmail="~|~|" then
  171. strEmail = ""
  172. end if
  173. with cmComments
  174. .ActiveConnection = cnConnection
  175. .CommandText = "SetCustomer"
  176. .CommandType = adCmdStoredProc
  177. .CommandTimeout = strGlobalCommandTimeout
  178. .Parameters.Append .CreateParameter("@HighID", adInteger, adParamInput, , clng(oPassMgrObj.Profile("MemberIdHigh")))
  179. .Parameters.Append .CreateParameter("@LowID", adInteger, adParamInput, , clng(oPassMgrObj.Profile("MemberIdLow")))
  180. .Parameters.Append .CreateParameter("@EMail", adVarWChar, adParamInput, 128, trim(left(strEmail, 128)))
  181. .Parameters.Append .CreateParameter("@Contact", adVarWChar, adParamInput, 32, trim(left(strName, 32)))
  182. .Parameters.Append .CreateParameter("@Phone", adVarWChar, adParamInput, 16, trim(left(strPhone, 16)))
  183. .Parameters.Append .CreateParameter("@PremierID", adVarWChar, adParamInput, 16, cstr(Request.Cookies("intCustomerPremierID")))
  184. .Parameters.Append .CreateParameter("@Lang", adVarWChar, adParamInput, 4, strAbb)
  185. .Execute
  186. end with'Verify no errors
  187. if cnConnection.Errors.Count > 0 then
  188. bolDatabaseError = true
  189. strErrNumber = cnConnection.Errors(0).Number
  190. strErrDescription = cnConnection.Errors(0).Description
  191. strFailureNumber = 3
  192. cnConnection.Errors.Clear
  193. end if
  194. End Sub
  195. Private Sub CGetIncidentID
  196. on error resume next
  197. set rs = cnConnection.Execute("GetIncident " & oPassMgrObj.Profile("MemberIdHigh") & ", " & oPassMgrObj.Profile("MemberIdLow") & ", " & clng(strIncidentID))
  198. if cnConnection.Errors.Count > 0 then
  199. Response.Write "<br><div class='divLoad'><p class='clsPTitle'>" & L_COMMENTS_UNABLE_TOCONNECT_ERRORMESSAGE & "</p>"
  200. Response.Write "<p class='clsPBody'>" & L_COMMENTS_DATABASE_FAILED_TEXT & "</p></div>"
  201. cnConnection.Errors.Clear
  202. Call CDestroyObjects
  203. %>
  204. <!--#include file="..\include\asp\foot.asp"-->
  205. <%
  206. Response.End
  207. end if
  208. End Sub
  209. Private Sub CCreateConnection
  210. on error resume next
  211. 'Open the connection to the database the constant is located in the dataconnections.inc
  212. with cnConnection
  213. .ConnectionString = strCustomer
  214. .CursorLocation = adUseClient
  215. .ConnectionTimeout = strGlobalConnectionTimeout
  216. .Open
  217. end with
  218. 'If unable to conect with the database then display message
  219. if cnConnection.State = adStateClosed then
  220. Response.Write "<br><div class='divLoad'><p class='clsPTitle'>" & L_COMMENTS_UNABLE_TOCONNECT_ERRORMESSAGE & "</p>"
  221. Response.Write "<p class='clsPBody'>" & L_COMMENTS_CONNECTION_FAILED_TEXT & "</p></div>"
  222. Response.Write "<p class='clsPBody'>Error Number:" & cnConnection.Errors(0).Number & "</p>"
  223. Response.Write "<p class='clsPBody'>Error Description:" & cnConnection.Errors(0).Description & "</p></div>"
  224. cnConnection.Errors.Clear
  225. strFailureNumber = 4
  226. Call CDestroyObjects
  227. %>
  228. <!--#include file="..\include\asp\foot.asp"-->
  229. <%
  230. Response.End
  231. end if
  232. End Sub
  233. Private Sub CGetFileName
  234. on error resume next
  235. sFileName = Request.Cookies("ocaFileName")
  236. iPos = Instr(1, sFileName, ",")
  237. sFileName = Left(sFileName, iPos - 1)
  238. if InstrRev(sFileName, "/") <> 0 then
  239. sFileName = Right(sFileName, len(sFileName) - InStrRev(sFileName, "/"))
  240. elseif InstrRev(sFileName, "\") <> 0 then
  241. sFileName = Right(sFileName, len(sFileName) - InStrRev(sFileName, "\"))
  242. end if
  243. End Sub
  244. Private Sub CCreateObjects
  245. on error resume next
  246. bol64Bit = false
  247. bolDatabaseError = false
  248. strIncidentID = Request.Cookies("Misc")("txtIncidentID")
  249. 'Create connection, command and recordset objects
  250. set cnConnection = CreateObject("ADODB.Connection")
  251. set cmComments = CreateObject("ADODB.Command")
  252. set cmHash = CreateObject("ADODB.Command")
  253. set cmIncident = CreateObject("ADODB.Command")
  254. Set oFileObj = CreateObject("Scripting.FileSystemObject")
  255. End Sub
  256. Private Sub CDestroyObjects
  257. on error resume next
  258. 'Close connection object and set ado objects to nothing
  259. if cnConnection.State = adStateOpen then cnConnection.Close
  260. set cmIncident = nothing
  261. set cmComments = nothing
  262. set cmHash = nothing
  263. set cnConnection = nothing
  264. End Sub
  265. Private Sub CSetPreviousPage
  266. on error resume next
  267. strPreviousPage = Request.ServerVariables("SCRIPT_NAME")
  268. strPreviousPage = Right(strPreviousPage, len(strPreviousPage) - Instrrev(strPreviousPage, "/"))
  269. Response.Cookies("Misc")("PreviousPage") = strPreviousPage
  270. End Sub
  271. Private Sub CVerifyEntry
  272. on error resume next
  273. if Trim(Request.Cookies("Misc")("PreviousPage")) <> "submit.asp" and Trim(Request.Cookies("Misc")("PreviousPage")) <> "view.asp" then
  274. Response.Redirect("http://" & Request.ServerVariables("SERVER_NAME") & "/welcome.asp")
  275. Response.End
  276. end if
  277. End Sub
  278. '_____________________________________________________________________________________________________________________
  279. %>
  280. <form id="frmMain" name="frmMain">
  281. <div class="clsDiv">
  282. <%
  283. if bolDatabaseError = false then
  284. %>
  285. <p class="clsPTitle">
  286. <% = L_RECEIVED_FILE_ONE_TEXT %> <% = L_RECEIVED_FILE_TWO_TEXT %>
  287. </p>
  288. <%
  289. end if
  290. %>
  291. <p class="clsPBody">
  292. <%
  293. Response.Write L_RECEIVED_SUCCESS_PARTONE_TEXT
  294. Response.Write "<pre class='clsPreBody'>" & sFileName
  295. Response.write L_RECEIVED_SUCCESS_PARTTWO_TEXT
  296. Response.Write "</p></pre><p class='clsPBody'>" & L_RECEIVED_THANK_YOU_TEXT
  297. %>
  298. </p>
  299. </div>
  300. <br>
  301. <div class="clsDiv">
  302. <img Alt="<% = L_WELCOME_GO_IMAGEALT_TEXT %>" border="0" src="../include/images/go.gif" width="24" height="24"><a class="clsALink" href="https://<% =Request.ServerVariables("SERVER_NAME") %>/secure/status.asp"><% = L_RECEIVED_STATUS_LINK_TEXT %></a>
  303. <br>
  304. <img Alt="<% = L_WELCOME_GO_IMAGEALT_TEXT %>" border="0" src="../include/images/go.gif" width="24" height="24"><a class="clsALink" href="https://<% =Request.ServerVariables("SERVER_NAME") %>/secure/locate.asp"><% = L_RECEIVED_NEWFILE_LINK_TEXT %></a>
  305. </div>
  306. <Input type="hidden" id="txtFileName" name="txtFileName" value="<% = sFileName & ", " & Date & ", "%>">
  307. </form>
  308. <%
  309. Response.Cookies("Misc")("txtIncidentID") = "~|~|"
  310. Response.Cookies("Misc")("auto") = "False"
  311. Response.Cookies("Misc")("privacy") = "1"
  312. %>
  313. <SCRIPT LANGUAGE=javascript>
  314. <!--
  315. window.onload = SaveData;
  316. function SaveData()
  317. {
  318. var oTimeNow = new Date(); // Start Time
  319. var sExpirationDate;
  320. var strUploadedFiles;
  321. var strCookies;
  322. var bolResults = false;
  323. var y;
  324. var strFileName;
  325. var strFile;
  326. var oTimeExpiresNow = new Date();
  327. //Get previous uploads
  328. strUploadedFiles = LoadData();
  329. if(strUploadedFiles==null)
  330. {
  331. spnUserData.setAttribute("UploadedFiles", frmMain.txtFileName.value);
  332. }
  333. else
  334. {
  335. strCookies = strUploadedFiles.split(",");
  336. strFileName = frmMain.txtFileName.value;
  337. strFile = strFileName.split(",");
  338. for(y=0;y < strCookies.length-1;y++)
  339. {
  340. if(strCookies[y] == strFile[0])
  341. {
  342. bolResults = true;
  343. }
  344. }
  345. if(bolResults==false)
  346. {
  347. spnUserData.setAttribute("UploadedFiles", strUploadedFiles + frmMain.txtFileName.value);
  348. }
  349. }
  350. oTimeNow.setYear(oTimeNow.getYear() + 2);
  351. sExpirationDate = oTimeNow.toUTCString();
  352. spnUserData.expires = sExpirationDate;
  353. spnUserData.save("OCADataStore");
  354. document.cookie = "txtEventName = ~|~|;expires=" + oTimeExpiresNow + ";";
  355. document.cookie = "txtNotes = ~|~|;expires=" + oTimeExpiresNow + ";";
  356. document.cookie = "txtComments = ~|~|;expires=" + oTimeExpiresNow + ";";
  357. document.cookie = "ocaFileName = ~|~|;expires=" + oTimeExpiresNow + ";";
  358. document.cookie = "selSystem = 0";
  359. //var iHeight = window.screen.availHeight;
  360. //var iWidth = window.screen.availWidth;
  361. //iWidth = iWidth / 2;
  362. //iHeight = iHeight / 3.8;
  363. //var iTop = (window.screen.width / 2) - (iWidth / 2);
  364. //var iLeft = (window.screen.height / 2) - (iHeight / 2);
  365. //iResults = window.open("secondlevelupload.asp", "", "top=" + iTop + ",left=" + iLeft + ",height=" + iHeight + ",width=" + iWidth + ",status=yes,toolbar=no,menubar=no");
  366. }
  367. function LoadData()
  368. {
  369. var Attribute;
  370. spnUserData.load("OCADataStore");
  371. Attribute = spnUserData.getAttribute("UploadedFiles");
  372. return Attribute;
  373. }
  374. function DisplayCookies()
  375. {
  376. // cookies are separated by semicolons
  377. var aCookie = document.cookie.split("; ");
  378. var aCrumb = "";
  379. for (var i=0; i < aCookie.length; i++)
  380. {
  381. aCrumb = aCrumb + aCookie[i] + "\r";
  382. }
  383. alert(aCrumb);
  384. }
  385. //-->
  386. </SCRIPT>
  387. <!--#include file="..\include\asp\foot.asp"-->
  388. <%
  389. Response.Cookies("txtEventName") = "~|~|"
  390. Response.Cookies("selSystem") = "0"
  391. %>