home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_03.cab / iivddir.asp < prev    next >
Text File  |  1997-11-12  |  15KB  |  523 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <% if Session("FONTSIZE") = "" then %>
  6.     <!--#include file="iito.inc"-->
  7. <% else %>
  8.  
  9. <% 
  10. '    strings for localization
  11. Const L_BROWSE_TEXT=" Browse... "
  12. Const L_ACCESSDENIED_TEXT="Access Denied" 
  13. Const L_PATH_TEXT="Local path:"
  14. Const L_ACCESSFLAGS_TEXT="Access Permissions"
  15. Const L_APPFLAGS_TEXT="Permissions"
  16. Const L_READ_TEXT="Read"
  17. Const L_WRITE_TEXT="Write"
  18. Const L_SCRIPT_TEXT="Script"
  19. Const L_EXECUTE_TEXT="Execute (including Script)"
  20. Const L_CONTENTCONTROL_TEXT="Content Control"
  21. Const L_LOGACCESS_TEXT="Log access"
  22. Const L_ENABLEBROWSING_TEXT="Directory browsing allowed"
  23. Const L_INDEX_TEXT="Index this directory"
  24. Const L_FRONTPAGE_TEXT="FrontPage Web"
  25. Const L_APPLICATIONS_TEXT="Application Settings"
  26. Const L_ISAPPROOT_TEXT="This is an application starting point"
  27. Const L_STARTPOINT_TEXT="Starting Point"
  28. Const L_APPNAME_TEXT="Name"
  29. Const L_ISOLATEAPP_TEXT="Run in separate memory space (isolated process)"
  30. Const L_NONE_TEXT = "None"
  31. Const L_CREATE_TEXT = "     Create     "
  32. Const L_REMOVE_TEXT = "   Remove   "
  33. Const L_UNLOAD_TEXT = "    Unload     "
  34. Const L_DISABLE_TEXT = "   Disable  "
  35. Const L_ENABLE_TEXT = "   Enable   "
  36. Const L_CONFIGURE_TEXT = " Configure... "
  37. Const L_NA_TEXT =        "                        "
  38. Const L_APPMAP_TEXT = "Mappings... "
  39.  
  40.  
  41. On Error Resume Next 
  42.  
  43. Dim path, currentobj, spath, approot, thisroot, isApp, instobj, displayapproot, displaythisroot
  44.  
  45. path=UCase(Session("dpath"))
  46.  
  47. spath=UCase(Session("spath"))
  48.  
  49. if spath = "" then
  50.     spath = Mid(path,1,InStr(path,"/ROOT")-1)
  51.     Session("spath")=spath
  52. end if
  53.  
  54. Set currentobj=GetObject(path)
  55. Set instobj=GetObject(spath)
  56.  
  57.  
  58. Session("SpecObj")=spath
  59. Session("SpecProps")="FrontPageWeb"
  60.  
  61. approot = UCase(currentobj.AppRoot)
  62.  
  63. if Session("vtype") = "svc" then
  64.     Session("setProcOpts") = True
  65. else
  66.     Session("setProcOpts") = currentobj.AppIsolated
  67. end if 
  68.  
  69. isApp = False
  70.  
  71. if len(approot) <> 0 then
  72.     thisroot = UCase(currentobj.ADsPath)
  73.  
  74.     approot = Mid(approot,Instr(approot,"W3SVC")+5) 
  75.     thisroot = Mid(thisroot,Instr(thisroot,"W3SVC")+5)
  76.     
  77.     if Right(approot,1) = "/" then
  78.         thisroot = thisroot & "/"
  79.     end if            
  80.         
  81.     if thisroot=approot then
  82.         isApp = True
  83.     end if
  84.     
  85.     Session("approot") = "IIS://LOCALHOST/W3SVC" & Mid(approot,1,len(approot))
  86.     
  87. end if
  88.  
  89.                             
  90. approot = Mid(approot,Instr(approot,"ROOT")+4)
  91. if Left(approot,1) = "/" then
  92.     approot = Mid(approot,2)
  93. end if                    
  94. displayapproot = "[" & instobj.ServerComment & "]" & "/" & approot
  95. if Right(displayapproot,1) = "/" then
  96.     displayapproot = Mid(displayapproot, 1, len(displayapproot)-1)
  97. end if
  98.  
  99. thisroot = Mid(thisroot,Instr(thisroot,"ROOT")+4)
  100. if Left(thisroot,1) = "/" then
  101.     thisroot = Mid(thisroot,2)
  102. end if                    
  103. displaythisroot = "[" & instobj.ServerComment & "]" & "/" & thisroot
  104. if Right(displaythisroot,1) = "/" then
  105.     displaythisroot = Mid(displaythisroot, 1, len(displaythisroot)-1)
  106. end if                             
  107.                         
  108.  
  109. dirkeyType = "IIsWebDirectory"
  110. %>
  111.  
  112. <!--#include file="iiset.inc"-->
  113.  
  114. <%
  115.  
  116. function writeFSPath(fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
  117.     On Error Resume Next
  118.     
  119.     Dim thispath, fspath, parenttype, parentobj
  120.     
  121.     if Session("vtype") = "dir" then
  122.         thispath = Session("dpath")
  123.         fspath = ""
  124.         parenttype = ""
  125.         Do Until Instr(parenttype, "VirtualDir") <> 0
  126.             'we need clear our path not found error..
  127.             err = 0                        
  128.             fspath = "/" + fspath
  129.             'and cyle through the baseobj till we find the next whack,
  130.             'building up the path in new name as we go
  131.             Do Until Right(thispath,1) = "/"
  132.                 fspath = Right(thispath,1) & fspath
  133.                 thispath = Mid(thispath,1,Len(thispath)-1)
  134.             Loop
  135.             
  136.             'add the whack to the beginning of the path...            
  137.             
  138.             'once we're out, we need to lop off the last whack...
  139.             thispath = Mid(thispath,1,Len(thispath)-1)
  140.  
  141.             'and try to set the object again...
  142.             Set parentobj=GetObject(thispath)
  143.             if err <> 0 then            
  144.                 parenttype = ""
  145.             else
  146.                 parenttype=parentobj.KeyType
  147.             end if            
  148.         Loop
  149.  
  150.         fspath = parentobj.Path & "\" & Replace(fspath,"/","\")
  151.         if len(fspath) > 50 then
  152.             fspath = Left(fspath, 50) & "..."
  153.         end if
  154.         writeFSPath = disabletextstart & "<FONT FACE=HELV,ARIAL SIZE=1>" & fspath & "</FONT>" & disabletextend
  155.     else
  156.         if Instr(currentobj.Path,"\\") > 0 then
  157.             currentobj.Path = ""
  158.         end if
  159.         writeFSPath = text("Path",fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
  160.     end if            
  161.  
  162. end function
  163.  
  164.  %>
  165.  
  166.  
  167.  
  168. <HTML>
  169. <HEAD>
  170. <TITLE></TITLE>
  171.  
  172. <SCRIPT LANGUAGE="JavaScript">
  173.  
  174.     <% if UCase(Right(currentobj.ADsPath,4))="ROOT" then %> 
  175.         top.title.Global.helpFileName="iipy_3";    
  176.     <% else %>
  177.         <% if Session("vtype") <> "dir" then %>
  178.             top.title.Global.helpFileName="iipy_5";        
  179.         <% else %>
  180.             top.title.Global.helpFileName="iipy_15";
  181.         <% end if %>
  182.     <% end if %>
  183.     
  184.     var Global=top.title.Global;
  185.     
  186.  
  187.     function disableDefault(dir,fromCntrl, toCntrl){
  188.         if (!dir){
  189.             if (fromCntrl.value !=""){
  190.                 toCntrl.value=fromCntrl.value;
  191.                 fromCntrl.value="";
  192.             }
  193.         }
  194.         else{
  195.             if (toCntrl.value !=""){
  196.                 fromCntrl.value=toCntrl.value;
  197.                 toCntrl.value="";
  198.             }
  199.         }
  200.     }
  201.  
  202.     function enableDefault(chkCntrl){
  203.         chkCntrl.checked=true;
  204.     }
  205.     
  206.     function setLog(chkCntrl){
  207.         if (chkCntrl.checked){
  208.             document.userform.DontLog.value = "False";
  209.         }
  210.         else{
  211.             document.userform.DontLog.value = "True";                
  212.         }        
  213.     }
  214.  
  215.     function listFuncs(){
  216.         this.writeList=buildListForm;
  217.     }
  218.  
  219.     function buildListForm(){
  220.         <% if Session("isAdmin") then %>
  221.             <% if Session("vtype") <> "dir" then %>
  222.             if (document.userform.Path.value !="<%= Replace(currentobj.path,"\","\\") %>"){
  223.                 top.title.nodeList[top.title.Global.selId].deCache();
  224.             }
  225.             <% end if %>
  226.         <% end if %>
  227.     }
  228.     
  229.     
  230.     function popBox(title, width, height, filename){
  231.         thefile=(filename + ".asp");
  232.         thefile="iipop.asp?pg="+thefile;
  233.         <% if Session("Browser") <> "IE3" then %>
  234.             width=width +25;
  235.             height=height + 50;                
  236.         <% end if %>
  237.  
  238.         popbox=window.open(thefile,title,"toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+width+",height="+height);
  239.         if(popbox !=null){
  240.             if (popbox.opener==null){
  241.                 popbox.opener=self;
  242.             }
  243.         }
  244.     }
  245.     
  246.     function chkPath(pathCntrl){
  247.         if (pathCntrl.value != ""){
  248.             top.connect.location.href = "iichkpath.asp?path=" + escape(pathCntrl.value);            
  249.         }
  250.     }    
  251.     
  252.     function setIsolated(isIsolated){
  253.  
  254.         <% if Session("vtype") <> "svc" then %>
  255.             top.connect.location.href = "iisess.asp?setProcOpts=" + isIsolated;        
  256.         <% end if %>
  257.  
  258.     }
  259.     
  260.     function setApp(isIsolated){
  261.  
  262.         if (document.userform.hdnIsApp.value == "False"){
  263.             top.connect.location.href = "iiaction.asp?a=CreateApp&isIsolated=" + isIsolated;
  264.             document.userform.hdnStartingPoint.value = "<%= displaythisroot %>";            
  265.             document.userform.hdnAppButton.value = "<%= L_REMOVE_TEXT %>";
  266.             document.userform.hdnConfigButton.value = "<%= L_CONFIGURE_TEXT %>";
  267.             document.userform.hdnMapButton.value = "<%= L_APPMAP_TEXT %>";
  268.             //document.userform.hdnAppUnload.value = "<%= L_UNLOAD_TEXT %>";                                            
  269.             document.userform.hdnIsApp.value = "True";
  270.         }
  271.         else{
  272.             top.connect.location.href = "iiaction.asp?a=RemoveApp";
  273.             document.userform.hdnAppButton.value = "<%= L_CREATE_TEXT %>";
  274.             document.userform.hdnStartingPoint.value = "";            
  275.             document.userform.hdnConfigButton.value = "<%= L_NA_TEXT %>";
  276.             document.userform.hdnMapButton.value = "<%= L_NA_TEXT %>";
  277.             //document.userform.hdnAppUnload.value = "<%= L_NA_TEXT %>";                            
  278.             document.userform.hdnIsApp.value = "False";
  279.         }
  280.         
  281.         <% if Session("IsMac") then %>
  282.             self.location.href = self.location.href;
  283.         <% end if %>
  284.     }    
  285.     
  286.     function unloadApp(){
  287.         if (document.userform.hdnIsApp.value == "True"){
  288.             top.connect.location.href = "iiaction.asp?a=UnloadApp";
  289.         }
  290.     }        
  291.     
  292.     function popConfig(){
  293.         if (document.userform.hdnIsApp.value == "True"){
  294.             popBox('AppProp',400,400,'iiapp');
  295.         }
  296.     }
  297.     
  298.     function popAppMap(){
  299.         if (document.userform.hdnIsApp.value == "True"){
  300.             popBox('AppProp',560,400,'iiamap');
  301.         }
  302.     }    
  303.  
  304.     function setAccessFlag(){    
  305.         ndx = document.userform.hdnAppAccess.selectedIndex;
  306.         if(ndx > 0)
  307.             {script = "TRUE"}
  308.         else
  309.             {script = "FALSE"}
  310.             
  311.         if(ndx > 1)
  312.             {exe = "TRUE"}
  313.         else
  314.             {exe = "FALSE"}            
  315.             
  316.         document.userform.AccessScript.value = script;
  317.         document.userform.AccessExecute.value = exe;        
  318.     }
  319.  
  320.     listFunc=new listFuncs();
  321.  
  322. </SCRIPT>
  323.  
  324. <% if Session("canBrowse") then %>
  325. <SCRIPT SRC="JSBrowser/JSBrowser.js">
  326. </SCRIPT>
  327.  
  328. <SCRIPT LANGUAGE="JavaScript">
  329.     function setPath(cntrl){
  330.         JSBrowser = new BrowserObj(cntrl,POP,TDIR,<%= Session("FONTSIZE") %>)
  331.     }
  332. </SCRIPT>
  333.  
  334. <% end if %>
  335. </HEAD>
  336.  
  337. <BODY BGCOLOR="#CCCCCC" TOPMARGIN=5 TEXT="#000000" LINK="#FFFFFF" STYLE="font-face: Helv,Arial; font-size:10pt;">
  338.  
  339. <FONT SIZE=1 FACE="HELV,ARIAL">
  340.  
  341. <BLOCKQUOTE>
  342. <FORM NAME="userform" onSubmit="return false">
  343. <TABLE BORDER=0 CELLPADDING=0>
  344. <TR>
  345.     <TD COLSPAN = 2>    
  346.         <FONT SIZE=1 FACE="HELV,ARIAL">
  347.             <%= L_PATH_TEXT %> <%= writeFSPath(40,"chkPath(this);","","",false,true) %>
  348.         <!--blank out redirect value...-->
  349.         <INPUT TYPE="hidden" NAME="HttpRedirect" VALUE = "">
  350.         </FONT>
  351.     </TD>
  352.     <TD WIDTH = 10> </TD>
  353.     <TD VALIGN="bottom">
  354.     <FONT SIZE=1 FACE="HELV,ARIAL">  
  355.     <% if Session("canBrowse") then %>
  356.         <% if Session("IsAdmin") then %>
  357.             <% if Session("vtype") <> "dir" then %>
  358.                 <INPUT TYPE="button" NAME="hdnBrowser" VALUE="<%= L_BROWSE_TEXT %>" OnClick="setPath(document.userform.Path);">
  359.             <% end if %>
  360.         <% end if %>
  361.     <% end if %>
  362.     </FONT>
  363.     </TD>
  364. </TR>
  365.  
  366. <TR>
  367.     <TD WIDTH = 50> </TD>
  368.     <TD COLSPAN=3>
  369.         <TABLE>
  370.             <TR>
  371.                 <TD VALIGN="top">
  372.                     <FONT SIZE=1 FACE="HELV,ARIAL">
  373.                         <%= L_ACCESSFLAGS_TEXT %><BR>
  374.                         <%= checkbox("AccessRead","",false) %> <%= L_READ_TEXT %><BR>
  375.                         <%= checkbox("AccessWrite","",false) %> <%= L_WRITE_TEXT %><P>
  376.  
  377.                     </FONT>
  378.                 </TD>
  379.  
  380.                 <TD>     
  381.                 </TD>
  382.  
  383.                 <TD VALIGN="top">
  384.                     <FONT SIZE=1 FACE="HELV,ARIAL">
  385.                         <%= L_CONTENTCONTROL_TEXT %><BR>
  386.                         <% if currentobj.DontLog then %>
  387.                             <INPUT TYPE="checkbox" NAME="hdnDontLog" OnClick="top.title.Global.updated=true;setLog(this);"> <%= L_LOGACCESS_TEXT %><BR>                            
  388.                             <INPUT TYPE="hidden" NAME="DontLog" VALUE="True">                            
  389.                         <% else %>
  390.                             <INPUT TYPE="checkbox" NAME="hdnDontLog" CHECKED  OnClick="top.title.Global.updated=true;setLog(this);"> <%= L_LOGACCESS_TEXT %><BR>
  391.                             <INPUT TYPE="hidden" NAME="DontLog" VALUE="False">                            
  392.                         <% end if %>
  393.  
  394.                         
  395.                         <%= checkbox("EnableDirBrowsing","",false) %> <%= L_ENABLEBROWSING_TEXT %><BR>
  396.                         <%= checkbox("ContentIndexed","",false) %> <%= L_INDEX_TEXT %><BR>
  397.                         <% if Session("vtype") = "server" then %>
  398.                                 <% if instobj.FrontPageWeb=True then %>
  399.                                     <INPUT type="checkbox" NAME="chkFrontPageWeb" CHECKED> <%= L_FRONTPAGE_TEXT %>
  400.                                 <% else %>
  401.                                     <INPUT type="checkbox" NAME="chkFrontPageWeb"> <%= L_FRONTPAGE_TEXT %>
  402.                                 <% end if %>
  403.                         <% end if %>                        
  404.                     </FONT>
  405.                 </TD>
  406.             </TR>
  407.         </TABLE>
  408.     </TD>
  409. </TR>
  410.  
  411. <TR>
  412.     <TD COLSPAN = 4> <HR><P>
  413.     <FONT SIZE=1 FACE="HELV,ARIAL">
  414.         <%= L_APPLICATIONS_TEXT %>                
  415.     </FONT>
  416.     </TD>
  417. </TR>
  418.  
  419. <TR> 
  420.     <TD> </TD>
  421.     <TD>
  422.  
  423.             <TABLE>
  424.                 <TR>
  425.                     <TD>        
  426.                         <FONT SIZE=1 FACE="HELV,ARIAL">
  427.                             <%= L_APPNAME_TEXT %>:
  428.                         </FONT>    
  429.                     </TD>
  430.                     <TD>
  431.                         <FONT SIZE=1 FACE="HELV,ARIAL">                        
  432.                             <%= text("AppFriendlyName",35,"" ,"","",true,false) %>
  433.                         </FONT>
  434.                     </TD>
  435.                 </TR>
  436.                 <TR>
  437.                     <TD WIDTH =75 >        
  438.                         <FONT SIZE=1 FACE="HELV,ARIAL">
  439.                             <%= L_STARTPOINT_TEXT %>:
  440.                         </FONT>
  441.                     </TD>
  442.                     <TD>
  443.                         <FONT SIZE=1 FACE="HELV,ARIAL">
  444.  
  445.                             <INPUT NAME="hdnStartingPoint" SIZE = 35 VALUE="<%= displayapproot %>" READONLY >
  446.                         </FONT>
  447.                     </TD>
  448.                 </TR>
  449.                 
  450.                 <TR>
  451.                     <TD> </TD>
  452.                     <TD VALIGN="bottom">        
  453.                         <FONT SIZE=1 FACE="HELV,ARIAL">
  454.                             <%= checkbox("AppIsolated","setIsolated(this.checked);",true) %> <%= L_ISOLATEAPP_TEXT %><BR>
  455.                         </FONT>    
  456.                     </TD>
  457.                 </TR>
  458.  
  459.                 <TR>
  460.                     <TD>
  461.                         <FONT SIZE=1 FACE="HELV,ARIAL">
  462.                             <%= L_APPFLAGS_TEXT %>:
  463.                         </FONT>
  464.                     </TD>
  465.                     <TD>
  466.                         <FONT SIZE=1 FACE="HELV,ARIAL">                    
  467.                         <SELECT NAME="hdnAppAccess" onChange="setAccessFlag();">
  468.                             <%= printoption(((not currentObj.AccessScript) and (not currentobj.AccessExecute)), L_NONE_TEXT, false) %>
  469.                             <%= printoption(currentObj.AccessScript, L_SCRIPT_TEXT, false) %>
  470.                             <%= printoption(currentobj.AccessExecute, L_EXECUTE_TEXT, false) %>                            
  471.                         </SELECT>
  472.                         <INPUT TYPE="hidden" NAME="AccessScript" VALUE="<%= currentObj.AccessScript %>">
  473.                         <INPUT TYPE="hidden" NAME="AccessExecute" VALUE="<%= currentObj.AccessExecute %>">
  474.                         </FONT>
  475.                     </TD>
  476.                 </TR>
  477.             </TABLE>
  478.         </TD>
  479.     <TD WIDTH = 10> </TD>
  480.         <TD VALIGN="top"><FONT SIZE=1 FACE="HELV,ARIAL">
  481.         
  482.  
  483.             <% if not isApp then %>
  484.                 <% if Session("IsAdmin") then %>
  485.                 <INPUT TYPE="hidden" VALUE="False" NAME="hdnIsApp">
  486.                 <INPUT TYPE="button" NAME="hdnAppButton" VALUE="<%= L_CREATE_TEXT %>" OnClick="setApp(document.userform.chkAppIsolated.checked);"><P>
  487.                 <INPUT TYPE="button" NAME="hdnConfigButton" VALUE="<%= L_NA_TEXT %>" OnClick="popConfig();"><P>
  488.                 <INPUT TYPE="button" NAME="hdnMapButton" VALUE="<%= L_NA_TEXT %>" OnClick="popAppMap();"><P>                    
  489.                 <!--<INPUT TYPE="button" NAME="hdnAppUnload" VALUE="<%= L_NA_TEXT %>" OnClick="unloadApp();"><P>-->
  490.                 <% end if %>                
  491.             <% else %>
  492.                 <INPUT TYPE="hidden" VALUE="True" NAME="hdnIsApp">
  493.                 <% if Session("IsAdmin") then %>                        
  494.                 <INPUT TYPE="button"  NAME="hdnAppButton" VALUE="<%= L_REMOVE_TEXT %>" OnClick="setApp(document.userform.chkAppIsolated.checked);"><P>            
  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.                 <!--<INPUT TYPE="button" NAME="hdnAppUnload" VALUE="<%= L_UNLOAD_TEXT %>" OnClick="unloadApp();"><P>-->
  499.             <% end if %>            
  500.             
  501.             
  502.             </FONT>
  503.         </TD>
  504.         </BLOCKQUOTE>
  505.         </TD>
  506.     </TR>
  507.  
  508. </TABLE>
  509.  
  510. </FORM>
  511. </BLOCKQUOTE>
  512.  
  513. </FONT>
  514.  
  515.  
  516. </BODY>
  517.  
  518. </HTML>
  519.  
  520. <% end if %>
  521.  
  522.  
  523.