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.

857 lines
28 KiB

  1. <%
  2. '
  3. ' Copyright (c) Microsoft Corporation. All rights reserved.
  4. '
  5. '-------------------------------------------------------------------------
  6. 'General Site Property page
  7. '-------------------------------------------------------------------------
  8. '-------------------------------------------------------------------------
  9. ' Start of declaring form variables
  10. '-------------------------------------------------------------------------
  11. Dim F_strSiteID 'holds siteidentifier value
  12. Dim F_strDir 'holds site directory path
  13. Dim F_strWebRootDir 'holds website root path
  14. Dim F_strAdminName 'holds admin name value
  15. Dim F_strAdminPswd 'holds admin password
  16. Dim F_strConfirmPswd 'holds Confirm password value
  17. Dim F_strCreatePathChecked 'holds value to create the direcrory path
  18. Dim F_strAccountLocation 'holds value to account location
  19. %>
  20. <!-- #include file="inc_wsa.js" -->
  21. <script language="Javascript">
  22. function GenInit()
  23. {
  24. }
  25. function GenValidatePage()
  26. {
  27. //do all the validation and return false if data is invalid
  28. // validate site identifier values
  29. var strID;
  30. var strDir;
  31. var strIndex;
  32. //validate site ID
  33. strID= document.frmTask.txtSiteID.value;
  34. if(document.frmTask.txtSiteID.value=="")
  35. {
  36. DisplayErr("<%= Server.HTMLEncode(L_ID_NOTEMPTY_ERROR_MESSAGE)%>");
  37. document.frmTask.txtSiteID.focus();
  38. return false;
  39. }
  40. if (!(checkKeyforValidCharacters(strID,"id")))
  41. return false;
  42. // validate directory
  43. strDir = document.frmTask.txtDir.value;
  44. if(strDir=="")
  45. {
  46. document.frmTask.onkeypress = ClearErr;
  47. DisplayErr("<%=Server.HTMLEncode(L_DIR_NOTEMPTY_ERROR_MESSAGE)%>");
  48. document.frmTask.txtDir.focus();
  49. document.frmTask.onkeypress = ClearErr;
  50. return false;
  51. }
  52. if (!(checkKeyforValidCharacters(strDir,"dir")))
  53. return false;
  54. strIndex = strID.indexOf("\\\\");
  55. if (strIndex > 0)
  56. {
  57. DisplayErr("<%= Server.HTMLEncode(L_INVALID_DIR_ERRORMESSAGE) %>");
  58. document.frmTask.txtDir.focus();
  59. return false;
  60. }
  61. // Check whether Admin text is null
  62. if(document.frmTask.txtSiteAdmin.value == "")
  63. {
  64. DisplayErr("<%=Server.HTMLEncode(L_ADMIN_NOTEMPTY_ERROR_MESSAGE)%>");
  65. document.frmTask.txtSiteAdmin.focus();
  66. document.frmTask.onkeypress = ClearErr;
  67. return false;
  68. }
  69. // Check for Admin Password
  70. if (document.frmTask.txtAdminPwd.value != document.frmTask.txtConfirmPswd.value)
  71. {
  72. document.frmTask.txtAdminPwd.value="";
  73. document.frmTask.txtConfirmPswd.value="";
  74. DisplayErr("<%=Server.HTMLEncode(L_PWD_MISMATCH_ERROR_MESSAGE)%>");
  75. document.frmTask.txtAdminPwd.focus();
  76. return false;
  77. }
  78. document.frmTask.hdnchkCreatePath.value =
  79. document.frmTask.chkCreatePath.checked;
  80. return true;
  81. }
  82. function GenSetData()
  83. {
  84. var i;
  85. for(i=0;i<2;i++)
  86. {
  87. if(document.frmTask.radAccountLocation[i].checked == true)
  88. {
  89. document.frmTask.hdnAccountLocation.value =
  90. document.frmTask.radAccountLocation[i].value;
  91. }
  92. }
  93. return true;
  94. }
  95. function ClickLocalUser()
  96. {
  97. GenerateAdmin();
  98. document.frmTask.txtSiteAdmin.readOnly = true;
  99. document.frmTask.txtSiteAdmin.style.backgroundColor = "silver";
  100. document.frmTask.txtAdminPwd.disabled = false;
  101. document.frmTask.txtAdminPwd.style.backgroundColor = "white";
  102. document.frmTask.txtConfirmPswd.disabled = false;
  103. document.frmTask.txtConfirmPswd.style.backgroundColor = "white";
  104. document.frmTask.txtAdminPwd.focus();
  105. }
  106. function ClickExistUser()
  107. {
  108. document.frmTask.txtSiteAdmin.readOnly = false;
  109. document.frmTask.txtSiteAdmin.style.backgroundColor = "white";
  110. document.frmTask.txtSiteAdmin.value = "";
  111. document.frmTask.txtAdminPwd.disabled = true;
  112. document.frmTask.txtAdminPwd.style.backgroundColor = "silver";
  113. document.frmTask.txtConfirmPswd.disabled = true;
  114. document.frmTask.txtConfirmPswd.style.backgroundColor = "silver";
  115. document.frmTask.txtSiteAdmin.focus();
  116. }
  117. </script>
  118. <%
  119. '-------------------------------------------------------------------------
  120. 'Function name :Generalviewtab
  121. 'Description :Serves in getting the general properties page
  122. 'Input Variables :None
  123. 'Output Variables :None
  124. 'Returns :(True / Flase )
  125. 'Global Variables :None
  126. ' in :L_*
  127. '--------------------------------------------------------------------------
  128. Function Generalviewtab()
  129. if GetWebSiteRootVal(F_strWebRootDir) <> CONST_SUCCESS then
  130. SA_TraceOut "sitenew_prop", "Unable to get the web site root directory"
  131. end if
  132. %>
  133. <TABLE WIDTH=518 VALIGN=middle ALIGN=left BORDER=0 CELLSPACING=0 CELLPADDING=2 class="TasksBody" >
  134. <TR>
  135. <TD class="TasksBody" colspan=3>
  136. <% CheckForSecureSite() %>
  137. </TD>
  138. </TR>
  139. <TR>
  140. <TD class="TasksBody">
  141. &nbsp;
  142. </TD>
  143. </TR>
  144. <TR>
  145. <TD class="TasksBody" nowrap>
  146. <%=L_GEN_SITE_ID_TEXT%>
  147. </TD>
  148. <TD class="TasksBody" colspan=2>
  149. <input type=text class="formField" NAME="txtSiteID" MAXLENGTH="12" SIZE="30" value="<%=server.HTMLEncode(F_strSiteID)%>" onKeyPress = "GenerateDir(this); ClearErr();" onblur="GenerateAdmin();">
  150. </TD>
  151. </TR>
  152. <TR>
  153. <TD class="TasksBody">
  154. <%=L_GEN_SITE_DIR_TEXT%>
  155. </TD>
  156. <TD class="TasksBody">
  157. <input type=text class="formField" NAME="txtDir" SIZE="30" value="<%=server.HTMLEncode(F_strDir)%>" onKeyPress = "ClearErr();">
  158. </TD>
  159. <TD class="TasksBody" nowrap>
  160. <% if server.HTMLEncode(F_strCreatePathChecked) = "true" then %>
  161. <input type=checkbox class="formField" NAME="chkCreatePath" checked>
  162. <% else %>
  163. <input type=checkbox class="formField" NAME="chkCreatePath">
  164. <% end if %>
  165. <%=L_GEN_SITE_CREATEDIR_TEXT%>
  166. </TD>
  167. </TR>
  168. <TR>
  169. <TD class="TasksBody" COLSPAN=3><HR></TD>
  170. </TR>
  171. <TR>
  172. <%If F_strAccountLocation = "1" Then %>
  173. <TD class="TasksBody" colspan=3>
  174. <input type=radio class="FormRadioButton" NAME="radAccountLocation" value="1" checked onclick = "ClickLocalUser();">
  175. <%=L_CREATE_LOCAL_USER%>
  176. </TD>
  177. <%Else%>
  178. <TD class="TasksBody" colspan=3>
  179. <input type=radio class="FormRadioButton" NAME="radAccountLocation" value="1" onclick = "ClickLocalUser();">
  180. <%=L_CREATE_LOCAL_USER%>
  181. </TD>
  182. <%End If%>
  183. </TR>
  184. <TR>
  185. <%If F_strAccountLocation = "2" Then %>
  186. <TD class="TasksBody" colspan=3>
  187. <input type=radio class="FormRadioButton" NAME="radAccountLocation" value="2" checked onclick = "ClickExistUser();">
  188. <%=L_CREATE_EXIST_USER%>
  189. </TD>
  190. <%Else%>
  191. <TD class="TasksBody" colspan=3>
  192. <input type=radio class="FormRadioButton" NAME="radAccountLocation" value="2" onclick = "ClickExistUser();">
  193. <%=L_CREATE_EXIST_USER%>
  194. </TD>
  195. <%End If%>
  196. </TR>
  197. <%If F_strAccountLocation <> "2" Then%>
  198. <TR>
  199. <TD class="TasksBody" nowrap>
  200. <%=L_GEN_SITE_ADMIN_TEXT%>
  201. </TD>
  202. <TD class="TasksBody" colspan = 2>
  203. <input type=text class="formField" NAME="txtSiteAdmin" style="background-color:silver" readonly MAXLENGTH="256" SIZE="30" value="<%=server.HTMLEncode(F_strAdminName)%>" OnKeypress="checkKeyforCharacters(this)">
  204. </TD>
  205. </TR>
  206. <TR>
  207. <TD class="TasksBody" nowrap>
  208. <%=L_GEN_SITE_ADMIN_PSWD_TEXT%>
  209. </TD>
  210. <TD class="TasksBody" colspan = 2>
  211. <input type=password class="formField" NAME="txtAdminPwd" MAXLENGTH="127" SIZE="30" value="<%=server.HTMLEncode(F_strAdminPswd)%>" OnKeypress="ClearErr();" onfocus="this.select();">
  212. </TD>
  213. </TR>
  214. <TR>
  215. <TD class="TasksBody" nowrap>
  216. <%=L_GEN_SITE_CONFIRM_PSWD_TEXT%>
  217. </TD>
  218. <TD class="TasksBody" colspan = 2>
  219. <input type=password class="formField" NAME="txtConfirmPswd" MAXLENGTH="127" SIZE="30" value="<%=server.HTMLEncode(F_strConfirmPswd)%>" onKeyPress = "ClearErr();" onfocus="this.select();">
  220. </TD>
  221. </TR>
  222. <%Else%>
  223. <TR>
  224. <TD class="TasksBody" nowrap>
  225. <%=L_GEN_SITE_ADMIN_TEXT%>
  226. </TD>
  227. <TD class="TasksBody" colspan = 2>
  228. <input type=text class="formField" NAME="txtSiteAdmin" MAXLENGTH="256" SIZE="30" value="<%=server.HTMLEncode(F_strAdminName)%>" OnKeypress="checkKeyforCharacters(this)">
  229. </TD>
  230. </TR>
  231. <TR>
  232. <TD class="TasksBody" nowrap>
  233. <%=L_GEN_SITE_ADMIN_PSWD_TEXT%>
  234. </TD>
  235. <TD class="TasksBody" colspan = 2>
  236. <input type=password class="formField" NAME="txtAdminPwd" style="background-color:silver" readonly MAXLENGTH="127" SIZE="30" value="<%=server.HTMLEncode(F_strAdminPswd)%>" OnKeypress="ClearErr();" onfocus="this.select();">
  237. </TD>
  238. </TR>
  239. <TR>
  240. <TD class="TasksBody" nowrap>
  241. <%=L_GEN_SITE_CONFIRM_PSWD_TEXT%>
  242. </TD>
  243. <TD class="TasksBody" colspan = 2>
  244. <input type=password class="formField" NAME="txtConfirmPswd" style="background-color:silver" readonly MAXLENGTH="127" SIZE="30" value="<%=server.HTMLEncode(F_strConfirmPswd)%>" onKeyPress = "ClearErr();" onfocus="this.select();">
  245. </TD>
  246. </TR>
  247. <%End If%>
  248. </TABLE>
  249. <input type=hidden name=hdnWebRootDir value = "<%=server.HTMLEncode(F_strWebRootDir)%>" >
  250. <input type=hidden name=hdnAccountLocation value = "<%=server.HTMLEncode(F_strAccountLocation)%>" >
  251. <input type=hidden name=hdnchkCreatePath value="<%=server.HTMLEncode(F_strCreatePathChecked)%>">
  252. <%
  253. End Function
  254. '-------------------------------------------------------------------------
  255. 'Function name :Generalhiddentab
  256. 'Description :Serves in setting the hidden fields for general properties page
  257. 'Input Variables :None
  258. 'Output Variables :None
  259. 'Returns :(True / Flase )
  260. 'Global Variables :None
  261. ' in :L_*
  262. '--------------------------------------------------------------------------
  263. Function Generalhiddentab()
  264. %>
  265. <input type=hidden name=txtSiteID value = "<%=server.HTMLEncode(F_strSiteID)%>" >
  266. <input type=hidden name=txtDir value = "<%=server.HTMLEncode(F_strDir)%>" >
  267. <input type=hidden name=txtSiteAdmin value = "<%=server.HTMLEncode(F_strAdminName)%>" >
  268. <input type=hidden name=txtAdminPwd value = "<%=server.HTMLEncode(F_strAdminPswd)%>" >
  269. <input type=hidden name=txtConfirmPswd value = "<%=server.HTMLEncode(F_strConfirmPswd)%>" >
  270. <input type=hidden name=hdnchkCreatePath value="<%=server.HTMLEncode(F_strCreatePathChecked)%>">
  271. <input type=hidden name=hdnAccountLocation value = "<%=server.HTMLEncode(F_strAccountLocation)%>" >
  272. <%
  273. End Function
  274. 'set form variables to be input for post back function
  275. Function SetGenFormVariables()
  276. F_strSiteID = Request.Form("txtSiteID")
  277. F_strDir = Request.Form("txtDir")
  278. F_strAdminName = Request.Form("txtSiteAdmin")
  279. F_strAdminPswd = Request.Form("txtAdminPwd")
  280. F_strConfirmPswd = Request.Form("txtConfirmPswd")
  281. F_strCreatePathChecked = Request.Form("hdnchkCreatePath")
  282. F_strAccountLocation = Request.Form("hdnAccountLocation")
  283. 'Call SA_TRACEOUT("SetGenFormVariables","F_strAccountLocation="&F_strAccountLocation)
  284. End Function
  285. '----------------------------------------------------------
  286. 'Site identites Property page
  287. '----------------------------------------------------------
  288. '-------------------------------------------------------------------------
  289. ' Start of declaring form variables
  290. '-------------------------------------------------------------------------
  291. Dim F_strIPAddr 'holds IPAddress value
  292. Dim F_strPort 'holds port value
  293. Dim F_strHeader 'holds Site header value
  294. '-------------------------------------------------------------------------
  295. ' End of declaring form variables
  296. '-------------------------------------------------------------------------
  297. %>
  298. <script language="Javascript" >
  299. function SiteInit()
  300. {
  301. //do all the init
  302. }
  303. function SiteValidatePage()
  304. {
  305. //do all the validation
  306. if(document.frmTask.txtPort.value == 0)
  307. {
  308. document.frmTask.txtPort.value = "";
  309. DisplayErr("<%= Server.HTMLEncode(L_VALID_PORT_ERRORMESSAGE) %>");
  310. document.frmTask.txtPort.focus();
  311. return false;
  312. }
  313. return true;
  314. }
  315. function SiteSetData()
  316. {
  317. }
  318. </script>
  319. <%
  320. '-------------------------------------------------------------------------
  321. 'Function name :SiteIdentitiesViewTab
  322. 'Description :Serves in getting the Site Identities properties page
  323. 'Input Variables :None
  324. 'Output Variables :None
  325. 'Returns :(True / Flase )
  326. 'Global Variables :None
  327. ' in :L_*
  328. '--------------------------------------------------------------------------
  329. Function SiteIdentitiesViewTab()
  330. Dim objService 'holds WMI Connection object
  331. Dim ObjIPCollection 'holds IPCollection object
  332. Dim instIPAddr 'holds instance of IPAddress
  333. Dim IPCount 'holds instance of IP count
  334. Set objService =getWMIConnection(CONST_WMI_WIN32_NAMESPACE)
  335. Set objIPCollection = objService.execquery("select * from Win32_NetworkAdapterConfiguration where IPEnabled=true")
  336. %>
  337. <TABLE WIDTH=518 VALIGN=middle ALIGN=left BORDER=0 CELLSPACING=0 CELLPADDING=2 class="TasksBody" >
  338. <TR>
  339. <TD class="TasksBody">
  340. <%=L_SITE_IPADDR_TEXT%>
  341. </TD>
  342. <TD class="TasksBody">
  343. <select class="formField" NAME="cboIPAddr" MAXLENGTH="80" SIZE="1" value="<%=server.HTMLEncode(F_strIPAddr)%>">
  344. <option value=""><%=L_IP_UNASSIGNED_TEXT%></option>
  345. <%if server.HTMLEncode(F_strIPAddr)<>"" then %>
  346. <option value="<%=server.HTMLEncode(F_strIPAddr)%>" selected><%=server.HTMLEncode(F_strIPAddr) %></option>
  347. <%end if%>
  348. <% for each instIPAddr in objIPCollection
  349. for IPCount =0 to ubound(instIPAddr.IPAddress)
  350. if instIPAddr.IPAddress(IPCount)<> server.HTMLEncode(F_strIPAddr) then %>
  351. <option value="<%=instIPAddr.IPAddress(IPCount)%>"><%=instIPAddr.IPAddress(IPCount) %></option>
  352. <%end if
  353. Next
  354. Next
  355. set ObjIPCollection = nothing
  356. set objService = nothing
  357. %>
  358. </select>
  359. </TD>
  360. </TR>
  361. <TR>
  362. <TD class="TasksBody">
  363. <%=L_SITE_TCPPORT_TEXT%>
  364. </TD>
  365. <TD class="TasksBody">
  366. <%if server.HTMLEncode(F_strPort)<>"" then%>
  367. <input type=text class="formField" NAME="txtPort" SIZE="10" value="<%=server.HTMLEncode(F_strPort)%>" OnKeyUP="checkUserLimit(this,'port')" OnKeypress="checkkeyforNumbers(this)" OnBlur= "checkfordefPortValue(this);">
  368. <%else%>
  369. <input type=text class="formField" NAME="txtPort" SIZE="10" value="80" OnKeyUP="checkUserLimit(this,'port')" OnKeypress="checkkeyforNumbers(this)" OnBlur= "checkfordefPortValue(this);">
  370. <%end if%>
  371. </TD>
  372. </TR>
  373. <TR>
  374. <TD class="TasksBody">
  375. <%=L_SITE_HOST_HEADER_TEXT%>
  376. </TD>
  377. <TD class="TasksBody">
  378. <input type=text class="formField" NAME="txtHeader" MAXLENGTH="256" SIZE="40" value="<%=server.HTMLEncode(F_strHeader)%>" OnKeypress="headerscheckKeyforCharacters(this)">
  379. </TD>
  380. </TR>
  381. </TABLE>
  382. <%
  383. End Function
  384. '------------------------------------------------------------------------------------------
  385. 'Function name :SiteIdentitiesHiddenTab
  386. 'Description :Serves in setting the hidden fields in Site Identities properties page
  387. 'Input Variables :None
  388. 'Output Variables :None
  389. 'Returns :(True / Flase )
  390. 'Global Variables :None
  391. ' in :L_*
  392. '-----------------------------------------------------------------------------------------
  393. Function SiteIdentitiesHiddenTab()
  394. %>
  395. <input type=hidden name=cboIPAddr value = "<%=server.HTMLEncode(F_strIPAddr)%>" >
  396. <input type=hidden name=txtPort value = "<%=server.HTMLEncode(F_strPort)%>" >
  397. <input type=hidden name=txtHeader value = "<%=server.HTMLEncode(F_strHeader)%>" >
  398. <%
  399. End function
  400. Function SetSiteIdentitiesFormVariables()
  401. F_strIPAddr = Request.Form("cboIPAddr")
  402. F_strPort = Request.Form("txtPort")
  403. F_strHeader = Request.Form("txtHeader")
  404. End Function
  405. '-------------------------------------------------------------------------
  406. ' Start of declaring form variables
  407. '-------------------------------------------------------------------------
  408. Dim F_selectActiveFormat
  409. Dim F_selectDefaultPage
  410. Dim F_strchkFront
  411. Dim F_strchkAllow
  412. Dim F_strCreateFTPSite 'holds value to create FTP site
  413. Dim F_strDefaultPageText
  414. Dim F_strUploadMethod 'holds value to upload content method (neither, FTP, or FPSE)
  415. '-------------------------------------------------------------------------
  416. ' End of declaring form variables
  417. '-------------------------------------------------------------------------
  418. if GetFPSEOption() = true Then
  419. F_strUploadMethod = UPLOADMETHOD_FPSE
  420. Else
  421. F_strUploadMethod = UPLOADMETHOD_NEITHER
  422. End If
  423. F_strchkAllow = "true"
  424. F_strDefaultPageText = "Default.htm,Default.asp"
  425. %>
  426. <script language="Javascript" >
  427. function ApplInit()
  428. {
  429. SetButtonSelectedState();
  430. }
  431. function OnPageItemSelected()
  432. {
  433. SetButtonSelectedState();
  434. }
  435. function SetButtonSelectedState()
  436. {
  437. var bSelect;
  438. var index = document.frmTask.selectDefaultPage.selectedIndex;
  439. //
  440. // Was an item selected?
  441. if( index < 0)
  442. {
  443. bSelect = false;
  444. }
  445. else
  446. {
  447. bSelect = true;
  448. }
  449. var oMoveUp = document.getElementById("btnMoveUp");
  450. if ( oMoveUp != null ) {
  451. SA_EnableButton(oMoveUp, bSelect);
  452. }
  453. var oMoveDown = document.getElementById("btnMoveDown");
  454. if ( oMoveDown != null ) {
  455. SA_EnableButton(oMoveDown, bSelect);
  456. }
  457. var oRemove = document.getElementById("btnRemove");
  458. if ( oRemove != null ) {
  459. SA_EnableButton(oRemove, bSelect);
  460. }
  461. }
  462. function ApplValidatePage()
  463. {
  464. //do all the validation
  465. document.frmTask.hdnchkAllow.value =
  466. document.frmTask.chkAllow.checked;
  467. return true;
  468. }
  469. function ApplSetData()
  470. {
  471. var i;
  472. var strText;
  473. strText ="";
  474. for(i=0;i < document.frmTask.selectDefaultPage.length;i++)
  475. {
  476. strText = strText+document.frmTask.selectDefaultPage.options[i].
  477. text+",";
  478. }
  479. strText = strText.substr(0,strText.length-1);
  480. document.frmTask.DefaultPageText.value =strText;
  481. //Get the method for uploading content
  482. for(i=0;i<3;i++)
  483. {
  484. if(document.frmTask.radUploadMethod[i].checked == true)
  485. {
  486. document.frmTask.hdnUploadMethod.value =
  487. document.frmTask.radUploadMethod[i].value;
  488. }
  489. }
  490. }
  491. function ClickAdd()
  492. {
  493. var i;
  494. var oOption;
  495. var filename;
  496. filename = RTrimtext(LTrimtext(document.frmTask.txtFileName.value));
  497. if(document.frmTask.txtFileName.value == ""||
  498. IsAllSpaces(filename))
  499. {
  500. document.frmTask.txtFileName.select();
  501. DisplayErr("<%=Server.HTMLEncode(L_ERR_INPUT_ISEMPTY)%>");
  502. return;
  503. }
  504. //add the file to the top of select
  505. if(document.frmTask.selectDefaultPage.length==12)
  506. {
  507. DisplayErr("<%=Server.HTMLEncode(L_ERR_EXCEED_TWELVE)%>");
  508. return;
  509. }
  510. //check wheather the file in list
  511. for(i=0; i < document.frmTask.selectDefaultPage.length;i++)
  512. {
  513. if(document.frmTask.selectDefaultPage.options[i].text==filename)
  514. {
  515. document.frmTask.txtFileName.select();
  516. document.frmTask.txtFileName.focus();
  517. DisplayErr("<%=Server.HTMLEncode(L_ERR_FILE_EXIST)%>");
  518. return;
  519. }
  520. }
  521. //modify the value of the old option items
  522. var len=document.frmTask.selectDefaultPage.length;
  523. document.frmTask.selectDefaultPage.options[len]=
  524. new Option("",len.toString());
  525. for(i=len;i>0;i--)
  526. document.frmTask.selectDefaultPage.options[i].text=
  527. document.frmTask.selectDefaultPage.options[i-1].text;
  528. document.frmTask.selectDefaultPage.options[0].text=filename;
  529. document.frmTask.selectDefaultPage.options[0].selected = true;
  530. document.frmTask.txtFileName.value="";
  531. document.frmTask.txtFileName.focus();
  532. }
  533. function ClickMoveUp()
  534. {
  535. var index;
  536. var text;
  537. index = document.frmTask.selectDefaultPage.selectedIndex;
  538. //
  539. // Was an item selected?
  540. if( index < 0) return;
  541. //
  542. // Can not move-up the first item
  543. if( index == 0) return;
  544. text = document.frmTask.selectDefaultPage.options[index-1].text;
  545. document.frmTask.selectDefaultPage.options[index-1].text=
  546. document.frmTask.selectDefaultPage.options[index].text;
  547. document.frmTask.selectDefaultPage.options[index].text=text;
  548. document.frmTask.selectDefaultPage.selectedIndex = index-1;
  549. }
  550. function ClickMoveDown()
  551. {
  552. var index;
  553. var text;
  554. if(document.frmTask.selectDefaultPage.length==0)
  555. return;
  556. index = document.frmTask.selectDefaultPage.selectedIndex;
  557. //
  558. // Was an item selected?
  559. if( index < 0) return;
  560. if( index == document.frmTask.selectDefaultPage.length-1)
  561. return;
  562. text = document.frmTask.selectDefaultPage.options[index].text;
  563. document.frmTask.selectDefaultPage.options[index].text=
  564. document.frmTask.selectDefaultPage.options[index+1].text;
  565. document.frmTask.selectDefaultPage.options[index+1].text=text;
  566. document.frmTask.selectDefaultPage.selectedIndex = index+1;
  567. }
  568. function ClickRemove()
  569. {
  570. var index;
  571. if(document.frmTask.selectDefaultPage.length == 0)
  572. return;
  573. index = document.frmTask.selectDefaultPage.selectedIndex;
  574. //
  575. // Was an item selected?
  576. if( index < 0) return;
  577. document.frmTask.selectDefaultPage.remove(index);
  578. if(index == document.frmTask.selectDefaultPage.length)
  579. document.frmTask.selectDefaultPage.selectedIndex=index-1;
  580. else
  581. document.frmTask.selectDefaultPage.selectedIndex =index;
  582. SetButtonSelectedState();
  583. }
  584. </script>
  585. <%
  586. '------------------------------------------------------------------------
  587. 'Application settings Property page
  588. '------------------------------------------------------------------------
  589. '-------------------------------------------------------------------------
  590. 'Function name :ApplicationSettingsViewTab
  591. 'Description :Serves in getting the Site application settings page
  592. 'Input Variables :None
  593. 'Output Variables :None
  594. 'Returns :(True / Flase )
  595. 'Global Variables :None
  596. '--------------------------------------------------------------------------
  597. Function ApplicationSettingsViewTab()
  598. Dim objService 'holds WMI Connection object
  599. Dim FrontIsInstalled
  600. Err.Clear
  601. on error resume next
  602. Set objService = getWMIConnection(CONST_WMI_IIS_NAMESPACE)
  603. 'Determine default execute permissions
  604. Dim objSetting 'holds Webservicesetting connection
  605. Dim inst 'holds instance object
  606. if F_selectActiveFormat = "" then
  607. Set objSetting =objService.Get(GetIISWMIProviderClassName("IIs_WebServiceSetting") & ".Name='W3SVC'")
  608. if objSetting.Name = "W3SVC" then
  609. if objSetting.AccessExecute = TRUE and objSetting.AccessScript = TRUE then
  610. F_selectActiveFormat = 2
  611. elseif objSetting.AccessExecute = false and objSetting.AccessScript = TRUE then
  612. F_selectActiveFormat = 1
  613. elseif objSetting.AccessExecute = false and objSetting.AccessScript = false then
  614. F_selectActiveFormat =0
  615. elseif isnull(objSetting.AccessExecute) and isnull(objSetting.AccessScript) then
  616. F_selectActiveFormat = 0
  617. end if
  618. end if
  619. end if
  620. 'Release the objects
  621. set objSetting = nothing
  622. set objService = nothing
  623. %>
  624. <TABLE WIDTH=400 VALIGN=middle ALIGN=left BORDER=0 CELLSPACING=0 CELLPADDING=0 class="TasksBody">
  625. <TR>
  626. <TD class="TasksBody" nowrap>
  627. <%= L_EXECUTE_PERMISSIONS %>
  628. </TD>
  629. <TD class="TasksBody">
  630. <SELECT class="formField" name="selectActiveFormat" MAXLENGTH="80" size="1" value="<%=server.HTMLEncode(F_selectActiveFormat)%>">
  631. <%
  632. if server.HTMLEncode(F_selectActiveFormat)="0" then %>
  633. <OPTION value="0" selected><%= L_NONE %></OPTION>
  634. <OPTION value="1"><%= L_SCRIPTS_ONLY %></OPTION>
  635. <OPTION value="2"><%= L_SCRIPTS_EXECUTABLES %></OPTION>
  636. <%elseif server.HTMLEncode(F_selectActiveFormat)="1" then %>
  637. <OPTION value="0"><%= L_NONE %></OPTION>
  638. <OPTION value="1" selected><%= L_SCRIPTS_ONLY %></OPTION>
  639. <OPTION value="2"><%= L_SCRIPTS_EXECUTABLES %></OPTION>
  640. <%elseif server.HTMLEncode(F_selectActiveFormat)="2" then %>
  641. <OPTION value="0"><%= L_NONE %></OPTION>
  642. <OPTION value="1"><%= L_SCRIPTS_ONLY %></OPTION>
  643. <OPTION value="2" selected><%= L_SCRIPTS_EXECUTABLES %></OPTION>
  644. <% end if %>
  645. </SELECT>
  646. </TD>
  647. </TR>
  648. <TR><TD class="TasksBody" colspan = 3 >&nbsp;</TD></TR>
  649. <TR><TD class="TasksBody" colspan=3 nowrap ><%=L_DEFAULT_PAGE%></TD></TR>
  650. <TR>
  651. <TD class="TasksBody" rowspan=5 align="right">
  652. <SELECT class="formField" name="selectDefaultPage" MAXLENGTH="12" size="6" style="WIDTH: 100px" onclick='OnPageItemSelected();' >
  653. <%=DisplayDefaultPageItems()%>
  654. </SELECT>
  655. </TD>
  656. </TR>
  657. <TR>
  658. <TD class="TasksBody" colspan = 2 nowrap>
  659. &nbsp;&nbsp;&nbsp;&nbsp;
  660. <%Call SA_ServeOnClickButtonEx(L_BUTTON_FACE_ADD, "", "ClickAdd();", 65, 0, "","btnAdd")%>
  661. &nbsp;&nbsp;&nbsp;&nbsp;
  662. <%=L_FILE_NAME%>&nbsp;&nbsp;
  663. <input type=text class="formField"
  664. NAME="txtFileName"
  665. style = "width:100"
  666. value=""
  667. onkeydown="ClearErr();">
  668. </TD>
  669. </TR>
  670. <TR>
  671. <TD class="TasksBody" colspan = 2 >
  672. &nbsp;&nbsp;&nbsp;&nbsp;
  673. <%Call SA_ServeOnClickButtonEx(L_BUTTON_FACE_MOVE_UP, "", "ClickMoveUp();", 65, 0, "disabled","btnMoveUp")%>
  674. </TD>
  675. </TR>
  676. <TR>
  677. <TD class="TasksBody" colspan = 2 >
  678. &nbsp;&nbsp;&nbsp;&nbsp;
  679. <%Call SA_ServeOnClickButtonEx(L_BUTTON_FACE_MOVE_DOWM, "", "ClickMoveDown();", 65, 0, "disabled","btnMoveDown")%>
  680. </TD>
  681. </TR>
  682. <TR>
  683. <TD class="TasksBody" colspan = 2 >
  684. &nbsp;&nbsp;&nbsp;&nbsp;
  685. <%Call SA_ServeOnClickButtonEx(L_BUTTON_FACE_REMOVE, "", "ClickRemove();", 65, 0, "disabled","btnRemove")%>
  686. </TD>
  687. </TR>
  688. <TR><TD class="TasksBody" colspan = 2>&nbsp;</TD></TR>
  689. <TR>
  690. <TD colspan="2">
  691. <%Call ServeAppSettings(F_strDir, F_strUploadMethod, F_strchkAllow, True)%>
  692. </TD>
  693. </TR>
  694. </TABLE>
  695. <input type=hidden name=DefaultPageText value = "<%=server.HTMLEncode(F_strDefaultPageText)%>">
  696. <input type=hidden name=hdnchkAllow value = "<%=server.HTMLEncode(F_strchkAllow)%>">
  697. <input type=hidden name=hdnUploadMethod value = "<%=server.HTMLEncode(F_strUploadMethod)%>" >
  698. <%
  699. End Function
  700. '-------------------------------------------------------------------------
  701. 'Function name :ApplicationSettingsHiddenTab
  702. 'Description :Serves in storing hidden values
  703. 'Input Variables :None
  704. 'Output Variables :None
  705. 'Returns :(True / Flase )
  706. 'Global Variables :None
  707. '--------------------------------------------------------------------------
  708. Function ApplicationSettingsHiddenTab()
  709. %>
  710. <input type=hidden name=hdnchkAllow value = "<%=server.HTMLEncode(F_strchkAllow)%>">
  711. <input type=hidden name=selectActiveFormat value="<%=server.HTMLEncode(F_selectActiveFormat)%>">
  712. <input type=hidden name=selectDefaultPage value = "<%=server.HTMLEncode(F_selectDefaultPage)%>">
  713. <input type=hidden name=DefaultPageText value = "<%=server.HTMLEncode(F_strDefaultPageText)%>">
  714. <input type=hidden name=hdnUploadMethod value = "<%=server.HTMLEncode(F_strUploadMethod)%>" >
  715. <%
  716. End Function
  717. 'set form variables to be input for post back function
  718. Function SetApplnSettingsFormVariables()
  719. F_strchkAllow = Request.Form("hdnchkAllow")
  720. F_selectActiveFormat = Request.Form("selectActiveFormat")
  721. F_selectDefaultPage = Request.Form("selectDefaultPage")
  722. F_strDefaultPageText = Request.Form("DefaultPageText")
  723. F_strUploadMethod = Request.Form("hdnUploadMethod")
  724. End Function
  725. Function DisplayDefaultPageItems()
  726. On Error Resume Next
  727. Err.Clear
  728. Dim i
  729. Dim arrItems
  730. arrItems = split(F_strDefaultPageText,",")
  731. For i=0 to ubound(arrItems)
  732. If (F_selectDefaultPage = CStr(i)) then
  733. Response.Write("<OPTION value="&chr(34)&CStr(i)&chr(34)&" selected>"&arrItems(i)&"</OPTION>")
  734. Else
  735. Response.Write("<OPTION value="&chr(34)&CStr(i)&chr(34)&">"&arrItems(i)&"</OPTION>")
  736. End If
  737. Next
  738. End Function
  739. %>