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.

791 lines
26 KiB

  1. <% '===========================================================================
  2. ' Module: inc_pagekey.asp
  3. '
  4. ' Synopsis: Contains checks and helper functions related to page keys, which
  5. ' are used to validate that requests originated from other pages
  6. ' within the admin web site.
  7. '
  8. ' Copyright (c) Microsoft Corporation. All rights reserved.
  9. '===========================================================================
  10. On Error Resume Next
  11. '
  12. ' Constants
  13. '
  14. Const SAI_FLD_PAGEKEY = "__SAPageKey"
  15. Const SAI_FLD_ERRORSTRING1 = "__SAPageKeyError1"
  16. Const SAI_FLD_ERRORSTRING2 = "__SAPageKeyError2"
  17. Const SAI_FLD_ERRORSTRING3 = "__SAPageKeyError3"
  18. Const SAI_FLD_ERRORTITLE = "__SAPageKeyErrorTitle"
  19. Const SAI_FLD_BUTTONTEXT = "__SAPageKeyButtonText"
  20. Const SAI_STR_E_UNEXPECTED = "An unexpected problem occurred. Restart the server. If the problem persists, you might need to repair your operating system."
  21. Const SAI_PK_E_UNAUTHORIZED = 1
  22. Const SAI_PK_E_UNEXPECTED = 2
  23. Dim SAI_PK_strServerName
  24. SAI_PK_strServerName = Request.ServerVariables("SERVER_NAME")
  25. '
  26. ' Set the Language ID for this session based on the browser language
  27. '
  28. Call SetLCID ()
  29. '
  30. ' Set CodePage for the Server, this will always be UTF-8
  31. '
  32. Session.CodePage = 65001
  33. Response.CharSet = "utf-8"
  34. '
  35. ' Check for error display requests before normal processing. Note that
  36. ' all localized strings were passed from the caller, so we don't need to
  37. ' retrieve them ourselves.
  38. '
  39. If ("POST" = Request.ServerVariables("REQUEST_METHOD")) Then
  40. If (1 = Request.Form(SAI_FLD_ERRORSTRING1).Count) Then
  41. '
  42. ' Display the error and end the request.
  43. '
  44. Call SAI_DisplayPageKeyError()
  45. Response.End
  46. End If
  47. End If
  48. '
  49. ' Localized strings
  50. '
  51. Dim L_PK_ERRORTITLE_TEXT
  52. L_PK_ERRORTITLE_TEXT = SA_GetLocString("sacoremsg.dll", "40201388", "")
  53. Dim L_PK_CLOSEBUTTON_TEXT
  54. L_PK_CLOSEBUTTON_TEXT = SA_GetLocString("sacoremsg.dll", "40201389", "")
  55. Dim L_PK_UNAUTHORIZEDLINE1_TEXT
  56. L_PK_UNAUTHORIZEDLINE1_TEXT = SA_GetLocString("sacoremsg.dll", "C020138A", _
  57. Array(SAI_PK_strServerName))
  58. Dim L_PK_UNAUTHORIZEDLINE2_TEXT
  59. L_PK_UNAUTHORIZEDLINE2_TEXT = SA_GetLocString("sacoremsg.dll", "C020138B", _
  60. Array(SAI_PK_strServerName))
  61. Dim L_PK_UNAUTHORIZEDLINE3_TEXT
  62. L_PK_UNAUTHORIZEDLINE3_TEXT = SA_GetLocString("sacoremsg.dll", "C020138C", "")
  63. Dim L_PK_UNEXPECTED_TEXT
  64. L_PK_UNEXPECTED_TEXT = SA_GetLocString("sacoremsg.dll", "C020138D", "")
  65. If (0 = Len(L_PK_UNEXPECTED_TEXT) Or _
  66. "C020138D" = L_PK_UNEXPECTED_TEXT) Then
  67. L_PK_UNEXPECTED_TEXT = SAI_STR_E_UNEXPECTED
  68. End If
  69. '---------------------------------------------------------------------------
  70. '
  71. ' Function: SAI_GetPageKey
  72. '
  73. ' Synopsis: Gets the key associated with the current user for this
  74. ' session. If no key has yet been assigned, a new one is
  75. ' generated, stored, and returned.
  76. '
  77. ' Arguments: None.
  78. '
  79. ' Returns: The key or "" if none could be found or generated.
  80. '
  81. '---------------------------------------------------------------------------
  82. Function SAI_GetPageKey()
  83. On Error Resume Next
  84. SAI_GetPageKey = ""
  85. '
  86. ' If we have already assigned a key to this session, get that.
  87. '
  88. If (Not IsEmpty(Session(SAI_FLD_PAGEKEY))) Then
  89. SAI_GetPageKey = Session(SAI_FLD_PAGEKEY)
  90. Else
  91. '
  92. ' No existing key. Generate a new one.
  93. '
  94. Dim oCryptRandom
  95. Set oCryptRandom = Server.CreateObject("COMhelper.CryptRandom")
  96. Dim strNewKey
  97. strNewKey = oCryptRandom.GetRandomHexString(16) ' 128 bits
  98. If (Err.number <> 0) Then
  99. Call SAI_ReportPageKeyError(SAI_PK_E_UNEXPECTED)
  100. Exit Function
  101. End If
  102. Session(SAI_FLD_PAGEKEY) = strNewKey
  103. SAI_GetPageKey = strNewKey
  104. End If
  105. End Function
  106. '---------------------------------------------------------------------------
  107. '
  108. ' Sub: SAI_VerifyPageKey
  109. '
  110. ' Synopsis: Gets the key associated with the current user for this
  111. ' session and compares it to the received key. Delivers the
  112. ' correct error and ends the response if the received key
  113. ' is not valid.
  114. '
  115. ' Arguments: strReceivedKey: The key received from the client.
  116. '
  117. '---------------------------------------------------------------------------
  118. Sub SAI_VerifyPageKey(strReceivedKey)
  119. '
  120. ' Check for session timeout. If we received a key, but we haven't yet
  121. ' generated one, our best guess is that the received key is from an old
  122. ' session that timed out.
  123. '
  124. If ("" <> strReceivedKey And IsEmpty(Session(SAI_FLD_PAGEKEY))) Then
  125. Call SAI_ReportPageKeyError(SAI_PK_E_UNAUTHORIZED)
  126. Exit Sub
  127. End If
  128. '
  129. ' Get the expected key. Fail the request if this step fails.
  130. '
  131. Dim strExpectedKey
  132. strExpectedKey = SAI_GetPageKey()
  133. If ("" = strExpectedKey) Then
  134. Call SAI_ReportPageKeyError(SAI_PK_E_UNEXPECTED)
  135. Exit Sub
  136. End If
  137. '
  138. ' Compare the expected key to the key we received.
  139. '
  140. If (strExpectedKey <> strReceivedKey) Then
  141. Call SAI_ReportPageKeyError(SAI_PK_E_UNAUTHORIZED)
  142. Exit Sub
  143. End If
  144. End Sub
  145. '----------------------------------------------------------------------------
  146. '
  147. ' Function : getBroswerLanguage
  148. '
  149. ' Synopsis : Serves in getting Browser Default Language ID
  150. '
  151. ' Arguments: None
  152. '
  153. ' Returns : ISO 693 name
  154. '
  155. '----------------------------------------------------------------------------
  156. Function getBrowserLanguage
  157. Err.Clear
  158. Dim strAcceptLanguage
  159. Dim iPos
  160. strAcceptLanguage = Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")
  161. iPos = InStr(1, strAcceptLanguage, ",")
  162. If iPos > 0 Then
  163. strAcceptLanguage = Left(strAcceptLanguage, iPos - 1)
  164. End If
  165. getBrowserLanguage = LCase(strAcceptLanguage)
  166. End Function
  167. '---------------------------------------------------------------------------
  168. '
  169. ' Sub: SAI_ReportPageKeyError
  170. '
  171. ' Synopsis: Ends the session (to prevent attackers from repeatedly
  172. ' attempting to compromise the same key value), and outputs
  173. ' a hidden form that will be submitted back to this page.
  174. ' The form contains the various error strings to display and
  175. ' the button text to use if a close button is desired. The
  176. ' response is then ended to prevent any other code from
  177. ' executing.
  178. '
  179. ' Arguments: nError: The error code. The correct localized strings will
  180. ' be output to the form.
  181. '
  182. '---------------------------------------------------------------------------
  183. Sub SAI_ReportPageKeyError(nError)
  184. On Error Resume Next
  185. If (nError <> SAI_PK_E_UNAUTHORIZED And _
  186. nError <> SAI_PK_E_UNEXPECTED) Then
  187. nError = SAI_PK_E_UNAUTHORIZED
  188. End If
  189. Response.Clear
  190. Session.Abandon
  191. %>
  192. <html>
  193. <head></head>
  194. <body onload="document.getElementById('frmPageKey').submit();">
  195. <form id="frmPageKey" action="/admin/inc_pagekey.asp" method="post"
  196. target="_top">
  197. <input type="hidden" name="<%=SAI_FLD_ERRORTITLE%>"
  198. value="<%=Server.HTMLEncode(L_PK_ERRORTITLE_TEXT)%>">
  199. <% If (nError = SAI_PK_E_UNEXPECTED) Then %>
  200. <input type="hidden" name="<%=SAI_FLD_ERRORSTRING1%>"
  201. value="<%=Server.HTMLEncode(L_PK_UNEXPECTED_TEXT)%>">
  202. <% Else ' nError = SAI_PK_E_UNAUTHORIZED %>
  203. <input type="hidden" name="<%=SAI_FLD_ERRORSTRING1%>"
  204. value="<%=Server.HTMLEncode(L_PK_UNAUTHORIZEDLINE1_TEXT)%>">
  205. <input type="hidden" name="<%=SAI_FLD_ERRORSTRING2%>"
  206. value="<%=Server.HTMLEncode(L_PK_UNAUTHORIZEDLINE2_TEXT)%>">
  207. <input type="hidden" name="<%=SAI_FLD_ERRORSTRING3%>"
  208. value="<%=Server.HTMLEncode(L_PK_UNAUTHORIZEDLINE3_TEXT)%>">
  209. <input type="hidden" name="<%=SAI_FLD_BUTTONTEXT%>"
  210. value="<%=Server.HTMLEncode(L_PK_CLOSEBUTTON_TEXT)%>">
  211. <% End If %>
  212. </form>
  213. </body>
  214. </html>
  215. <%
  216. Response.End
  217. End Sub
  218. '---------------------------------------------------------------------------
  219. '
  220. ' Sub: SAI_DisplayPageKeyError
  221. '
  222. ' Synopsis: Reads the form data from the form created by
  223. ' SAI_ReportPageKeyError and displays the error to the user.
  224. ' See SAI_ReportPageKeyError for more information on the data
  225. ' passed through the form.
  226. '
  227. ' Arguments: None. Inputs are read from form variables.
  228. '
  229. '---------------------------------------------------------------------------
  230. Sub SAI_DisplayPageKeyError()
  231. On Error Resume Next
  232. '
  233. ' Read the parameters from the form post.
  234. '
  235. Dim strTitle
  236. If (1 = Request.Form(SAI_FLD_ERRORTITLE).Count) Then
  237. strTitle = Request.Form(SAI_FLD_ERRORTITLE).Item(1)
  238. Else
  239. strTitle = ""
  240. End If
  241. Dim strLine1
  242. strLine1 = Request.Form(SAI_FLD_ERRORSTRING1).Item(1)
  243. If (0 = Len(strLine1)) Then
  244. strLine1 = SAI_STR_E_UNEXPECTED
  245. End If
  246. Dim strLine2
  247. If (1 = Request.Form(SAI_FLD_ERRORSTRING2).Count) Then
  248. strLine2 = Request.Form(SAI_FLD_ERRORSTRING2).Item(1)
  249. Else
  250. strLine2 = ""
  251. End If
  252. Dim strLine3
  253. If (1 = Request.Form(SAI_FLD_ERRORSTRING3).Count) Then
  254. strLine3 = Request.Form(SAI_FLD_ERRORSTRING3).Item(1)
  255. Else
  256. strLine3 = ""
  257. End If
  258. Dim strButtonText
  259. If (1 = Request.Form(SAI_FLD_BUTTONTEXT).Count) Then
  260. strButtonText = Request.Form(SAI_FLD_BUTTONTEXT).Item(1)
  261. Else
  262. strButtonText = ""
  263. End If
  264. '
  265. ' Construct the homepage URL.
  266. '
  267. Dim strHomepageURL
  268. strHomePageURL = "https://" & SAI_PK_strServerName & ":" & _
  269. Request.ServerVariables("SERVER_PORT")
  270. '
  271. ' The following lines are copied from sh_page.asp to avoid circular
  272. ' inclusion of that page by including it here.
  273. '
  274. Response.Buffer = True
  275. Response.ExpiresAbsolute = DateAdd("yyyy", -10, Date)
  276. Response.AddHeader "pragma", "no-cache"
  277. Response.AddHeader "cache-control", "no-store"
  278. '
  279. ' End code copied from sh_page.asp
  280. '
  281. %>
  282. <html>
  283. <head>
  284. <title><%=Server.HTMLEncode(strTitle)%></title>
  285. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  286. <%
  287. '
  288. ' The following lines are copied from
  289. ' SA_EmitAdditionalStyleSheetReferences in sh_page.asp to avoid circular
  290. ' inclusion of that page by including it here.
  291. '
  292. Dim oRetriever
  293. Set oRetriever = Server.CreateObject("Elementmgr.ElementRetriever")
  294. Dim oContainer
  295. Set oContainer = oRetriever.GetElements(1, "CSS")
  296. If (0 = Err.Number) Then
  297. Dim oElement
  298. For each oElement in oContainer
  299. Dim sStyleURL
  300. sStyleURL = Trim(oElement.GetProperty("URL"))
  301. If (0 = Err.Number) Then
  302. If ( Len(sStyleURL) > 0 ) Then
  303. %>
  304. <link rel="STYLESHEET" type="text/css" href="/admin/<%=sStyleURL%>">
  305. <%
  306. End If
  307. End If
  308. Next
  309. End If
  310. '
  311. ' End code copied from sh_page.asp
  312. '
  313. %>
  314. </head>
  315. <body>
  316. <script language="javascript">
  317. function GoHome()
  318. {
  319. if (null != window.opener)
  320. {
  321. window.opener.navigate("<%=strHomePageURL%>");
  322. window.close();
  323. }
  324. else
  325. {
  326. location.href = "/admin/default.asp";
  327. }
  328. }
  329. </script>
  330. <table border="0" width="100%" cellspacing="0" cellpadding="2">
  331. <tr width="100%">
  332. <td width="35">
  333. <img src="/admin/images/critical_errorX32.gif">
  334. </td>
  335. <td width="100%" colspan="3">
  336. <span class="AreaText">
  337. <P><strong><%=Server.HTMLEncode(strTitle)%></strong></P>
  338. </span>
  339. </td>
  340. </tr>
  341. <tr>
  342. <td width="35" colspan="2">&nbsp;</td>
  343. </tr>
  344. <tr>
  345. <td width="35">&nbsp;</td>
  346. <td>
  347. <span class="AreaText">
  348. <%=Server.HTMLEncode(strLine1)%>
  349. </span>
  350. </td>
  351. </tr>
  352. <% If (0 <> Len(strLine2)) Then %>
  353. <tr>
  354. <td width="35" colspan="2">&nbsp;</td>
  355. </tr>
  356. <tr>
  357. <td width="35">&nbsp;</td>
  358. <td>
  359. <span class="AreaText">
  360. <%=Server.HTMLEncode(strLine2)%>
  361. </span>
  362. </td>
  363. </tr>
  364. <% End If
  365. If (0 <> Len(strLine3)) Then %>
  366. <tr>
  367. <td width="35" colspan="2">&nbsp;</td>
  368. </tr>
  369. <tr>
  370. <td width="35">&nbsp;</td>
  371. <td>
  372. <span class="AreaText">
  373. <%=Server.HTMLEncode(strLine3)%>
  374. </span>
  375. </td>
  376. </tr>
  377. <tr>
  378. <td width="35">&nbsp;</td>
  379. <td>
  380. <span class="AreaText">
  381. <a href="javascript: GoHome();">
  382. <%=Server.HTMLEncode(strHomePageURL)%>
  383. </a>
  384. </span>
  385. </td>
  386. </tr>
  387. <% End If
  388. If (0 <> Len(strButtonText)) Then %>
  389. <tr>
  390. <td width="35" colspan="2">&nbsp;</td>
  391. </tr>
  392. <tr>
  393. <td width="35">&nbsp;</td>
  394. <td align="left" width="100%" colspan="3">
  395. <%
  396. '
  397. ' The following HTML is copied from
  398. ' SA_ServeOnClickButton in sh_page.asp to avoid
  399. ' circular inclusion of that page by including it
  400. ' here.
  401. '
  402. %>
  403. <button class="TaskFrameButtons" type="button" onClick="window.close();">
  404. <table border="0" width="50" cellpadding="0" cellspacing="0"
  405. class="TaskFrameButtonsNoBorder">
  406. <tr>
  407. <td align="center">
  408. <img src="/admin/images/butGreenArrow.gif">
  409. </td>
  410. <td class="TaskFrameButtonsNoBorder" width="50" nowrap>
  411. <%=Server.HTMLEncode(strButtonText)%>
  412. </td>
  413. </tr>
  414. </table>
  415. </button>
  416. <%
  417. '
  418. ' End code copied from sh_page.asp
  419. '
  420. %>
  421. </td>
  422. </tr>
  423. <% End If %>
  424. </table>
  425. </body>
  426. </html>
  427. <%
  428. Response.End
  429. End Sub
  430. '
  431. ' Begin normal processing.
  432. '
  433. Select Case Request.ServerVariables("REQUEST_METHOD")
  434. Case "GET"
  435. '
  436. ' Look for a key in the request. If one is found, verify that it is
  437. ' correct.
  438. '
  439. If (1 = Request.QueryString(SAI_FLD_PAGEKEY).Count) Then
  440. '
  441. ' Found a key. Verify it.
  442. '
  443. Call SAI_VerifyPageKey(Request.QueryString(SAI_FLD_PAGEKEY).Item(1))
  444. ElseIf (0 <> Request.QueryString.Count) Then
  445. Call SAI_ReportPageKeyError(SAI_PK_E_UNAUTHORIZED)
  446. End If
  447. '
  448. ' If we got here, we either had a valid key or no querystring
  449. ' arguments. Either way, allow the request to succeed.
  450. '
  451. Case "POST"
  452. '
  453. ' Verify that only one key was submitted.
  454. '
  455. If (Request.Form(SAI_FLD_PAGEKEY).Count <> 1) Then
  456. Call SAI_ReportPageKeyError(SAI_PK_E_UNAUTHORIZED)
  457. Else
  458. '
  459. ' Verify that they submitted key matches the one stored in the sesion state.
  460. '
  461. Call SAI_VerifyPageKey(Request.Form(SAI_FLD_PAGEKEY).Item(1))
  462. End If
  463. Case Else
  464. '
  465. ' We reject all other types of requests if we receive them.
  466. '
  467. Response.End
  468. End Select
  469. '
  470. ' One last check to catch anything that fell through.
  471. '
  472. If (Err.number <> 0) Then
  473. Response.End
  474. End If
  475. %>
  476. <script language="javascript">
  477. var SAI_FLD_PAGEKEY = "<%=SAI_FLD_PAGEKEY%>";
  478. var g_strSAIPageKey = "<%=SAI_GetPageKey()%>";
  479. </script>
  480. <SCRIPT Runat=Server Language=VBScript>
  481. Sub SetLCID()
  482. Dim strLCID
  483. Select Case getBrowserLanguage
  484. Case "af"
  485. strLCID = 1078 ' Afrikaans
  486. Case "sq"
  487. strLCID = 1052 ' Albanian
  488. Case "ar-sa"
  489. strLCID = 1025 ' Arabic(Saudi Arabia)
  490. Case "ar-iq"
  491. strLCID = 2049 ' Arabic(Iraq)
  492. Case "ar-eg"
  493. strLCID = 3073 ' Arabic(Egypt)
  494. Case "ar-ly"
  495. strLCID = 4097 ' Arabic(Libya)
  496. Case "ar-dz"
  497. strLCID = 5121 ' Arabic(Algeria)
  498. Case "ar-ma"
  499. strLCID = 6145 ' Arabic(Morocco)
  500. Case "ar-tn"
  501. strLCID = 7169 ' Arabic(Tunisia)
  502. Case "ar-om"
  503. strLCID = 8193 ' Arabic(Oman)
  504. Case "ar-ye"
  505. strLCID = 9217 ' Arabic(Yemen)
  506. Case "ar-sy"
  507. strLCID = 10241 ' Arabic(Syria)
  508. Case "ar-jo"
  509. strLCID = 11265 ' Arabic(Jordan)
  510. Case "ar-lb"
  511. strLCID = 12289 ' Arabic(Lebanon)
  512. Case "ar-kw"
  513. strLCID = 13313 ' Arabic(Kuwait)
  514. Case "ar-ae"
  515. strLCID = 14337 ' Arabic(U.A.E.)
  516. Case "ar-bh"
  517. strLCID = 15361 ' Arabic(Bahrain)
  518. Case "ar-qa"
  519. strLCID = 16385 ' Arabic(Qatar)
  520. Case "eu"
  521. strLCID = 1069 ' Basque
  522. Case "bg"
  523. strLCID = 1026 ' Bulgarian
  524. Case "be"
  525. strLCID = 1059 ' Belarusian
  526. Case "ca"
  527. strLCID = 1027 ' Catalan
  528. Case "zh-tw"
  529. strLCID = 1028 ' Chinese(Taiwan)
  530. Case "zh-cn"
  531. strLCID = 2052 ' Chinese(PRC)
  532. Case "zh-hk"
  533. strLCID = 3076 ' Chinese(Hong Kong)
  534. Case "zh-sg"
  535. strLCID = 4100 ' Chinese(Singapore)
  536. Case "hr"
  537. strLCID = 1050 ' Croatian
  538. Case "cs"
  539. strLCID = 1029 ' Czech
  540. Case "da"
  541. strLCID = 1030 ' Danish
  542. Case "n"
  543. strLCID = 1043 ' Dutch(Standard)
  544. Case "nl-be"
  545. strLCID = 2067 ' Dutch(Belgian)
  546. Case "en"
  547. strLCID = 1033 ' English
  548. Case "en-us"
  549. strLCID = 1033 ' English(United States)
  550. Case "en-gb"
  551. strLCID = 2057 ' English(British)
  552. Case "en-au"
  553. strLCID = 3081 ' English(Australian)
  554. Case "en-ca"
  555. strLCID = 4105 ' English(Canadian)
  556. Case "en-nz"
  557. strLCID = 5129 ' English(New Zealand)
  558. Case "en-ie"
  559. strLCID = 6153 ' English(Ireland)
  560. Case "en-za"
  561. strLCID = 7177 ' English(South Africa)
  562. Case "en-jm"
  563. strLCID = 8201 ' English(Jamaica)
  564. Case "en"
  565. strLCID = 9225 ' English(Caribbean)
  566. Case "en-bz"
  567. strLCID = 10249 ' English(Belize)
  568. Case "en-tt"
  569. strLCID = 11273 ' English(Trinidad)
  570. Case "et"
  571. strLCID = 1061 ' Estonian
  572. Case "fo"
  573. strLCID = 1080 ' Faeroese
  574. Case "fa"
  575. strLCID = 1065 ' Farsi
  576. Case "fi"
  577. strLCID = 1035 ' Finnish
  578. Case "fr"
  579. strLCID = 1036 ' French(Standard)
  580. Case "fr-be"
  581. strLCID = 2060 ' French(Belgian)
  582. Case "fr-ca"
  583. strLCID = 3084 ' French(Canadian)
  584. Case "fr-ch"
  585. strLCID = 4108 ' French(Swiss)
  586. Case "fr-lu"
  587. strLCID = 5132 ' French(Luxembourg)
  588. Case "gd"
  589. strLCID = 1084 ' Gaelic(Scots)
  590. Case "gd-ie"
  591. strLCID = 2108 ' Gaelic(Irish)
  592. Case "de"
  593. strLCID = 1031 ' German(Standard)
  594. Case "de-ch"
  595. strLCID = 2055 ' German(Swiss)
  596. Case "de-at"
  597. strLCID = 3079 ' German(Austrian)
  598. Case "de-lu"
  599. strLCID = 4103 ' German(Luxembourg)
  600. Case "de-li"
  601. strLCID = 5127 ' German(Liechtenstein)
  602. Case "e"
  603. strLCID = 1032 ' Greek
  604. Case "he"
  605. strLCID = 1037 ' Hebrew
  606. Case "hi"
  607. strLCID = 1081 ' Hindi
  608. Case "hu"
  609. strLCID = 1038 ' Hungarian
  610. Case "is"
  611. strLCID = 1039 ' Icelandic
  612. Case "in"
  613. strLCID = 1057 ' Indonesian
  614. Case "it"
  615. strLCID = 1040 ' Italian(Standard)
  616. Case "it-ch"
  617. strLCID = 2064 ' Italian(Swiss)
  618. Case "ja"
  619. strLCID = 1041 ' Japanese
  620. Case "ko"
  621. strLCID = 1042 ' Korean
  622. Case "ko"
  623. strLCID = 2066 ' Korean(Johab)
  624. Case "lv"
  625. strLCID = 1062 ' Latvian
  626. Case "lt"
  627. strLCID = 1063 ' Lithuanian
  628. Case "mk"
  629. strLCID = 1071 ' Macedonian
  630. Case "ms"
  631. strLCID = 1086 ' Malaysian
  632. Case "mt"
  633. strLCID = 1082 ' Maltese
  634. Case "no"
  635. strLCID = 1044 ' Norwegian(Bokmal)
  636. Case "no"
  637. strLCID = 2068 ' Norwegian(Nynorsk)
  638. Case "p"
  639. strLCID = 1045 ' Polish
  640. Case "pt-br"
  641. strLCID = 1046 ' Portuguese(Brazilian)
  642. Case "pt"
  643. strLCID = 2070 ' Portuguese(Standard)
  644. Case "rm"
  645. strLCID = 1047 ' Rhaeto-Romanic
  646. Case "ro"
  647. strLCID = 1048 ' Romanian
  648. Case "ro-mo"
  649. strLCID = 2072 ' Romanian(Moldavia)
  650. Case "ru"
  651. strLCID = 1049 ' Russian
  652. Case "ru-mo"
  653. strLCID = 2073 ' Russian(Moldavia)
  654. Case "sz"
  655. strLCID = 1083 ' Sami(Lappish)
  656. Case "sr"
  657. strLCID = 3098 ' Serbian(Cyrillic)
  658. Case "sr"
  659. strLCID = 2074 ' Serbian(Latin)
  660. Case "sk"
  661. strLCID = 1051 ' Slovak
  662. Case "s"
  663. strLCID = 1060 ' Slovenian
  664. Case "sb"
  665. strLCID = 1070 ' Sorbian
  666. Case "es"
  667. strLCID = 1034 ' Spanish(Spain - Traditional Sort)
  668. Case "es-mx"
  669. strLCID = 2058 ' Spanish(Mexican)
  670. Case "es"
  671. strLCID = 3082 ' Spanish(Spain - Modern Sort)
  672. Case "es-gt"
  673. strLCID = 4106 ' Spanish(Guatemala)
  674. Case "es-cr"
  675. strLCID = 5130 ' Spanish(Costa Rica)
  676. Case "es-pa"
  677. strLCID = 6154 ' Spanish(Panama)
  678. Case "es-do"
  679. strLCID = 7178 ' Spanish(Dominican Republic)
  680. Case "es-ve"
  681. strLCID = 8202 ' Spanish(Venezuela)
  682. Case "es-co"
  683. strLCID = 9226 ' Spanish(Colombia)
  684. Case "es-pe"
  685. strLCID = 10250 ' Spanish(Peru)
  686. Case "es-ar"
  687. strLCID = 11274 ' Spanish(Argentina)
  688. Case "es-ec"
  689. strLCID = 12298 ' Spanish(Ecuador)
  690. Case "es-c"
  691. strLCID = 13322 ' Spanish(Chile)
  692. Case "es-uy"
  693. strLCID = 14346 ' Spanish(Uruguay)
  694. Case "es-py"
  695. strLCID = 15370 ' Spanish(Paraguay)
  696. Case "es-bo"
  697. strLCID = 16394 ' Spanish(Bolivia)
  698. Case "es-sv"
  699. strLCID = 17418 ' Spanish(El Salvador)
  700. Case "es-hn"
  701. strLCID = 18442 ' Spanish(Honduras)
  702. Case "es-ni"
  703. strLCID = 19466 ' Spanish(Nicaragua)
  704. Case "es-pr"
  705. strLCID = 20490 ' Spanish(Puerto Rico)
  706. Case "sx"
  707. strLCID = 1072 ' Sutu
  708. Case "sv"
  709. strLCID = 1053 ' Swedish
  710. Case "sv-fi"
  711. strLCID = 2077 ' Swedish(Finland)
  712. Case "th"
  713. strLCID = 1054 ' Thai
  714. Case "ts"
  715. strLCID = 1073 ' Tsonga
  716. Case "tn"
  717. strLCID = 1074 ' Tswana
  718. Case "tr"
  719. strLCID = 1055 ' Turkish
  720. Case "uk"
  721. strLCID = 1058 ' Ukrainian
  722. Case "ur"
  723. strLCID = 1056 ' Urdu
  724. Case "ve"
  725. strLCID = 1075 ' Venda
  726. Case "vi"
  727. strLCID = 1066 ' Vietnamese
  728. Case "xh"
  729. strLCID = 1076 ' Xhosa
  730. Case "ji"
  731. strLCID = 1085 ' Yiddish
  732. Case "zu"
  733. strLCID = 1077 ' Zulu
  734. Case Else
  735. strLCID = 2048 ' default
  736. End Select
  737. Session.LCID = strLCID
  738. End Sub
  739. </SCRIPT>