home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 August / Chip_1999-08_cd.bin / msdn / Library / CODESIGN.ASP < prev    next >
Text File  |  1997-07-21  |  4KB  |  106 lines

  1. <%
  2. 'This script sniffs out the MSIE browser version number and Authenticode 2.
  3. 'The message is given to the user via a message box, therefore there is 
  4. 'no messages for users MSIE 1.x and MSIE 2.x users.  The sniffing is done with 
  5. 'use of the browscap.ini file and the user agent string all on the server side with
  6. 'denali scripting.  
  7. 'Three messages are returned, only one for each user:
  8. 'messagebox1 = 3.0 or 3.0A or 3.0A3 or 3.0B or 3.0B3 users "Download IE3.02 and update to Authenticode 2"
  9. 'messagebox2 = 3.1 users "Download patch and update to Authenticode 2"
  10. 'messagebox3 = 3.02 users "Update to Authenticode 2"
  11. 'If this script is not performing as expected check the user agent string
  12. 'of the computer that is giving you the error, with a denali server side sniff.
  13.  
  14. dim ie30, ie31, needUpdate, loadActivex
  15. set bc = Server.CreateObject("MSWC.BrowserType")
  16. set ua = Request.ServerVariables("HTTP_USER_AGENT")
  17. set lang = Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")
  18. browser = bc.browser
  19. platform = bc.platform
  20. majorver = bc.majorver
  21. minorver = bc.minorver
  22. fullver = majorver & "." & minorver 'returns something like 3.02
  23. needUpdate = false
  24. loadActivex = false
  25. english = false
  26.  
  27. if platform = "WinNT" or platform = "Win95" or platform = "Win32" and browser = "IE" then
  28.     if (fullver = "3.0") or (fullver ="3.0A") or (fullver ="3.0A3") or (fullver = "3.0B") or (fullver = "3.0B3") then 
  29.         ie30 = true    'messagebox1
  30.     end if
  31.     if fullver = "3.01" then 
  32.         ie31 = true    'messagebox2
  33.     end if
  34.     if fullver = "3.02" then
  35.         if instr(ua, "Update a") then 
  36.             needUpdate = false
  37.             loadActivex = true
  38.         else
  39.             needUpdate = true 'messagebox3
  40.         end if
  41.     end if
  42.     if majorver = "4" then
  43.         loadActivex = true
  44.     end if
  45. end if
  46.  
  47. If lang = "en" then
  48.     english = true
  49. end if
  50. %>
  51.  
  52. <HTML>
  53. <HEAD>
  54. <SCRIPT LANGUAGE="VBScript">
  55. <!--
  56. option explicit
  57.  
  58. Sub window_onLoad()
  59.     <% if ie30 and english then %>
  60.         messagebox
  61.     <% end if %>
  62.     <% if ie31 and english then %>
  63.         messagebox2
  64.     <% end if %>
  65.     <% if needUpdate and english then %>
  66.         messagebox3
  67.     <% end if %>
  68. end sub
  69.  
  70. <% if ie30 and english then %>
  71. Sub messagebox()
  72. dim intButton
  73. intButton = msgbox ("Microsoft recommends that you download the version of Internet Explorer that contains valuable new security updates. Do you want to do this now?", 4 + 64, "Get the Latest Version of Internet Explorer")
  74. If intButton = 6 then
  75.     top.location.href="http://www.microsoft.com/msdownload/ieplatform/iewin95.htm"
  76. end if
  77. end sub
  78. <% end if %>
  79.  
  80. <% if ie31 and english then %>
  81. Sub messagebox2()
  82. dim intButton
  83. intButton = msgbox ("Microsoft recommends that you download the Internet Explorer 3.01 to 3.02 Upgrade package, which contains valuable new security updates. This upgrade package will allow you to update your current version of Internet Explorer to 3.02 without having to do a full download. Do you want to do this now?", 4 + 64, "Upgrade to the Latest Version of Internet Explorer")
  84. If intButton = 6 then
  85.     top.location.href="http://www.microsoft.com/msdownload/ieplatform/iewin95.htm"
  86. end if
  87. end sub
  88. <% end if %>
  89.  
  90. <% if needUpdate and english then %>
  91. Sub messagebox3()
  92. dim intButton
  93. intButton = msgbox ("Get Authenticode 2.0. This update includes valuable new features and renews key Authenticode certificates that help you safely download software from the Web. The update should take less than 5 minutes to download over a 28.8 Kbps modem. Do you want to visit our Authenticode Update page?", 4 + 64, "Download the Authenticode 2.0 Update Now!")
  94. If intButton = 6 then
  95.     top.location.href="http://www.microsoft.com/ie/security/?/ie/security/authent2.htm"
  96. end if
  97. end sub
  98. <% end if %>
  99. -->
  100. </SCRIPT>
  101. <TITLE></TITLE>
  102. </HEAD>
  103. <BODY>
  104. Test Page
  105. </BODY>
  106. </HTML>