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.

126 lines
3.6 KiB

  1. <%@Language = Javascript%>
  2. <!-- #INCLUDE file='en/include/SiteLang.asp' -->
  3. <!--#INCLUDE FILE="include/Constants.asp" -->
  4. <!--#INCLUDE FILE="include/DataUtil.asp" -->
  5. <!--#INCLUDE FILE="include/ServerUtil.asp" -->
  6. <meta http-equiv="pics-label" content='(pics-1.1 "http://www.icra.org/ratingsv02.html" l gen true for "http://oca.microsoft.com" r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://oca.microsoft.com" r (n 0 s 0 v 0 l 0))'>
  7. <%
  8. /*
  9. File : ResRedir.asp
  10. Creation Date : 4/11/2001 Solson
  11. Purpose : Redirects users to appropriate response page after dump sumbission
  12. Inputs : SID - Solution ID, numeric.
  13. SC - Stop Code. (REMOVED Per AndreVa 4/12/02)
  14. ID - 128 bit guid identifier
  15. State - State of the solution
  16. 0 = Solved (Just display the answer and survey )
  17. 1 = Generic solution ( Display answer and Offer to track )
  18. 2 = Undefined - future use
  19. 3-4. future use
  20. 5 = STATE_MANUAL
  21. Outputs : ID - Cookie (is the guid)
  22. SID- Cookie
  23. Modification History:
  24. Sample GUID : bc94ebaa-195f-4dcc-a4c5-6722a7f942ff
  25. */
  26. //Set (theoretical)constant values for the various states.
  27. //var STATE_TOTALS = 5 //this is actual 0 and 1. Total states 2
  28. //var STATE_SOLVED = 0;
  29. //var STATE_GENERIC = 1;
  30. //var STATE_UNDEFINED = 2;
  31. //var STATE_MANUAL = 5;
  32. //var ERR_BAD_SOLUTIONID = -2; //Bad solution ID has been passed in
  33. //var ERR_BAD_STOPCODE = -3; //Bad StopCode value has been passed in
  34. //var ERR_UNDEFINED_STATE = -4; //Undefined state . . .
  35. //var ERR_BAD_GUID = -5; //We got ourselves a bad guid
  36. DumpCookies();
  37. var g_nSolutionID = new Number( Request.QueryString( "SID" ) );
  38. var g_GUID = new String( Request.QueryString("ID" ) );
  39. var g_nState = new Number( Request.QueryString( "State" ) );
  40. var g_bDoRedirect = true;
  41. //Start by clearing the cookies
  42. fnClearCookies();
  43. if ( Request.QueryString == "" )
  44. Response.Redirect ( fnGetBrowserLang() + "/Welcome.asp" );
  45. if ( fnVerifyNumber( g_nSolutionID, 0, SOLUTIONID_HIGH_RANGE ) )
  46. {
  47. if ( fnVerifyNumber( g_nState, 0, STATE_COUNT ) )
  48. {
  49. fnWriteCookie( "State", g_nState )
  50. //Since constants are not implemented in the scripting technologies we have to use
  51. //literals:
  52. // 0 == STATE_SOLVED
  53. // 1 == STATE_GENERIC
  54. // 2 == STATE_RESERVED (not implemented yet)
  55. // 3 == ...
  56. switch ( Number( g_nState ) )
  57. {
  58. //For a case of 0, where we have a solution, we are just going to display that
  59. //solution. We don't care if a GUID has been passed.
  60. case 0:
  61. fnWriteCookie ( "SID", g_nSolutionID );
  62. break;
  63. case 1:
  64. fnWriteCookie ( "SID", g_nSolutionID );
  65. if ( fnVerifyGUID( g_GUID) )
  66. fnWriteCookie( "GUID", g_GUID );
  67. else
  68. fnWriteCookie( "GUID", ERR_BAD_GUID );
  69. break;
  70. case 5:
  71. g_bDoRedirect = false;
  72. break;
  73. default:
  74. fnWriteCookie( "SID", ERR_UNDEFINED_STATE );
  75. g_nSolutionID = ERR_BAD_SOLUTIONID;
  76. }
  77. }
  78. else
  79. {
  80. fnWriteCookie( "State", ERR_UNDEFINED_STATE );
  81. }
  82. }
  83. else
  84. {
  85. // g_SolutionID is not a number, would suggest a hack attempt or
  86. // bad input to the page
  87. fnWriteCookie( "SID", ERR_BAD_SOLUTIONID );
  88. g_nSolutionID = ERR_BAD_SOLUTIONID;
  89. }
  90. if ( g_bDoRedirect )
  91. fnDoRedirect()
  92. Response.Write( "Lang: " + Request.ServerVariables( "HTTP_ACCEPT_LANGUAGE" ) );
  93. Response.Write("Querystring: " + Request.QueryString() + "<BR>")
  94. function fnDoRedirect ( )
  95. {
  96. Response.Redirect ( fnGetBrowserLang() + "/Response.asp?SID=" + g_nSolutionID );
  97. }
  98. %>