Source code of Windows XP (NT5)
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.

64 lines
1.9 KiB

  1. <%
  2. Response.Expires = 0
  3. %>
  4. <html>
  5. <!--
  6. Add/delete links ( attachments, linked bugs ) for a given bug
  7. Form : bugid=# ( bug # )
  8. type=# ( link type: 3 = attach file, 1= related bugs, 0=duplicate, 6=dependent
  9. linkedbug=#
  10. action=add/del
  11. tokenid=TokenId for links table updates
  12. linkid=#
  13. -->
  14. <head>
  15. </head>
  16. <body bgcolor=#c0c0c0>
  17. <%
  18. Set Conn = Server.CreateObject("ADODB.Connection")
  19. Set Comm = Server.CreateObject("ADODB.Command")
  20. Set RS = Server.CreateObject("ADODB.Recordset")
  21. Conn.Open Session("DSN")
  22. Set Comm.ActiveConnection = Conn
  23. RS.CursorType = adOpenStatic
  24. Set RS.Source = Comm
  25. Response.Write "Updating database..."
  26. Select Case Request.Form("action")
  27. case "add"
  28. Conn.BeginTrans
  29. Comm.CommandText = "Select IsNull(Max(LinkID)+1,1) from links"
  30. RS.Open
  31. lid = RS(0)
  32. RS.Close
  33. v = "insert into links(LinkID, BugID, FileName, OriginalName, LinkedBugID, DataString, TokenID, Type, fDeleted, Rev) VALUES(" & lid & ", " & Request.Form("bugid") & ", '', '', " & Request.Form("linkedbug") & ", '', " & Request.Form("tokenid") & ", " & Request.Form("type") & ", 0, 1)"
  34. rem Response.Write v
  35. Conn.Execute v
  36. Conn.CommitTrans
  37. case "del"
  38. v = "delete from links where LinkID=" & Request.Form("linkid")
  39. rem Response.Write v
  40. Conn.Execute v
  41. case "delattach"
  42. rem Comm.CommandText = "Select Filename from links where LinkID=" & Request.Form("linkid")
  43. rem RS.Open
  44. rem fn = RS(0)
  45. rem RS.Close
  46. v = "delete from links where LinkID=" & Request.Form("linkid")
  47. rem Response.Write v
  48. Conn.Execute v
  49. end select
  50. Conn.Close
  51. %>
  52. </body>
  53. <script FOR=window EVENT=onload() language="JavaScript">
  54. history.back();
  55. </script>
  56. </html>