Source code of Windows XP (NT5)
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.

620 lines
16 KiB

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3. <!-- #include file="directives.inc" -->
  4. <% if Session("FONTSIZE") = "" then %>
  5. <!--#include file="iito.inc"-->
  6. <% else %>
  7. <!--#include file="iivddir.str"-->
  8. <!--#include file="iiapp.str"-->
  9. <!--#include file="iiamap.str"-->
  10. <%
  11. On Error Resume Next
  12. ' AppIsolated flags - This is the order in which they appear in the select list.
  13. Const IISAO_APPROT_INPROC = 0
  14. Const IISAO_APPROT_POOL = 2
  15. Const IISAO_APPROT_ISOLATE = 1
  16. Dim path, currentobj, spath, approot, thisroot, isApp, instobj, displayapproot, displaythisroot,appStartingPoint
  17. path=UCase(Session("dpath"))
  18. spath=UCase(Session("spath"))
  19. if spath = "" then
  20. spath = Mid(path,1,InStr(path,"/ROOT")-1)
  21. Session("spath")=spath
  22. end if
  23. Set currentobj=GetObject(path)
  24. Set instobj=GetObject(spath)
  25. Session("SpecObj")=spath
  26. Session("SpecProps")=""
  27. approot = UCase(currentobj.AppRoot)
  28. ' if Session("vtype") = "svc" Or IISAO_APPROT_ISOLATE = currentobj.AppIsolated then
  29. ' show process options
  30. isApp = False
  31. if len(approot) <> 0 then
  32. thisroot = UCase(currentobj.ADsPath)
  33. approot = Mid(approot,Instr(approot,"W3SVC")+5)
  34. thisroot = Mid(thisroot,Instr(thisroot,"W3SVC")+5)
  35. if Right(approot,1) = "/" then
  36. thisroot = thisroot & "/"
  37. end if
  38. if thisroot=approot then
  39. isApp = True
  40. end if
  41. Session("approot") = "IIS://LOCALHOST/W3SVC" & Mid(approot,1,len(approot))
  42. end if
  43. approot = Mid(approot,Instr(approot,"ROOT")+4)
  44. thisroot = Mid(thisroot,Instr(thisroot,"ROOT")+4)
  45. if Left(thisroot,1) = "/" then
  46. thisroot = Mid(thisroot,2)
  47. end if
  48. displaythisroot = "[" & instobj.ServerComment & "]" & "/" & thisroot
  49. if Right(displaythisroot,1) = "/" then
  50. displaythisroot = Mid(displaythisroot, 1, len(displaythisroot)-1)
  51. end if
  52. if isApp then
  53. if Left(approot,1) = "/" then
  54. approot = Mid(approot,2)
  55. end if
  56. if Session("vtype") = "svc" then
  57. displayapproot = L_WEBMASTER_TEXT
  58. else
  59. displayapproot = "[" & instobj.ServerComment & "]" & "/" & approot
  60. if Right(displayapproot,1) = "/" then
  61. displayapproot = Mid(displayapproot, 1, len(displayapproot)-1)
  62. end if
  63. end if
  64. appStartingPoint = displayapproot
  65. else
  66. displayapproot = L_NOAPP_TEXT
  67. appStartingPoint = displaythisroot
  68. end if
  69. dirkeyType = "IIsWebDirectory"
  70. %>
  71. <!--#include file="iiset.inc"-->
  72. <!--#include file="iisetfnt.inc"-->
  73. <!--#include file="iiaspstr.inc"-->
  74. <%
  75. function writeFSPath(fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
  76. On Error Resume Next
  77. Dim thispath, fspath, parenttype, parentobj
  78. if Session("vtype") = "dir" then
  79. thispath = Session("dpath")
  80. fspath = ""
  81. parenttype = ""
  82. Do Until Instr(parenttype, "VirtualDir") <> 0
  83. 'we need clear our path not found error..
  84. err = 0
  85. fspath = "/" + fspath
  86. 'and cyle through the baseobj till we find the next whack,
  87. 'building up the path in new name as we go
  88. Do Until Right(thispath,1) = "/"
  89. fspath = Right(thispath,1) & fspath
  90. thispath = Mid(thispath,1,Len(thispath)-1)
  91. Loop
  92. 'add the whack to the beginning of the path...
  93. 'once we're out, we need to lop off the last whack...
  94. thispath = Mid(thispath,1,Len(thispath)-1)
  95. 'and try to set the object again...
  96. Set parentobj=GetObject(thispath)
  97. if err <> 0 then
  98. parenttype = ""
  99. else
  100. parenttype=parentobj.KeyType
  101. end if
  102. Loop
  103. fspath = parentobj.Path & "\" & Replace(fspath,"/","\")
  104. if len(fspath) > 50 then
  105. fspath = Left(fspath, 50) & "..."
  106. end if
  107. writeFSPath = disabletextstart & sFont("","","",True) & fspath & "</FONT>" & disabletextend
  108. else
  109. if Session("vtype") = "svc" then
  110. writeFSPath = disabledbox(err,"text","Path","",fieldsize,fieldsize,onchangeproc,onfocusproc,onblurproc,hidden,adminonly)
  111. else
  112. if Instr(currentobj.Path,"\\") > 0 then
  113. currentobj.Path = ""
  114. end if
  115. writeFSPath = text("Path",fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
  116. end if
  117. end if
  118. end function
  119. %>
  120. <HTML>
  121. <HEAD>
  122. <TITLE></TITLE>
  123. <SCRIPT LANGUAGE="JavaScript">
  124. //our hidden fields can't hold bool vals, so we need to write/read string bools...
  125. var sTRUE = "true"
  126. var sFALSE = "false"
  127. //some other useful constants for clarity...
  128. var WARN = true
  129. <% if Session("vtype")= "svc" or Session ("vtype") = "server" then %>
  130. top.title.Global.helpFileName="iipy_3";
  131. <% elseif Session("vtype") = "dir" then %>
  132. top.title.Global.helpFileName="iipy_15";
  133. <% else %>
  134. top.title.Global.helpFileName="iipy_5";
  135. <% end if %>
  136. var Global=top.title.Global;
  137. <!--#include file="iijsfuncs.inc"-->
  138. function warnWrkingSite()
  139. {
  140. if (top.title.nodeList[Global.selId].isWorkingServer)
  141. {
  142. alert("<%= L_WORKINGSERVER_TEXT %>");
  143. }
  144. }
  145. function disableDefault(dir,fromCntrl, toCntrl){
  146. if (!dir){
  147. if (fromCntrl.value !=""){
  148. toCntrl.value=fromCntrl.value;
  149. fromCntrl.value="";
  150. }
  151. }
  152. else{
  153. if (toCntrl.value !=""){
  154. fromCntrl.value=toCntrl.value;
  155. toCntrl.value="";
  156. }
  157. }
  158. }
  159. function enableDefault(chkCntrl){
  160. chkCntrl.checked=true;
  161. }
  162. function setLog(chkCntrl){
  163. if (chkCntrl.checked){
  164. document.userform.DontLog.value = sFALSE;
  165. }
  166. else{
  167. document.userform.DontLog.value = sTRUE;
  168. }
  169. }
  170. function listFuncs(){
  171. this.writeList=buildListForm;
  172. }
  173. function buildListForm(){
  174. <% if Session("isAdmin") then %>
  175. <% if Session("vtype") <> "dir" then %>
  176. if (document.userform.Path.value !="<%= Replace(currentobj.path,"\","\\") %>"){
  177. top.title.nodeList[top.title.Global.selId].deCache();
  178. }
  179. <% end if %>
  180. <% end if %>
  181. }
  182. function chkPath(pathCntrl){
  183. if (pathCntrl.value != ""){
  184. top.connect.location.href = "iichkpath.asp?path=" + escape(pathCntrl.value);
  185. }
  186. }
  187. function setProtectFlag( selectCtrl )
  188. {
  189. // Const IISAO_APPROT_INPROC = 0
  190. // Const IISAO_APPROT_POOL = 2
  191. // Const IISAO_APPROT_ISOLATE = 1
  192. var sel = selectCtrl.selectedIndex;
  193. if( sel == 0 )
  194. {
  195. document.userform.AppIsolated.value = "<%= IISAO_APPROT_INPROC %>"
  196. }
  197. else if( sel == 1 )
  198. {
  199. document.userform.AppIsolated.value = "<%= IISAO_APPROT_POOL %>"
  200. }
  201. else
  202. {
  203. document.userform.AppIsolated.value = "<%= IISAO_APPROT_ISOLATE %>"
  204. }
  205. }
  206. function setApp(){
  207. if (document.userform.hdnIsApp.value == sFALSE)
  208. {
  209. top.connect.location.href = "iiaction.asp?a=CreateApp&isolate=" + document.userform.AppIsolated.value;
  210. document.userform.hdnStartingPoint.value = "<%= sJSLiteral(appStartingPoint) %>";
  211. document.userform.hdnAppButton.value = "<%= L_REMOVE_TEXT %>";
  212. document.userform.hdnConfigButton.value = "<%= L_CONFIGURE_TEXT %>";
  213. document.userform.hdnMapButton.value = "<%= L_APPMAP_TEXT %>";
  214. //document.userform.hdnAppUnload.value = "<%= L_UNLOAD_TEXT %>";
  215. document.userform.hdnIsApp.value = sTRUE;
  216. }
  217. else
  218. {
  219. top.connect.location.href = "iiaction.asp?a=RemoveApp";
  220. document.userform.hdnAppButton.value = "<%= L_CREATE_TEXT %>";
  221. document.userform.AppFriendlyName.value = "";
  222. document.userform.AppFriendlyName.Disabled;
  223. document.userform.hdnStartingPoint.value = "<%= L_NOAPP_TEXT %>";
  224. document.userform.hdnConfigButton.value = "<%= L_NA_TEXT %>";
  225. document.userform.hdnMapButton.value = "<%= L_NA_TEXT %>";
  226. //document.userform.hdnAppUnload.value = "<%= L_NA_TEXT %>";
  227. document.userform.hdnIsApp.value = sFALSE;
  228. }
  229. <% if Session("IsMac") then %>
  230. self.location.href = self.location.href;
  231. <% end if %>
  232. }
  233. function popConfig()
  234. {
  235. if (document.userform.hdnIsApp.value == sTRUE){
  236. popBox('AppConfig',<%= L_IIAPP_W %>,<%= L_IIAPP_H %>,'iiapp');
  237. }
  238. }
  239. function popAppMap()
  240. {
  241. if (document.userform.hdnIsApp.value == sTRUE){
  242. popBox('AppMap',<%= L_IIAMAP_W %>,<%= L_IIAMAP_H %>,'iiamap');
  243. }
  244. }
  245. function setAccessFlag()
  246. {
  247. ndx = document.userform.hdnAppAccess.selectedIndex;
  248. if(ndx > 0)
  249. {
  250. if (document.userform.chkAccessSource.checked)
  251. {
  252. if (!confirm("<%= L_SECHOLE_ERR %>"))
  253. {
  254. document.userform.hdnAppAccess.selectedIndex = 0;
  255. return;
  256. }
  257. }
  258. script = sTRUE
  259. }
  260. else
  261. {script = sFALSE}
  262. if(ndx > 1)
  263. {exe = sTRUE}
  264. else
  265. {exe = sFALSE}
  266. document.userform.AccessScript.value = script;
  267. document.userform.AccessExecute.value = exe;
  268. }
  269. //disable or enable, based on the value of the Author checkbox, the AccessPerms...
  270. function setAccessPerms(warnUser)
  271. {
  272. //shortcut uform
  273. var uform = document.userform;
  274. var Author = uform.chkAccessSource.checked;
  275. var canAuthor = (uform.chkAccessRead.checked ||uform.chkAccessWrite.checked );
  276. if (Author && uform.AccessScript.value == sTRUE && warnUser)
  277. {
  278. if (!confirm("<%= L_SECHOLE_ERR %>"))
  279. {
  280. uform.chkAccessSource.checked = false;
  281. return;
  282. }
  283. }
  284. uform.chkAccessSource.disabled = !canAuthor;
  285. }
  286. listFunc=new listFuncs();
  287. </SCRIPT>
  288. <% if Session("canBrowse") then %>
  289. <SCRIPT SRC="JSDirBrowser/JSBrowser.js">
  290. </SCRIPT>
  291. <SCRIPT LANGUAGE="JavaScript">
  292. JSBrowser = new BrowserObj(null,false,TDIR,<%= Session("FONTSIZE") %>);
  293. function setPath(cntrl){
  294. JSBrowser = new BrowserObj(cntrl,POP,TDIR,<%= Session("FONTSIZE") %>)
  295. }
  296. </SCRIPT>
  297. <% end if %>
  298. </HEAD>
  299. <BODY BGCOLOR="<%= Session("BGCOLOR") %>" TOPMARGIN=5 TEXT="#000000" LINK="#FFFFFF" >
  300. <%= sFont("","","",True) %>
  301. <FORM NAME="userform" onSubmit="return false">
  302. <TABLE BORDER=0 CELLPADDING=0>
  303. <TR>
  304. <TD>
  305. <%= sFont("","","",True) %>
  306. <% if Request("ptype") <> "UNC" then %>
  307. <%= L_LOCALPATH_TEXT %>&nbsp;
  308. <% else %>
  309. <%= L_NETPATH_TEXT %>&nbsp;
  310. <% end if %>
  311. </FONT>
  312. </TD>
  313. <TD>
  314. <%= sFont("","","",True) %>
  315. <% if Request("ptype") = "UNC" then %>
  316. <%
  317. if Left(currentobj.Path,2) <> "\\" then
  318. currentobj.Path = "\\"
  319. end if %>
  320. <%= text("Path",L_UNCWIDTH_NUM,"","","warnWrkingSite();",false,true) %>&nbsp;&nbsp;
  321. <% else %>
  322. <%= writeFSPath(L_LOCALPATH_NUM,"warnWrkingSite();chkPath(this);","","",false,true) %>
  323. <% end if %>
  324. <!--blank out redirect value...-->
  325. <INPUT TYPE="hidden" NAME="HttpRedirect" VALUE = "">
  326. </FONT>
  327. </TD>
  328. <TD WIDTH = 10>&nbsp;</TD>
  329. <TD VALIGN="bottom">
  330. <% if Request("ptype") <> "UNC" then %>
  331. <%= sFont("","","",True) %>&nbsp;&nbsp;
  332. <% if Session("canBrowse") then %>
  333. <% if Session("IsAdmin") then %>
  334. <% if Session("vtype") <> "dir" and Session("vtype") <> "svc" then %>
  335. <INPUT TYPE="button" NAME="hdnBrowser" VALUE="<%= L_BROWSE_TEXT %>" OnClick="warnWrkingSite();setPath(document.userform.Path);">
  336. <% end if %>
  337. <% end if %>
  338. <% end if %>
  339. </FONT>
  340. <% end if %>
  341. </TD>
  342. </TR>
  343. <% if Request("ptype") = "UNC" then %>
  344. <TR>
  345. <TD>
  346. <%= sFont("","","",True) %>
  347. <%= L_USERNAME_TEXT %>
  348. </FONT>
  349. </TD>
  350. <TD>
  351. <%= sFont("","","",True) %>
  352. <%= text("UNCUserName",L_UNCWIDTH_NUM,"","","",false,true) %>&nbsp;&nbsp;
  353. </FONT>
  354. </TD>
  355. </TR>
  356. <TR>
  357. <TD>
  358. <%= sFont("","","",True) %>
  359. <%= L_PASSWORD_TEXT %>
  360. </FONT>
  361. </TD>
  362. <TD>
  363. <%= sFont("","","",True) %>
  364. <%= pword("UNCPassword",L_UNCWIDTH_NUM,"","","",false,true) %>&nbsp;&nbsp;
  365. </FONT>
  366. </TD>
  367. </TR>
  368. <% end if %>
  369. <TR>
  370. <TD HEIGHT=4>
  371. </TD>
  372. </TD>
  373. </TR>
  374. <TR>
  375. <TD COLSPAN=4>
  376. <TABLE>
  377. <TR>
  378. <TD VALIGN="top">
  379. <%= sFont("","","",True) %>
  380. <%= checkbox("AccessRead","warnWrkingSite();setAccessPerms(!WARN);",false) %>&nbsp;<%= L_READ_TEXT %><BR>
  381. <%= checkbox("AccessWrite","setAccessPerms(!WARN);",false) %>&nbsp;<%= L_WRITE_TEXT %><BR>
  382. <%= checkbox("AccessSource","setAccessPerms(WARN);",false) %>&nbsp;<%= L_AUTHOR_TEXT %><BR>
  383. <P>
  384. </FONT>
  385. </TD>
  386. <TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  387. </TD>
  388. <TD VALIGN="top">
  389. <%= sFont("","","",True) %>
  390. <%= checkbox("EnableDirBrowsing","",false) %>&nbsp;<%= L_ENABLEBROWSING_TEXT %><BR>
  391. <% if currentobj.DontLog then %>
  392. <INPUT TYPE="checkbox" NAME="hdnDontLog" OnClick="top.title.Global.updated=true;setLog(this);">&nbsp;<%= L_LOGACCESS_TEXT %><BR>
  393. <INPUT TYPE="hidden" NAME="DontLog" VALUE="true">
  394. <% else %>
  395. <INPUT TYPE="checkbox" NAME="hdnDontLog" CHECKED OnClick="top.title.Global.updated=true;setLog(this);">&nbsp;<%= L_LOGACCESS_TEXT %><BR>
  396. <INPUT TYPE="hidden" NAME="DontLog" VALUE="false">
  397. <% end if %>
  398. <%= checkbox("ContentIndexed","",false) %>&nbsp;<%= L_INDEX_TEXT %><BR>
  399. </FONT>
  400. </TD>
  401. </TR>
  402. </TABLE>
  403. </TD>
  404. </TR>
  405. <TR>
  406. <TD COLSPAN = 4>
  407. <%= sFont("","","",True) %>
  408. <IMG SRC="images/hr.gif" WIDTH=5 HEIGHT=2 BORDER=0 ALIGN="middle">
  409. <%= L_APPLICATIONS_TEXT %>
  410. <IMG SRC="images/hr.gif" WIDTH=<%= L_APPLICATIONHR_NUM %> HEIGHT=2 BORDER=0 ALIGN="middle">
  411. </FONT>
  412. </TD>
  413. </TR>
  414. <TR>
  415. <TD COLSPAN = 2>
  416. <TABLE>
  417. <TR>
  418. <TD>
  419. <%= sFont("","","",True) %>
  420. <%= L_APPNAME_TEXT %>:
  421. </FONT>
  422. </TD>
  423. <TD>
  424. <%= sFont("","","",True) %>
  425. <%= text("AppFriendlyName",L_APPTEXTWIDTH_NUM,"" ,"","",true,false) %>
  426. </FONT>
  427. </TD>
  428. </TR>
  429. <TR>
  430. <TD>
  431. <%= sFont("","","",True) %>
  432. <%= L_STARTPOINT_TEXT %>:
  433. </FONT>
  434. </TD>
  435. <TD>
  436. <%= sFont("","","",True) %>
  437. <INPUT NAME="hdnStartingPoint" SIZE = <%= L_APPTEXTWIDTH_NUM %> VALUE="<%= displayapproot %>" READONLY <%= Session("DEFINPUTSTYLE") %>>
  438. </FONT>
  439. </TD>
  440. </TR>
  441. <TR>
  442. <TD>
  443. <%= sFont("","","",True) %>
  444. <%= L_APPFLAGS_TEXT %>:
  445. </FONT>
  446. </TD>
  447. <TD>
  448. <%= sFont("","","",True) %>
  449. <%= writeSelect("hdnAppAccess", "", "warnWrkingSite();setAccessFlag();", false) %>
  450. <%= printoption(((not currentObj.AccessScript) and (not currentobj.AccessExecute)), L_NONE_TEXT, false) %>
  451. <%= printoption(currentObj.AccessScript and (not currentobj.AccessExecute), L_SCRIPT_TEXT, false) %>
  452. <%= printoption(currentobj.AccessExecute, L_EXECUTE_TEXT, false) %>
  453. </SELECT>
  454. <INPUT TYPE="hidden" NAME="AccessScript" VALUE="<%= lCase(currentObj.AccessScript) %>">
  455. <INPUT TYPE="hidden" NAME="AccessExecute" VALUE="<%= lCase(currentObj.AccessExecute) %>">
  456. </FONT>
  457. </TD>
  458. </TR>
  459. <TR>
  460. <TD>
  461. <%= sFont("","","",True) %>
  462. <%= L_APPPROTECTION_TEXT %>:
  463. </FONT>
  464. </TD>
  465. <TD>
  466. <%= sFont("","","",True) %>
  467. <%= writeSelect("hdnAppProtection", "", "warnWrkingSite();setProtectFlag(this);", false) %>
  468. <%= printoption(currentObj.AppIsolated = IISAO_APPROT_INPROC, L_APPPROTECT_OPTION_INPROC_TEXT, false) %>
  469. <%= printoption(currentObj.AppIsolated = IISAO_APPROT_POOL, L_APPPROTECT_OPTION_POOL_TEXT, false) %>
  470. <%= printoption(currentObj.AppIsolated = IISAO_APPROT_ISOLATE, L_APPPROTECT_OPTION_OUTPROC_TEXT, false) %>
  471. </SELECT>
  472. <INPUT TYPE="hidden" NAME="AppIsolated" VALUE="<%= currentObj.AppIsolated %>">
  473. </FONT>
  474. </TD>
  475. </TR>
  476. </TABLE>
  477. </TD>
  478. <TD WIDTH = 10>&nbsp;</TD>
  479. <TD VALIGN="top"><%= sFont("","","",True) %>
  480. <% if not isApp then %>
  481. <% if Session("IsAdmin") then %>
  482. <INPUT TYPE="hidden" VALUE="false" NAME="hdnIsApp">
  483. <% if Session("vtype") <> "svc" then %>
  484. <INPUT TYPE="button" NAME="hdnAppButton" VALUE="<%= L_CREATE_TEXT %>" OnClick="setApp();"><P>
  485. <% end if %>
  486. <INPUT TYPE="button" NAME="hdnConfigButton" VALUE="<%= L_NA_TEXT %>" OnClick="popConfig();"><P>
  487. <INPUT TYPE="button" NAME="hdnMapButton" VALUE="<%= L_NA_TEXT %>" OnClick="popAppMap();"><P>
  488. <% end if %>
  489. <% else %>
  490. <INPUT TYPE="hidden" VALUE="true" NAME="hdnIsApp">
  491. <% if Session("IsAdmin") then %>
  492. <% if Session("vtype") <> "svc" then %>
  493. <INPUT TYPE="button" NAME="hdnAppButton" VALUE="<%= L_REMOVE_TEXT %>" OnClick="setApp();"><P>
  494. <% end if %>
  495. <% end if %>
  496. <INPUT TYPE="button" NAME="hdnConfigButton" VALUE="<%= L_CONFIGURE_TEXT %>" OnClick="popConfig();"><P>
  497. <INPUT TYPE="button" NAME="hdnMapButton" VALUE="<%= L_APPMAP_TEXT %>" OnClick="popAppMap();"><P>
  498. <% end if %>
  499. </FONT>
  500. </TD>
  501. </BLOCKQUOTE>
  502. </TD>
  503. </TR>
  504. </TABLE>
  505. <SCRIPT LANGUAGE="JavaScript">
  506. setAccessPerms(!WARN);
  507. </SCRIPT>
  508. </FORM>
  509. </BLOCKQUOTE>
  510. </FONT>
  511. </BODY>
  512. </HTML>
  513. <% end if %>