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.

1163 lines
56 KiB

  1. <%@ Language=VBScript%>
  2. <% Option Explicit%>
  3. <%
  4. Response.Buffer = True
  5. '-------------------------------------------------------------------------
  6. ' adminweb_prop.asp: Allows for the configuration of IP addresses
  7. ' and set the port to listen for non-encrypted and
  8. ' encrypted(SSL) HTTP admin web site.
  9. '
  10. ' Copyright (c) Microsoft Corporation. All rights reserved.
  11. '
  12. ' Date Description
  13. ' 28-02-2001 Created date
  14. ' 14-03-2001 Modified date
  15. '-------------------------------------------------------------------------
  16. %>
  17. <!-- #include virtual="/admin/inc_framework.asp" -->
  18. <!-- #include file="loc_adminweb.asp" -->
  19. <%
  20. '-------------------------------------------------------------------------
  21. ' Global Variables and Constants
  22. '-------------------------------------------------------------------------
  23. Dim G_objAdminService 'WMI server HTTP admin web site object
  24. Dim G_objService 'WMI server object to get the IP addresses for NIC cards
  25. Dim rc 'framework variable
  26. Dim page 'framework variable
  27. Dim SOURCE_FILE 'To hold source file name
  28. SOURCE_FILE = SA_GetScriptFileName()
  29. Const CONST_ARR_STATUS_CHECKED = "CHECKED" 'Constant for radio button checked property
  30. Const CONST_ARR_STATUS_DISABLED = "DISABLED" 'Constant for disabling of SSL port
  31. Const CONST_ARR_STATUS_TRUE = "YES" 'Constant for radio button status
  32. Const CONST_ARR_STATUS_FALSE = "NO" 'Constant for radio button status
  33. Const CONST_ARR_STATUS_NONE = "NONE" 'Constant for radio button status
  34. 'Port Locations for shares list page
  35. CONST CONST_DEFAULT_PORTNAME ="AdminPort"
  36. CONST CONST_SSL_PORTNAME ="SSLAdminPort"
  37. '-------------------------------------------------------------------------
  38. 'Form Variables
  39. '-------------------------------------------------------------------------
  40. Dim F_strNonEncryptedIPAddress 'IP Address to be used for Non-Encrypted port
  41. Dim F_strEncryptedIPAddress 'IP Address to be used for Encrypted port
  42. Dim F_nNonEncryptedPort 'Non-encrypted port number to be used
  43. Dim F_nEncryptedPort 'Encrypted port number(SSL) to be used
  44. Dim F_strradIPAdd 'Value of radio button clicked
  45. Dim F_strAll_IPAddress 'To set the status of the All IP address radio button
  46. Dim F_strJustthis_IPAddress 'To set the status of the Just this IP address radio button
  47. Dim F_strSSLPort_Status 'To set the status of the SSL port
  48. '-------------------------------------------------------------------------
  49. 'END of Form Variables
  50. '-------------------------------------------------------------------------
  51. '
  52. 'Create a Property Page
  53. rc = SA_CreatePage( L_PAGETITLE_ADMIN_TEXT , "", PT_PROPERTY, page )
  54. If (rc = 0) Then
  55. 'Serve the page
  56. SA_ShowPage(page)
  57. End If
  58. '---------------------------------------------------------------------
  59. 'Function: OnInitPage()
  60. 'Description: Called to signal first time processing for this page.
  61. 'Input Variables: PageIn,EventArg
  62. 'Output Variables: PageIn,EventArg
  63. 'Returns: True/False
  64. 'Global Variables: None
  65. '---------------------------------------------------------------------
  66. Public Function OnInitPage(ByRef PageIn, ByRef EventArg)
  67. 'Make it initialize to default always
  68. F_strSSLPort_Status=""
  69. 'To get the admin web settings
  70. OnInitPage = GetSystemSettings()
  71. End Function
  72. '-------------------------------------------------------------------------
  73. 'Function: OnPostBackPage()
  74. 'Description: Called to signal that the page has been posted-back.
  75. 'Input Variables: PageIn,EventArg
  76. 'Output Variables: PageIn,EventArg
  77. 'Returns: True/False
  78. 'Global Variables: F_(*)
  79. '-------------------------------------------------------------------------
  80. Public Function OnPostBackPage(ByRef PageIn,ByRef EventArg)
  81. Call SA_TraceOut( SOURCE_FILE, "OnPostBackPage")
  82. 'Get the values from hidden variables
  83. F_strradIPAdd = Request.Form("hdnIPAddressstatus")
  84. F_nNonEncryptedPort = Request.Form("hdnNonencryptedPort")
  85. F_nEncryptedPort = Request.Form("hdnEncryptedPort")
  86. F_strSSLPort_Status = Request.Form("hdnSSLPortstatus")
  87. If Ucase(F_strradIPAdd) = CONST_ARR_STATUS_TRUE then
  88. F_strNonEncryptedIPAddress=""
  89. F_strEncryptedIPAddress=""
  90. ElseIf Ucase(F_strradIPAdd) = CONST_ARR_STATUS_FALSE Then
  91. F_strNonEncryptedIPAddress = Request.Form("hdnNonEncryptedIPAddress")
  92. F_strEncryptedIPAddress = Request.Form("hdnEncryptedIPAddress")
  93. End If
  94. 'Getting the radio buttons status
  95. If Ucase(F_strradIPAdd) = CONST_ARR_STATUS_TRUE Then
  96. F_strAll_IPAddress = CONST_ARR_STATUS_CHECKED
  97. F_strJustthis_IPAddress =""
  98. ElseIf Ucase(F_strradIPAdd) = CONST_ARR_STATUS_FALSE Then
  99. F_strJustthis_IPAddress = CONST_ARR_STATUS_CHECKED
  100. F_strAll_IPAddress = ""
  101. Else
  102. F_strJustthis_IPAddress = ""
  103. F_strAll_IPAddress = ""
  104. End if
  105. OnPostBackPage=TRUE
  106. End Function
  107. '---------------------------------------------------------------------
  108. 'Function: OnSubmitPage()
  109. 'Description: Called when the page has been submitted for processing.
  110. 'Input Variables: PageIn,EventArg
  111. 'Output Variables: PageIn,EventArg
  112. 'Returns: True/False
  113. 'Global Variables: G_objAdminService,G_objService,L_WMICONNECTIONFAILED_ERRORMESSAGE,
  114. ' CONST_WMI_IIS_NAMESPACE, CONST_WMI_WIN32_NAMESPACE
  115. '---------------------------------------------------------------------
  116. Public Function OnSubmitPage(ByRef PageIn, ByRef EventArg)
  117. Err.Clear
  118. On Error Resume Next
  119. 'Connecting to the WMI server
  120. Set G_objAdminService = GetWMIConnection(CONST_WMI_IIS_NAMESPACE)
  121. Set G_objService = GetWMIConnection(CONST_WMI_WIN32_NAMESPACE)
  122. If Err.number <> 0 Then
  123. Call SA_ServeFailurePage (L_WMICONNECTIONFAILED_ERRORMESSAGE & " (" & HEX(Err.Number) & ")" )
  124. End if
  125. 'To set the admin web settings
  126. OnSubmitPage = SetAdminConfig(G_objAdminService,G_objService)
  127. End Function
  128. '---------------------------------------------------------------------
  129. 'Function: OnClosePage()
  130. 'Description: Called when the page is about to be closed.
  131. 'Input Variables: PageIn,EventArg
  132. 'Output Variables: PageIn,EventArg
  133. 'Returns: True/False
  134. 'Global Variables: None
  135. '---------------------------------------------------------------------
  136. Public Function OnClosePage(ByRef PageIn, ByRef EventArg)
  137. OnClosePage = TRUE
  138. End Function
  139. '-------------------------------------------------------------------------
  140. 'Function: OnServePropertyPage
  141. 'Description: Called when the page needs to be served.
  142. 'Input Variables: PageIn,EventArg
  143. 'Output Variables: PageIn,EventArg
  144. 'Returns: True/False
  145. 'Global Variables: F_(*), L_(*)
  146. '-------------------------------------------------------------------------
  147. Public Function OnServePropertyPage(ByRef PageIn,ByRef EventArg)
  148. Call ServeCommonJavaScript()
  149. %>
  150. <table border=0>
  151. <tr>
  152. <td nowrap class = "TasksBody" colspan=2>
  153. <%=L_ADMINUSAGE_TEXT%>
  154. </td>
  155. </tr>
  156. <tr>
  157. <td class = "TasksBody" ></td>
  158. </tr>
  159. <tr>
  160. <td class = "TasksBody">
  161. &nbsp;
  162. </td>
  163. <td nowrap class = "TasksBody">
  164. <input type="radio" value="YES" class="FormField" name=radIPADDRESS <%=Server.HTMLEncode(F_strAll_IPAddress)%> onClick="EnableControls(false)">&nbsp;&nbsp; <%=L_ALLIPADDRESS_TEXT%>
  165. </td>
  166. </tr>
  167. <tr>
  168. <td class = "TasksBody">
  169. &nbsp;
  170. </td>
  171. <td nowrap class = "TasksBody">
  172. <input type="radio" value="NO" class="FormField" name=radIPADDRESS <%=Server.HTMLEncode(F_strJustthis_IPAddress)%> onClick="EnableControls(true)">&nbsp;&nbsp; <%=L_JUSTTHIS_IP_ADDRESS_TEXT%>
  173. </td>
  174. </tr>
  175. <tr>
  176. <td class = "TasksBody" colspan="2">
  177. </td>
  178. </tr>
  179. <tr>
  180. <td class = "TasksBody">
  181. &nbsp;
  182. </td>
  183. <td class = "TasksBody" colspan="3"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  184. <select name="cboIPAddress" class="FormField">
  185. <%GetSystemNICConfig F_strNonEncryptedIPAddress%>
  186. </select>
  187. </td>
  188. </tr>
  189. <tr>
  190. <td class = "TasksBody">
  191. &nbsp;
  192. </td>
  193. <td nowrap class = "TasksBody">
  194. <%=L_PORT_TEXT%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="txtNonEncryptedPort" class="FormField" size="15" maxlength = "5" value="<%=F_nNonEncryptedPort%>" OnKeypress="javascript:checkKeyforNumbers(this);" >
  195. </td>
  196. </tr>
  197. <tr>
  198. <td class = "TasksBody">
  199. &nbsp;
  200. </td>
  201. <td class = "TasksBody">
  202. <%=L_SSLPORT_TEXT%>&nbsp;&nbsp;&nbsp;<input type="text" name="txtEncryptedPort" class="FormField" size="15" maxlength = "5" <%=F_strSSLPort_Status%> value="<%=F_nEncryptedPort%>" OnKeypress="javascript:checkKeyforNumbers(this);" >
  203. </td>
  204. </tr>
  205. <tr>
  206. <td class = "TasksBody" colspan =2>
  207. &nbsp;
  208. </td>
  209. </tr>
  210. <tr>
  211. <td class = "TasksBody" colspan =2>
  212. <%=L_ADMINNOTE_TEXT%>
  213. </td>
  214. </tr>
  215. </table>
  216. <input type=hidden name=hdnNonEncryptedIPAddress value ="<%=F_strNonEncryptedIPAddress%>">
  217. <input type=hidden name=hdnEncryptedIPAddress value ="<%=F_strEncryptedIPAddress%>">
  218. <input type=hidden name=hdnNonencryptedPort value ="<%=F_nNonEncryptedPort%>">
  219. <input type=hidden name=hdnEncryptedPort value ="<%=F_nEncryptedPort%>">
  220. <input type=hidden name=hdnIPAddressstatus value ="<%=F_strradIPAdd%>">
  221. <input type=hidden name=hdnSSLPortstatus value ="<%=F_strSSLPort_Status%>">
  222. <%
  223. OnServePropertyPage=TRUE
  224. End Function
  225. '-------------------------------------------------------------------------
  226. 'Function: ServeCommonJavaScript
  227. 'Description: Serves in initializing the values,setting the form
  228. ' data and validating the form values
  229. 'Input Variables: None
  230. 'Output Variables: None
  231. 'Returns: True/False
  232. 'Global Variables: L_(*),F_(*)
  233. '-------------------------------------------------------------------------
  234. Function ServeCommonJavaScript()
  235. %>
  236. <script language="JavaScript" src="<%=m_VirtualRoot%>inc_global.js"></script>
  237. <script language="JavaScript">
  238. var CONST_ARR_INDEX_ALL_IP = 0
  239. var CONST_ARR_INDEX_JUST_THIS_IP = 1
  240. /* Init Function calls the EnableControls function to enable or disable the controls for the first time
  241. and enable or disable the OK button */
  242. function Init()
  243. {
  244. var strNonEncryptedIPAddress = "<%=F_strNonEncryptedIPAddress%>"
  245. var strEncryptedIPAddress = "<%=F_strEncryptedIPAddress%>"
  246. //If sites are configured at different IP addresses disable OK button
  247. if(strNonEncryptedIPAddress.value != strEncryptedIPAddress)
  248. {
  249. DisableOK();
  250. document.frmTask.cboIPAddress.disabled =true;
  251. }
  252. //Enabling or disabling of OK button depending on the status of radion button
  253. if(document.frmTask.radIPADDRESS[CONST_ARR_INDEX_ALL_IP].checked)
  254. EnableControls(false)
  255. else if(document.frmTask.radIPADDRESS[CONST_ARR_INDEX_JUST_THIS_IP].checked)
  256. EnableControls(true)
  257. }
  258. // Hidden Varaibles are updated in ValidatePage
  259. function ValidatePage()
  260. {
  261. //Updating the hidden variables
  262. document.frmTask.hdnNonEncryptedIPAddress.value = document.frmTask.cboIPAddress.value
  263. document.frmTask.hdnNonencryptedPort.value = document.frmTask.txtNonEncryptedPort.value
  264. document.frmTask.hdnEncryptedPort.value = document.frmTask.txtEncryptedPort.value
  265. if (document.frmTask.radIPADDRESS[CONST_ARR_INDEX_ALL_IP].checked)
  266. document.frmTask.hdnIPAddressstatus.value = document.frmTask.radIPADDRESS[CONST_ARR_INDEX_ALL_IP].value
  267. else if(document.frmTask.radIPADDRESS[CONST_ARR_INDEX_JUST_THIS_IP].checked)
  268. document.frmTask.hdnIPAddressstatus.value = document.frmTask.radIPADDRESS[CONST_ARR_INDEX_JUST_THIS_IP].value
  269. //If Non-Encrypted Port is left blank display error
  270. if (document.frmTask.txtNonEncryptedPort.value == "")
  271. {
  272. SA_DisplayErr('<%=SA_EscapeQuotes(L_ENTERPORTNUMBER_ERRORMESSAGE) %>');
  273. document.frmTask.onkeypress = ClearErr
  274. return false;
  275. }
  276. //If Encrypted Port is left blank display error
  277. if (document.frmTask.txtEncryptedPort.value == "")
  278. {
  279. SA_DisplayErr('<%=SA_EscapeQuotes(L_ENTERPORTNUMBER_ERRORMESSAGE) %>');
  280. document.frmTask.onkeypress = ClearErr
  281. return false;
  282. }
  283. //If Non-Encrypted port number is less than 1 or greater then 65535 display error
  284. var MAX_PORT_NO = 65535
  285. var MIN_PORT_NO = 1
  286. if (document.frmTask.txtNonEncryptedPort.value > MAX_PORT_NO || document.frmTask.txtNonEncryptedPort.value < MIN_PORT_NO)
  287. {
  288. SA_DisplayErr('<%=SA_EscapeQuotes(L_VALIDENTERPORTNUMBER_ERRORMESSAGE) %>');
  289. document.frmTask.onkeypress = ClearErr
  290. return false;
  291. }
  292. //If Encrypted port number is less than 1 or greater then 65535 display error
  293. if (document.frmTask.txtEncryptedPort.value > MAX_PORT_NO || document.frmTask.txtEncryptedPort.value < MIN_PORT_NO)
  294. {
  295. SA_DisplayErr('<%=SA_EscapeQuotes(L_VALIDENTERPORTNUMBER_ERRORMESSAGE) %>');
  296. document.frmTask.onkeypress = ClearErr
  297. return false;
  298. }
  299. //If Non-Encrypted Port and Encrypted Port numbers are the same display error
  300. if (document.frmTask.txtNonEncryptedPort.value == document.frmTask.txtEncryptedPort.value)
  301. {
  302. SA_DisplayErr('<%=SA_EscapeQuotes(L_PORTNUMBERS_ERRORMESSAGE)%>');
  303. document.frmTask.onkeypress = ClearErr
  304. return false;
  305. }
  306. return true;
  307. }
  308. //SetData function for the Framework.
  309. function SetData()
  310. {
  311. }
  312. // EnableControls Function is to enable or disable the controls depending on radio button value
  313. function EnableControls(blnFlag)
  314. {
  315. EnableOK();
  316. if (blnFlag)
  317. {
  318. document.frmTask.cboIPAddress.disabled = false;
  319. }
  320. else
  321. {
  322. document.frmTask.cboIPAddress.disabled =true;
  323. }
  324. }
  325. </script>
  326. <%
  327. End Function
  328. '-------------------------------------------------------------------------
  329. 'Function name: SetAdminConfig()
  330. 'Description: Serves in configuring IP address, encrypted port
  331. ' and non-encrypted port of HTTP admin web site
  332. 'Input Variables: G_objAdminService, G_objService
  333. 'Output Variables: True or false
  334. 'Returns: None
  335. 'Global Variables: F_strNonEncryptedIPAddress,F_nNonEncryptedPort,F_nEncryptedPort,L_(*)
  336. 'This function configures the IP address, encrypted port and non-encrypted of HTTP admin web site
  337. '-------------------------------------------------------------------------
  338. Function SetAdminConfig(G_objAdminService,G_objService)
  339. Err.Clear
  340. On Error Resume Next
  341. Dim objAdminService 'Object to get instance of MicrosoftIISV1
  342. Dim objService 'Object to get instance of CIMV2
  343. Dim objNetWorkCon 'To get instance of IIs_WebServerSetting class
  344. Dim objServerSetting 'To get instances of IIs_WebServerSetting class
  345. Dim objNACCollection 'To get instance of IIs_WebServerSetting where site is other than Administration
  346. Dim objinst 'To get instances of IIs_WebServerSetting where site is other than Administration
  347. Dim nport 'Non-Encrypted port number
  348. Dim strWMIpath 'WMI query to get admin web site
  349. Dim strServerBindings 'To store the values obtained from ServerBindings property
  350. Dim strIPAddress 'String to store the IP address for non-encrypted sites
  351. Dim arrWinsSrv 'Array to store the IP address and non-encrypted port number
  352. Dim arrIPAdd 'Array to store the port for encrypted sites
  353. Dim nIPCount 'Count for getting the IP address and non-encrypted port number
  354. Dim arrPort 'Array to store the port for non-encrypted sites
  355. Dim strReturnURL 'Stores return URL
  356. Dim objConfiguredIPs 'To get instance of win32_NetworkAdapterConfiguration
  357. Dim objNICIP 'To get instances of win32_NetworkAdapterConfiguration
  358. Dim strNICQuery 'Query to get all IP addresses
  359. Dim nCount 'Count for getting the IP address and non-encrypted port number
  360. Dim arrIPList(13) 'Array to store the IP addresses for all NIC cards
  361. Dim nIPlistCount 'Count to get IP addresses for all NIC cards
  362. Dim strIPFlag 'Boolean value to store the validity of IP address
  363. Dim strAdminWebSite 'Admin web site name
  364. Dim strFTPSite 'FTP site name
  365. Dim strFTPpath 'FTP site path
  366. Dim nFTPIPCount 'Count for getting the IP address and port number for FTP site
  367. Dim strFTPServerBindings 'To store the values obtained from ServerBindings property for FTP site
  368. Dim arrFTPWinsSrv 'Array to store the IP address and port for FTP site
  369. Dim arrFTPIPAdd 'Array to store the IP address FTP site
  370. Dim arrFTPPort 'Array to store the port for FTP site
  371. Dim objFTPinst 'Gettings instances for FTP site
  372. Dim objFTPInstances 'Object instance for FTP site
  373. Dim strComputerName 'Computer name
  374. Dim nSecureCount 'Count for getting the IP address and encrypted port number
  375. Dim arrSecureIPAdd 'Array to store the IP address for encrypted sites
  376. Dim arrSecurePort 'Array to store the port for encrypted sites
  377. Dim arrWinsSecure 'Array to store the IP address and encrypted port number
  378. Dim strSecureBindings 'To store the values obtained from SecureBindings property
  379. Dim nSecurePort 'Encrypted port number
  380. Dim strURL 'URL for non encrypted site
  381. Dim strHTTPURL 'URL for encrypted site
  382. Dim arrVarReplacementStringsAdminWeb(1) ' For localisation
  383. Dim strErrMsg 'Error message
  384. Const CONST_ARR_INDEX_IP = 0 'For IP address
  385. Const CONST_ARR_INDEX_PORT = 1 'For port number
  386. Const CONST_ARR_INDEX_HTTPS = "HTTPS" 'For secure site
  387. SetAdminConfig = FALSE 'initialization default
  388. Call SA_TraceOut( SOURCE_FILE, "SetAdminConfig")
  389. 'Getting the return URL
  390. 'That's a quick fix for 2.1 since in 2.1 administration site actually is
  391. 'under the virtual directory /admin.
  392. If CONST_OSNAME_XPE = GetServerOSName() Then
  393. strReturnURL = "/Admin/tasks.asp?" & SAI_FLD_PAGEKEY & "=" & SAI_GetPageKey() & "&tab1="
  394. Else
  395. strReturnURL = "/Admin/tasks.asp?" & SAI_FLD_PAGEKEY & "=" & SAI_GetPageKey() & "&tab1="
  396. End If
  397. 'FTP site name
  398. strFTPSite = "MSFTPSVC/1"
  399. 'Assign global objects to local objects
  400. Set objAdminService = G_objAdminService
  401. Set objService = G_objService
  402. 'Get the HTTP admin web site name
  403. strAdminWebSite = GetAdminWebSite(objAdminService)
  404. 'To get instances of Web sites other than Administration
  405. strWMIpath = "select * from " & GetIISWMIProviderClassName("IIs_WebServerSetting") & " where Name != " & Chr(34)& strAdminWebSite & Chr(34)
  406. Set objNACCollection = objAdminService.ExecQuery(strWMIpath)
  407. If Err.Number <> 0 Then
  408. Call SA_SetErrMsg (L_IIS_WEBSERVERCONNECTION_ERRORMESSAGE & " (" & HEX(Err.Number) & ")" )
  409. Exit Function
  410. End If
  411. arrVarReplacementStringsAdminWeb(0) = Cstr(F_nNonEncryptedPort)
  412. strErrMsg = SA_GetLocString("adminweb.dll", "4045000F", arrVarReplacementStringsAdminWeb)
  413. For each objinst in objNACCollection
  414. 'If other web site is configured with the same IP address and non-encrypted port number display error
  415. If IsArray(objinst.ServerBindings) Then
  416. For nIPCount = 0 to ubound(objinst.ServerBindings)
  417. strServerBindings = objinst.ServerBindings(nIPCount)
  418. if IsIIS60Installed() Then
  419. If isObject(objinst.ServerBindings(nIPCount)) Then
  420. arrIPAdd = objinst.ServerBindings(nIPCount).IP
  421. arrPort = objinst.ServerBindings(nIPCount).Port
  422. 'Duplicate the code here
  423. If F_strNonEncryptedIPAddress <> "" then
  424. If arrIPAdd = F_strNonEncryptedIPAddress and arrPort = F_nNonEncryptedPort then
  425. Call SA_SetErrMsg (strErrMsg)
  426. Exit Function
  427. End if
  428. Else
  429. If arrPort = F_nNonEncryptedPort then
  430. Call SA_SetErrMsg (strErrMsg)
  431. Exit Function
  432. End if
  433. End if
  434. End If 'If isobject(...)
  435. Else
  436. If strServerBindings <> "" then
  437. 'split the strServerBindings array to get the IP address and non-encrypted port
  438. arrWinsSrv = split(strServerBindings,":")
  439. arrIPAdd = arrWinsSrv(CONST_ARR_INDEX_IP)
  440. arrPort = arrWinsSrv(CONST_ARR_INDEX_PORT)
  441. If F_strNonEncryptedIPAddress <> "" then
  442. If arrIPAdd = F_strNonEncryptedIPAddress and arrPort = F_nNonEncryptedPort then
  443. Call SA_SetErrMsg (strErrMsg)
  444. Exit Function
  445. End if
  446. Else
  447. If arrPort = F_nNonEncryptedPort then
  448. Call SA_SetErrMsg (strErrMsg)
  449. Exit Function
  450. End if
  451. End if
  452. End If
  453. End If 'IsIIS60Installed
  454. Next
  455. End If
  456. 'If other web site is configured with the same IP address and encrypted port number display error
  457. If IsArray(objinst.SecureBindings) Then
  458. For nSecureCount = 0 to ubound(objinst.SecureBindings)
  459. strSecureBindings = objinst.SecureBindings(nSecureCount)
  460. if IsIIS60Installed() Then
  461. If IsObject(objinst.SecureBindings(nSecureCount)) Then
  462. arrSecureIPAdd = objinst.SecureBindings(nSecureCount).IP
  463. arrSecurePort = objinst.SecureBindings(nSecureCount).Port
  464. ' Check if the secure port is empty or not
  465. If IsEmpty(arrSecurePort) or IsNull(arrSecurePort) Then
  466. arrSecurePort = ""
  467. Else
  468. 'Get rid of the ':'
  469. arrSecurePort = CLng(Replace(arrSecurePort, ":", ""))
  470. End If
  471. If F_strEncryptedIPAddress <> "" then
  472. If arrSecureIPAdd = F_strEncryptedIPAddress and arrSecurePort = F_nEncryptedPort then
  473. Call SA_SetErrMsg (strErrMsg)
  474. Exit Function
  475. End if
  476. Else
  477. If arrSecurePort = F_nEncryptedPort then
  478. Call SA_SetErrMsg (strErrMsg)
  479. Exit Function
  480. End if
  481. End if
  482. End If 'If IsObject(..)
  483. Else
  484. If strSecureBindings <> "" then
  485. 'split the strSecureBindings array to get the IP address and non-encrypted port
  486. arrWinsSecure = split(strSecureBindings,":")
  487. arrSecureIPAdd = arrWinsSecure(CONST_ARR_INDEX_IP)
  488. arrSecurePort = arrWinsSecure(CONST_ARR_INDEX_PORT)
  489. If F_strEncryptedIPAddress <> "" then
  490. If arrSecureIPAdd = F_strEncryptedIPAddress and arrSecurePort = F_nEncryptedPort then
  491. Call SA_SetErrMsg (strErrMsg)
  492. Exit Function
  493. End if
  494. Else
  495. If arrSecurePort = F_nEncryptedPort then
  496. Call SA_SetErrMsg (strErrMsg)
  497. Exit Function
  498. End if
  499. End if
  500. End if
  501. End If 'if IsIIS60Installed()
  502. Next
  503. End If
  504. Next
  505. 'Display error if not able to verify with other web sites IP address and port number
  506. If Err.Number <> 0 Then
  507. Call SA_SetErrMsg (L_FAILEDTO_VERIFY_IPADD_PORT_ERRORMESSAGE)
  508. Exit Function
  509. End If
  510. 'To get the instance of FTP server settings
  511. strFTPpath = "select * from " & GetIISWMIProviderClassName("IIS_FtpServerSetting") & " where Name = " & chr(34) & strFTPSite & chr(34)
  512. Set objFTPInstances = objAdminService.ExecQuery(strFTPpath)
  513. If Err.Number <> 0 Then
  514. Call SA_SetErrMsg (L_IIS_WEBSERVERCONNECTION_ERRORMESSAGE & " (" & HEX(Err.Number) & ")")
  515. Exit Function
  516. End If
  517. 'Display error if Administration site is configured at same IP address and non-encrypted port number as FTP site
  518. For each objFTPinst in objFTPInstances
  519. If IsArray(objFTPinst.ServerBindings) Then
  520. For nFTPIPCount = 0 to ubound(objFTPinst.ServerBindings)
  521. strFTPServerBindings = objFTPinst.ServerBindings(nFTPIPCount)
  522. if IsIIS60Installed() Then
  523. If IsObject(objFTPinst.ServerBindings(nFTPIPCount)) then
  524. 'split the strFTPServerBindings array to get the IP address and port
  525. arrFTPIPAdd = objFTPinst.ServerBindings(nFTPIPCount).IP
  526. arrFTPPort = objFTPinst.ServerBindings(nFTPIPCount).Port
  527. If F_strNonEncryptedIPAddress <> "" then
  528. If arrFTPIPAdd = F_strNonEncryptedIPAddress and arrFTPPort = F_nNonEncryptedPort then
  529. Call SA_SetErrMsg (strErrMsg)
  530. Exit Function
  531. ElseIf arrFTPIPAdd = "" and arrFTPPort = F_nNonEncryptedPort then
  532. Call SA_SetErrMsg (strErrMsg)
  533. Exit Function
  534. End if
  535. Else
  536. If arrFTPPort = F_nNonEncryptedPort then
  537. Call SA_SetErrMsg (strErrMsg)
  538. Exit Function
  539. End if
  540. End if
  541. End if 'If IsObject(...)
  542. Else
  543. If strFTPServerBindings <> "" then
  544. 'split the strFTPServerBindings array to get the IP address and port
  545. arrFTPWinsSrv = split(strFTPServerBindings,":")
  546. arrFTPIPAdd = arrFTPWinsSrv(CONST_ARR_INDEX_IP)
  547. arrFTPPort = arrFTPWinsSrv(CONST_ARR_INDEX_PORT)
  548. If F_strNonEncryptedIPAddress <> "" then
  549. If arrFTPIPAdd = F_strNonEncryptedIPAddress and arrFTPPort = F_nNonEncryptedPort then
  550. Call SA_SetErrMsg (strErrMsg)
  551. Exit Function
  552. ElseIf arrFTPIPAdd = "" and arrFTPPort = F_nNonEncryptedPort then
  553. Call SA_SetErrMsg (strErrMsg)
  554. Exit Function
  555. End if
  556. Else
  557. If arrFTPPort = F_nNonEncryptedPort then
  558. Call SA_SetErrMsg (strErrMsg)
  559. Exit Function
  560. End if
  561. End if
  562. End if
  563. End If 'if IsIIS60Installed()
  564. Next
  565. End If
  566. Next
  567. 'Display error if not able to verify with FTP site IP address and port number
  568. If Err.Number <> 0 Then
  569. Call SA_SetErrMsg (L_FAILEDTO_VERIFY_IPADD_PORT_ERRORMESSAGE)
  570. Exit Function
  571. End If
  572. 'Release objects
  573. Set objFTPinst = Nothing
  574. Set objFTPInstances = Nothing
  575. 'Assigning values to local variables
  576. strIPAddress = F_strNonEncryptedIPAddress
  577. nport = CLng(F_nNonEncryptedPort)
  578. nSecurePort = CLng(F_nEncryptedPort)
  579. 'To get instance of win32_NetworkAdapterConfiguration class
  580. strNICQuery = "select * from win32_NetworkAdapterConfiguration Where IPEnabled = true"
  581. Set objConfiguredIPs = objService.ExecQuery(strNICQuery)
  582. If Err.number <> 0 then
  583. Call SA_ServeFailurePage (L_FAILEDTOGET_IPADDRESS_ERRORMESSAGE & " (" & HEX(Err.Number) & ")" )
  584. Exit Function
  585. End If
  586. 'Getting the NIC IP addresses
  587. For each objNICIP in objConfiguredIPs
  588. arrIPList(nIPlistCount) = objNICIP.IPAddress(nCount)
  589. nIPlistCount = nIPlistCount+1
  590. Next
  591. 'Release objects
  592. Set objConfiguredIPs = nothing
  593. Set objNICIP = nothing
  594. 'To check whether the selected IP address is a valid IP address
  595. For nCount = 0 to nIPlistCount-1
  596. If strIPAddress = arrIPList(nCount) or strIPAddress = "" Then
  597. strIPFlag = true
  598. Exit For
  599. else
  600. strIPFlag = false
  601. End If
  602. Next
  603. 'If selected Ip address is invalid display error
  604. If strIPFlag = false then
  605. Call SA_SetErrMsg (L_INVALID_IPADDRESS_ERRORMESSAGE)
  606. Exit Function
  607. End if
  608. 'Getting the IIS_WEB Server Setting instance
  609. Set objNetWorkCon = objAdminService.ExecQuery("Select * from " & GetIISWMIProviderClassName("IIs_WebServerSetting") & " where Name=" & Chr(34)& strAdminWebSite & Chr(34))
  610. If Err.Number <> 0 Then
  611. Call SA_SetErrMsg (L_IIS_WEBSERVERCONNECTION_ERRORMESSAGE & " (" & HEX(Err.Number) & ")" )
  612. Exit Function
  613. End If
  614. 'Assign local variable mstrReturnURL
  615. 'For 2.2, only https supported
  616. If ( Request.ServerVariables( "SERVER_PORT_SECURE" ) ) Then
  617. strHTTPURL = "https"
  618. Else
  619. strHTTPURL = "https"
  620. End If
  621. 'Loop to set the IP address and non-encrypted port number or encrypted port number depending on the
  622. 'Secure Certificate being provided
  623. For each objServerSetting in objNetWorkCon
  624. if IsIIS60Installed() Then
  625. objServerSetting.ServerBindings(0).IP = strIPAddress 'IP Address
  626. objServerSetting.ServerBindings(0).Port = nport 'Port
  627. objServerSetting.SecureBindings(0).IP = strIPAddress 'IP Address
  628. objServerSetting.SecureBindings(0).Port = nSecureport 'Port
  629. Else
  630. 'Assigning values to properties
  631. objServerSetting.ServerBindings = array(strIPAddress & ":" & nport & ":")
  632. objServerSetting.SecureBindings = array(strIPAddress & ":" & nSecureport & ":")
  633. End If ' if IsIIS60Installed()
  634. 'To get the computer name
  635. strComputerName = GetComputerName()
  636. 'Error in getting Computer name
  637. If Err.Number <> 0 Then
  638. Call SA_ServeFailurePage (L_COMPUTERNAME_ERRORMESSAGE & " (" & HEX(Err.Number) & ")" )
  639. Exit Function
  640. End If
  641. 'If Secure Certificate is not provided change the URL
  642. If Ucase(strHTTPURL) <> CONST_ARR_INDEX_HTTPS then
  643. If strIPAddress = "" then
  644. mstrReturnURL = "https://"& strComputerName & ":" & nport & strReturnURL & GetTab1()
  645. Else
  646. mstrReturnURL = "https://"& strIPAddress & ":" & nport & strReturnURL & GetTab1()
  647. End if
  648. Else
  649. 'If Secure Certificate is provided change the URL
  650. If Ucase(F_strSSLPort_Status) <> CONST_ARR_STATUS_DISABLED then
  651. If strIPAddress = "" then
  652. mstrReturnURL = "https://"& strComputerName & ":" & nSecureport & strReturnURL & GetTab1()
  653. Else
  654. mstrReturnURL = "https://"& strIPAddress & ":" & nSecureport & strReturnURL & GetTab1()
  655. End if
  656. End if
  657. End if
  658. 'Function call to set the SSL port in the registry
  659. If not updatePortNumber( CONST_SSL_PORTNAME, nSecureport ) Then
  660. SA_SetErrMsg L_REGISTRY_PORT_NUMBERS_NOTSET_ERRORMESSAGE
  661. Exit Function
  662. End If
  663. 'Function call to set the Default port in the registry
  664. If not updatePortNumber( CONST_DEFAULT_PORTNAME , nport ) Then
  665. SA_SetErrMsg L_REGISTRY_PORT_NUMBERS_NOTSET_ERRORMESSAGE
  666. Exit Function
  667. End If
  668. %>
  669. <SCRIPT LANGUAGE="JAVASCRIPT" >
  670. {
  671. top.location.href = "<%=mstrReturnURL%>"
  672. }
  673. </SCRIPT>
  674. <%
  675. Response.Flush
  676. 'Put the values in WMI
  677. objServerSetting.Put_
  678. Next
  679. 'Error while putting the web server settings
  680. If Err.Number <> 0 Then
  681. Call SA_SetErrMsg (L_COULDNOT_IIS_WEBSERVERSETTING_ERRORMESSAGE & " (" & HEX(Err.Number) & ")" )
  682. Exit Function
  683. End If
  684. 'Release the objects
  685. Set objNetWorkCon = nothing
  686. set objinst = nothing
  687. set objNACCollection = nothing
  688. set objServerSetting = nothing
  689. Set objAdminService = nothing
  690. Set objService = nothing
  691. SetAdminConfig = TRUE 'success
  692. End Function
  693. '-------------------------------------------------------------------------
  694. 'Function name: updatePortNumber
  695. 'Description: Serves in updating the port in the registry
  696. 'Input Variables: strPortKey -Key name
  697. ' nportNumber -Port no
  698. 'Output Variables: None
  699. 'Returns: True /False
  700. 'Global Variables: L_(*)
  701. '-------------------------------------------------------------------------
  702. Function updatePortNumber(strPortKey,nportNumber)
  703. On Error Resume Next
  704. Err.Clear
  705. Dim objRegistry 'Object for registry connection
  706. Dim bReturnValue 'Boolean value
  707. Const CONST_PORT_REGKEYPATH ="SOFTWARE\Microsoft\ServerAppliance\WebFramework"
  708. updatePortNumber=False 'Default initialization
  709. Set objRegistry=RegConnection() 'Connecting to the registry
  710. If Err.number <> 0 Then
  711. SA_SetErrMsg L_REGISTRYCONNECTIONFAIL_ERRORMESSAGE
  712. Exit Function
  713. End If
  714. bReturnValue = updateRegkeyvalue(objRegistry ,CONST_PORT_REGKEYPATH , strPortKey , nportNumber , CONST_DWORD )
  715. If bReturnValue = False Then 'If return status is error
  716. Exit function
  717. End If
  718. Set objRegistry = Nothing
  719. updatePortNumber=TRUE ' on success
  720. End function
  721. '-------------------------------------------------------------------------
  722. 'Function name: GetAdminWebSite
  723. 'Description: Get Admin web site name
  724. 'Input Variables: objAdminService
  725. 'Output Variables: None
  726. 'Global Variables: L_(*)
  727. 'Returns: Admin web site name
  728. '-------------------------------------------------------------------------
  729. Function GetAdminWebSite(objAdminService)
  730. Err.Clear
  731. On Error Resume Next
  732. Dim strWMIpath 'WMI query
  733. Dim objSiteCollection 'Get instance of IIs_WebServerSetting class
  734. Dim objSite 'Get instances of IIs_WebServerSetting class
  735. Dim objHTTPAdminService
  736. Call SA_TraceOut( SOURCE_FILE, "GetAdminWebSite")
  737. 'Constant for the admin web site
  738. Const CONST_MANAGEDSITENAME = "Administration"
  739. Set objHTTPAdminService = objAdminService
  740. 'WMI query
  741. 'XPE only has one website
  742. If CONST_OSNAME_XPE = GetServerOSName() Then
  743. 'WMI query
  744. strWMIpath = "Select * from " & GetIISWMIProviderClassName("IIs_WebServerSetting") & " where Name =" & chr(34) & GetCurrentWebsiteName() & chr(34)
  745. Else
  746. strWMIpath = "Select * from " & GetIISWMIProviderClassName("IIs_WebServerSetting") & " where ServerComment =" & chr(34) & CONST_MANAGEDSITENAME & chr(34)
  747. End If
  748. 'Create instance of IIs_WebServerSetting
  749. Set objSiteCollection = objHTTPAdminService.ExecQuery(strWMIpath)
  750. If Err.Number <> 0 Then
  751. Call SA_ServeFailurePage (L_IIS_WEBSERVERCONNECTION_ERRORMESSAGE & " (" & HEX(Err.Number) & ")")
  752. Exit Function
  753. End If
  754. 'Get the admin web site name
  755. For each objSite in objSiteCollection
  756. GetAdminWebSite = objSite.Name
  757. Exit For
  758. Next
  759. 'If admin site name is empty display error
  760. If GetAdminWebSite = "" Then
  761. Call SA_ServeFailurePage (L_COULDNOT_ADMIN_WEBSITE_ERRORMESSAGE)
  762. Exit Function
  763. End If
  764. 'Release objects
  765. Set objSite = Nothing
  766. Set objSiteCollection = Nothing
  767. Set objHTTPAdminService = Nothing
  768. End Function
  769. '-------------------------------------------------------------------------
  770. 'Subroutine name: GetSystemNICConfig
  771. 'Desription: Gets all the NIC IP's from the system
  772. 'Input Variables: F_strNonEncryptedIPAddress
  773. 'Output variables: None
  774. 'Global Variables: G_objService,CONST_WMI_WIN32_NAMESPACE,L_(*)
  775. '-------------------------------------------------------------------------
  776. Sub GetSystemNICConfig(F_strNonEncryptedIPAddress)
  777. Err.clear
  778. On Error Resume Next
  779. Dim objConfiguredIPs 'To get instance of win32_NetworkAdapterConfiguration
  780. Dim objNICIP 'To get instances of win32_NetworkAdapterConfiguration
  781. Dim strNICQuery 'WMI query
  782. Dim nCount 'Count to get IP address for all NIC cards
  783. Dim arrIPList(13) 'Array to store all the IP addresses
  784. Call SA_TraceOut( SOURCE_FILE, "GetSystemNICConfig")
  785. 'Connecting to the WMI server
  786. Set G_objService = GetWMIConnection(CONST_WMI_WIN32_NAMESPACE)
  787. If Err.number <> 0 Then
  788. Call SA_ServeFailurePage (L_WMICONNECTIONFAILED_ERRORMESSAGE & " (" & HEX(Err.Number) & ")" )
  789. Exit Sub
  790. End if
  791. 'WMI query
  792. strNICQuery = "select * from win32_NetworkAdapterConfiguration Where IPEnabled = true"
  793. 'Getting instance of win32_NetworkAdapterConfiguration
  794. Set objConfiguredIPs = G_objService.ExecQuery(strNICQuery)
  795. If Err.number <> 0 then
  796. Call SA_ServeFailurePage (L_FAILEDTOGET_IPADDRESS_ERRORMESSAGE & " (" & HEX(Err.Number) & ")" )
  797. Exit Sub
  798. End If
  799. 'Populate the IP address combo box
  800. For each objNICIP in objConfiguredIPs
  801. If IsArray(objNICIP.IPAddress) Then
  802. For nCount = 0 to ubound(objNICIP.IPAddress)
  803. Redim arrIPList(ubound(objNICIP.IPAddress))
  804. arrIPList(nCount) = objNICIP.IPAddress(nCount)
  805. If arrIPList(nCount) <> "" Then
  806. If (arrIPList(nCount) = F_strNonEncryptedIPAddress ) Then
  807. Response.Write "<OPTION VALUE='" & arrIPList(nCount) &"' SELECTED >" & arrIPList(nCount) & "</OPTION>"
  808. Else
  809. Response.Write "<OPTION VALUE='" & arrIPList(nCount) &"' >" & arrIPList(nCount) & "</OPTION>"
  810. End IF
  811. End If
  812. Next
  813. End If
  814. Next
  815. 'Release objects
  816. Set objConfiguredIPs = nothing
  817. Set objNICIP = nothing
  818. End Sub
  819. '-------------------------------------------------------------------------
  820. 'Function name: GetSystemSettings
  821. 'Description: Serves in getting the IP addresses, encrypted and non-encrypted
  822. ' port number from System for Admin web site
  823. 'Input Variables: None
  824. 'Output Variables: None
  825. 'Returns: True/False
  826. 'Global Variables: G_objAdminService, CONST_WMI_IIS_NAMESPACE, L_(*),F(*)
  827. '-------------------------------------------------------------------------
  828. Function GetSystemSettings()
  829. Err.Clear
  830. On Error resume Next
  831. Dim objNACCollection 'Object to get WMI connection
  832. Dim objinst 'Getting instances of IIs_WebServerSetting
  833. Dim arrWinsSrv 'Array to store the IP address and non-encrypted port number
  834. Dim arrWinsSecureSrv 'Array to store the IP address and encrypted port number
  835. Dim arrIPAdd 'Array to store the IP address for non-encrypted sites
  836. Dim arrPort 'Array to store the port for non-encrypted sites
  837. Dim arrSecureIPAdd 'Array to store the IP address for encrypted sites
  838. Dim arrSecurePort 'Array to store the port for encrypted sites
  839. Dim nIPCount 'Count for getting the IP address and encrypted port number
  840. Dim strServerBindings 'To store the values obtained from ServerBindings property
  841. Dim strAdminWebSite 'Admin web site name
  842. Dim nSecureCount 'Count for getting the IP address and encrypted port number
  843. Dim strSecureBindings 'To store the values obtained from SecureBindings property
  844. Dim strIISAdminWebSite 'IIS Admin Web Site name
  845. Dim objIISVirtualDir 'Getting the IIs_WebVirtualDirSetting instance
  846. Dim objIISDirInstances 'Getting the IIs_WebVirtualDirSetting instances
  847. Dim strAccessSSL 'To store AccessSSL value
  848. Call SA_TraceOut( SOURCE_FILE, "GetSystemSettings")
  849. Const CONST_ARR_INDEX_IP = 0 'For IP address
  850. Const CONST_ARR_INDEX_PORT = 1 'For port number
  851. 'Connecting to the WMI server
  852. Set G_objAdminService = GetWMIConnection(CONST_WMI_IIS_NAMESPACE)
  853. 'Get the HTTP admin web site name
  854. strAdminWebSite = GetAdminWebSite(G_objAdminService)
  855. strIISAdminWebSite = strAdminWebSite & "/Root"
  856. 'Getting the admin web server setting instance
  857. Set objNACCollection = G_objAdminService.ExecQuery("Select * from " & GetIISWMIProviderClassName("IIs_WebServerSetting") & " where Name=" & Chr(34)& strAdminWebSite & Chr(34))
  858. If Err.Number <> 0 Then
  859. Call SA_ServeFailurePage (L_IIS_WEBSERVERCONNECTION_ERRORMESSAGE & " (" & HEX(Err.Number) & ")")
  860. GetSystemSettings = False
  861. Exit Function
  862. End If
  863. For each objinst in objNACCollection
  864. If IsArray(objinst.ServerBindings) Then
  865. 'Getting the IP address and non-encrypted port number from server bindings property
  866. For nIPCount = 0 to ubound(objinst.ServerBindings)
  867. strServerBindings = objinst.ServerBindings(nIPCount)
  868. if IsIIS60Installed() Then
  869. If IsObject(objinst.ServerBindings(nIPCount)) then
  870. arrIPAdd = objinst.ServerBindings(nIPCount).IP
  871. arrPort = objinst.ServerBindings(nIPCount).Port
  872. F_strNonEncryptedIPAddress = arrIPAdd
  873. F_nNonEncryptedPort =arrPort
  874. End if 'If IsObject(..)
  875. Else
  876. If strServerBindings <> "" then
  877. 'split the strServerBindings array to get the IP address and port number
  878. arrWinsSrv = split(strServerBindings,":")
  879. arrIPAdd = arrWinsSrv(CONST_ARR_INDEX_IP)
  880. arrPort = arrWinsSrv(CONST_ARR_INDEX_PORT)
  881. F_strNonEncryptedIPAddress = arrIPAdd
  882. F_nNonEncryptedPort =arrPort
  883. End if
  884. End If 'if IsIIS60Installed()
  885. Next
  886. End If
  887. If IsArray(objinst.SecureBindings) Then
  888. 'Getting the IP address and encrypted port number from secure bindings property
  889. For nSecureCount = 0 to ubound(objinst.SecureBindings)
  890. strSecureBindings = objinst.SecureBindings(nSecureCount)
  891. if IsIIS60Installed() Then
  892. If IsObject(objinst.SecureBindings(nSecureCount)) then
  893. arrSecureIPAdd = objinst.SecureBindings(nSecureCount).IP
  894. arrSecurePort = objinst.SecureBindings(nSecureCount).Port
  895. If IsEmpty(arrSecurePort) or IsNull(arrSecurePort) Then
  896. arrSecurePort = ""
  897. Else
  898. 'Get rid of the ':'
  899. arrSecurePort = CLng(Replace(arrSecurePort, ":", ""))
  900. End If
  901. F_strEncryptedIPAddress = arrSecureIPAdd
  902. F_nEncryptedPort = arrSecurePort
  903. End if 'If IsObject(...)
  904. Else
  905. If strSecureBindings <> "" then
  906. 'split the strServerBindings array to get the IP address and port number
  907. arrWinsSecureSrv = split(strSecureBindings,":")
  908. arrSecureIPAdd = arrWinsSecureSrv(CONST_ARR_INDEX_IP)
  909. arrSecurePort = arrWinsSecureSrv(CONST_ARR_INDEX_PORT)
  910. F_strEncryptedIPAddress = arrWinsSecureSrv(CONST_ARR_INDEX_IP)
  911. F_nEncryptedPort = arrWinsSecureSrv(CONST_ARR_INDEX_PORT)
  912. End if
  913. End If 'if IsIIS60Installed()
  914. Next
  915. End If
  916. Next
  917. 'Error in getting the server IP address, encrypted and non-encrypted port number
  918. If Err.Number <> 0 Then
  919. Call SA_ServeFailurePage (L_COULDNOT_IIS_WEBSERVER_OBJECT_ERRORMESSAGE & " (" & HEX(Err.Number) & ")")
  920. GetSystemSettings = False
  921. Exit Function
  922. End If
  923. 'Getting the IIs_WebVirtualDirSetting instance
  924. Set objIISVirtualDir = G_objAdminService.ExecQuery("Select * from " & GetIISWMIProviderClassName("IIs_WebVirtualDirSetting") & " where Name=" & Chr(34)& strIISAdminWebSite & Chr(34))
  925. If Err.Number <> 0 Then
  926. Call SA_ServeFailurePage (L_IIS_WEBSERVERCONNECTION_ERRORMESSAGE & " (" & HEX(Err.Number) & ")")
  927. GetSystemSettings = False
  928. Exit Function
  929. End If
  930. Set objIISVirtualDir = Nothing
  931. Set objIISDirInstances = Nothing
  932. 'Set the Radion button status depending on the system settings
  933. If arrIPAdd = "" and arrSecureIPAdd = "" then
  934. F_strAll_IPAddress = CONST_ARR_STATUS_CHECKED
  935. F_strJustthis_IPAddress =""
  936. F_strradIPAdd = CONST_ARR_STATUS_TRUE
  937. ElseIf ((arrIPAdd <> "" and arrSecureIPAdd <> "") and (arrIPAdd = arrSecureIPAdd)) then
  938. F_strJustthis_IPAddress = CONST_ARR_STATUS_CHECKED
  939. F_strAll_IPAddress = ""
  940. F_strradIPAdd = CONST_ARR_STATUS_FALSE
  941. Else
  942. F_strJustthis_IPAddress = ""
  943. F_strAll_IPAddress = ""
  944. F_strradIPAdd = CONST_ARR_STATUS_NONE
  945. End if
  946. 'Release objects
  947. Set objinst = Nothing
  948. Set objNACCollection = Nothing
  949. GetSystemSettings = True
  950. End Function
  951. %>