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.

61 lines
2.3 KiB

  1. <%' CODEPAGE=65001 'UTF-8%>
  2. <%' certsbrt.asp - (CERT)srv web - (S)cript: determine (BR)owser (T)ype
  3. ' Copyright (C) Microsoft Corporation, 1998 - 1999
  4. ' first, make sure we have the right URL to prevent cookie problems.
  5. If "/certsrv" <> Left(Request.ServerVariables("URL"), 8) Then
  6. If 0<>Len(Request.ServerVariables("QUERY_STRING")) Then
  7. Response.Redirect "/certsrv" & Mid(Request.ServerVariables("URL"), 9) & "?" & Request.ServerVariables("QUERY_STRING")
  8. Else
  9. Response.Redirect "/certsrv" & Mid(Request.ServerVariables("URL"), 9)
  10. End If
  11. Response.End
  12. End If
  13. ' We know of three browser types
  14. ' sBrowser =
  15. ' "IE" - IE (use XEnroll) - javascript available - DHTML available
  16. ' "NN" - Netscape Navigator (use Keygen) - javascript available - no DHTML
  17. ' "Text" - Lynx or other minimal browser - no javascript - no DHTML
  18. ' Also, we have a flag we can set when we see an old version of IE.
  19. ' bRecommendUpgrade =
  20. ' True - old version of IE
  21. ' False - other unsupported browser
  22. ' bNewThanNT4, boolean to determine browser client platform os version
  23. Dim sBrowser, bRecommendUpgrade, bNewThanNT4
  24. bNewThanNT4 = False
  25. sBrowser=Request.ServerVariables("HTTP_USER_AGENT")
  26. If 0=InStr(sBrowser, "Mozilla") Then
  27. 'Lynx or other minimal browser
  28. sBrowser="Text"
  29. bRecommendUpgrade=False
  30. ElseIf 0=InStr(sBrowser, "MSIE") Then
  31. 'Netscape Navigator
  32. sBrowser="NN"
  33. bRecommendUpgrade=False
  34. ElseIf CInt(Mid(sBrowser, InStr(sBrowser, "MSIE")+5, 1))<4 Then
  35. 'Too Old Internet Explorer
  36. sBrowser="Text"
  37. bRecommendUpgrade=True
  38. ElseIf 0=InStr(sBrowser, "Win") Or (0=InStr(sBrowser, "95") _
  39. And 0=InStr(sBrowser, "98") And 0=InStr(sBrowser, "2000") _
  40. And 0=InStr(sBrowser, "NT")) Then
  41. 'unsupported platform Internet Explorer (eg, Mac, Unix, Win16)
  42. sBrowser="Text"
  43. bRecommendUpgrade=False
  44. ElseIf "Alpha"=Request.ServerVariables("HTTP_UA_CPU") Then
  45. 'NT4 IE4 Alpha, we are no longer building XEnroll for this platform
  46. sBrowser="Text"
  47. bRecommendUpgrade=False
  48. Else
  49. If 0 <> InStr(sBrowser, "Windows NT 5") Then
  50. bNewThanNT4 = True
  51. End If
  52. 'New Internet Explorer
  53. sBrowser="IE"
  54. bRecommendUpgrade=False
  55. End If
  56. Const L_LabelColWidth_Number=100 ' the standard label-column width in pixels
  57. %>