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

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5.  
  6. <% if Session("FONTSIZE") = "" then %>
  7.     <!--#include file="iito.inc"-->
  8. <% else %>
  9.  
  10. <% 
  11. '    strings for localization
  12. Const L_BROWSE_TEXT=" Browse... "
  13. Const L_ACCESSDENIED_TEXT="Access Denied" 
  14. Const L_PATH_TEXT="Local path:"
  15. Const L_ACCESSFLAGS_TEXT="Access 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"
  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="Front Page Web"
  25. Const L_DIRECTORYSTYLE_TEXT="Directory Listing Style"
  26. Const L_MSDOS_TEXT="MS-DOS"
  27. Const L_UNIX_TEXT="UNIX"
  28.  
  29. On Error Resume Next 
  30.  
  31. Dim path, currentobj, spath, instobj
  32.  
  33. path=UCase(Session("dpath"))
  34.  
  35. spath=UCase(Session("spath"))
  36.  
  37. if spath = "" then
  38.     spath = Mid(path,1,InStr(path,"/ROOT")-1)
  39.     Session("spath")=spath
  40. end if
  41.  
  42. Set currentobj=GetObject(path)
  43. Set instobj=GetObject(spath)
  44.  
  45. Session("SpecObj")=spath
  46. Session("SpecProps")="MSDosDirOutput"
  47.  
  48. function writeFSPath(fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
  49.     On Error Resume Next
  50.     Dim thispath, fspath, parenttype, parentobj
  51.     if Session("vtype") = "dir" then
  52.         thispath = Session("dpath")
  53.         fspath = ""
  54.         parenttype = ""
  55.         Do Until Instr(parenttype, "VirtualDir") <> 0
  56.             'we need clear our path not found error..
  57.             err = 0                        
  58.             'add our initial whack...
  59.             fspath = "/" + fspath
  60.             
  61.             'and cyle through the baseobj till we find the next whack,
  62.             'building up the path in new name as we go
  63.             Do Until Right(thispath,1) = "/"
  64.                 fspath = Right(thispath,1) & fspath
  65.                 thispath = Mid(thispath,1,Len(thispath)-1)
  66.             Loop
  67.             
  68.             'once we're out, we need to lop off the last whack...
  69.             thispath = Mid(thispath,1,Len(thispath)-1)
  70.             
  71.             'and try to set the object again...
  72.             Set parentobj=GetObject(thispath)
  73.             
  74.             if err <> 0 then            
  75.                 parenttype = ""
  76.             else
  77.                 parenttype=parentobj.KeyType
  78.             end if                             
  79.         Loop
  80.         fspath = parentobj.Path & "\" & Replace(fspath,"/","\")
  81.         writeFSPath = fspath    
  82.     else
  83.         writeFSPath = text("Path",fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
  84.     end if            
  85.  
  86. end function
  87.  
  88.  %>
  89.  
  90. <!--#include file="iiset.inc"-->
  91.  
  92. <HTML>
  93. <HEAD>
  94. <TITLE></TITLE>
  95. <SCRIPT LANGUAGE="JavaScript">
  96.     <% if UCase(Right(currentobj.ADsPath,4))="ROOT" then %> 
  97.         top.title.Global.helpFileName="iipz_5";    
  98.     <% else %>
  99.         top.title.Global.helpFileName="iipz_3";
  100.     <% end if %>
  101.     var Global=top.title.Global;
  102.  
  103.     function disableDefault(dir,fromCntrl, toCntrl){
  104.         if (!dir){
  105.             if (fromCntrl.value !=""){
  106.                 toCntrl.value=fromCntrl.value;
  107.                 fromCntrl.value="";
  108.             }
  109.         }
  110.         else{
  111.             if (toCntrl.value !=""){
  112.                 fromCntrl.value=toCntrl.value;
  113.                 toCntrl.value="";
  114.             }
  115.         }
  116.     }
  117.  
  118.     function enableDefault(chkCntrl){
  119.         chkCntrl.checked=true;
  120.     }
  121.     
  122.     function setLog(chkCntrl){
  123.         if (chkCntrl.checked){
  124.             document.userform.DontLog.value = "False";
  125.         }
  126.         else{
  127.             document.userform.DontLog.value = "True";                
  128.         }
  129.         
  130.     }    
  131.  
  132.     function SetBool(){
  133.         if (document.userform.rdohdnMSDOSDirOutput[0].checked){
  134.             document.userform.MSDOSDirOutput.value="False"
  135.         }
  136.         else{
  137.             document.userform.MSDOSDirOutput.value="True"
  138.         }
  139.     }
  140.  
  141.     function popBox(title, width, height, filename){
  142.         thefile=(filename + ".asp");
  143.         thefile="iipop.asp?pg="+thefile;
  144.         <% if Session("Browser") <> "IE3" then %>
  145.             width=width +25;
  146.             height=height + 50;                
  147.         <% end if %>
  148.  
  149.         popbox=window.open(thefile,title,"toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+width+",height="+height);
  150.         if(popbox !=null){
  151.             if (popbox.opener==null){
  152.                 popbox.opener=self;
  153.             }
  154.         }
  155.     }
  156.  
  157.     function listFuncs(){
  158.         this.writeList=buildListForm;
  159.     }
  160.  
  161.     function buildListForm(){
  162.         <% if Session("vtype") <> "dir" then %>
  163.         if (document.userform.Path.value !="<%= currentobj.path %>"){
  164.             //top.title.nodeList[0].deCache();
  165.         }
  166.         <% end if %>
  167.     }
  168.     
  169.     function chkPath(pathCntrl){
  170.         if (pathCntrl.value != ""){
  171.             top.connect.location.href = "iichkpath.asp?path=" + escape(pathCntrl.value);            
  172.         }
  173.     }    
  174.  
  175.  
  176.     listFunc=new listFuncs();
  177.  
  178.  
  179. </SCRIPT>
  180.  
  181. <% if Session("canBrowse") then %>
  182. <SCRIPT SRC="JSBrowser/JSBrowser.js">
  183. </SCRIPT>
  184.  
  185. <SCRIPT LANGUAGE="JavaScript">
  186.     function setPath(cntrl){
  187.         JSBrowser = new BrowserObj(cntrl,POP,TDIR,<%= Session("FONTSIZE") %>)
  188.     }
  189. </SCRIPT>
  190.  
  191. <% end if %>
  192. </HEAD>
  193.  
  194. <BODY BGCOLOR="#CCCCCC" TOPMARGIN=5 TEXT="#000000" LINK="#FFFFFF" STYLE="font-face: Helv,Arial; font-size:10pt;">
  195.  
  196. <FONT SIZE=1 FACE="Helv,ARIAL">
  197. <HR>
  198. <FORM NAME="userform" onSubmit="return false">
  199. <BLOCKQUOTE>
  200. <TABLE BORDER=0 CELLPADDING=0>
  201. <TR>
  202.     <TD VALIGN="bottom">
  203.         <FONT SIZE=1 FACE="Helv,ARIAL">
  204.             <%= L_PATH_TEXT %>
  205.         </FONT>
  206.     </TD>
  207.     <TD VALIGN="bottom">
  208.         <FONT SIZE=1 FACE="Helv,ARIAL">
  209.         <%= writeFSPath(45,"chkPath(this);","","",false,true) %>  
  210.         </FONT>
  211.     </TD>
  212.     <TD>
  213.         <FONT SIZE=1 FACE="HELV,ARIAL">  
  214.     <% if Session("canBrowse") then %>
  215.         <% if Session("IsAdmin") then %>
  216.             <% if Session("vtype") <> "dir" then %>
  217.                 <INPUT TYPE="button" NAME="hdnBrowser" VALUE="<%= L_BROWSE_TEXT %>" OnClick="setPath(document.userform.Path);">
  218.             <% end if %>
  219.         <% end if %>
  220.     <% end if %>
  221.     </FONT>
  222.     </TD>
  223. </TR>
  224.  
  225. <TR>
  226.     <TD VALIGN="top"> </TD>
  227.     <TD COLSPAN=2>
  228.         <TABLE>
  229.             <TR>
  230.                 <TD>
  231.                     <FONT SIZE=1 FACE="Helv,ARIAL">                    
  232.                         <%= checkbox("AccessRead","",false) %> <%= L_READ_TEXT %><BR>
  233.                         <%= checkbox("AccessWrite","",false) %> <%= L_WRITE_TEXT %><BR>
  234.                         
  235.                         <% if currentobj.DontLog then %>
  236.                             <INPUT TYPE="checkbox" NAME="hdnDontLog" OnClick="top.title.Global.updated=true;setLog(this);"> <%= L_LOGACCESS_TEXT %><BR>                            
  237.                             <INPUT TYPE="hidden" NAME="DontLog" VALUE="True">                            
  238.                         <% else %>
  239.                             <INPUT TYPE="checkbox" NAME="hdnDontLog" CHECKED  OnClick="top.title.Global.updated=true;setLog(this);"> <%= L_LOGACCESS_TEXT %><BR>
  240.                             <INPUT TYPE="hidden" NAME="DontLog" VALUE="False">                            
  241.                         <% end if %>
  242.                         
  243.                     </FONT>
  244.                 </TD>
  245.             </TR>
  246.         </TABLE>
  247.     </TD>
  248. </TR>
  249. </TABLE>
  250. </BLOCKQUOTE>
  251.  
  252. <% if Session("vtype") = "svc" or Session("vtype") = "server" then%>
  253.  
  254. <!-- set the current object = to the instance level object for MSDOSDirOutput -->
  255.  
  256. <HR>
  257. <B><%= L_DIRECTORYSTYLE_TEXT %></B>
  258. <BLOCKQUOTE>
  259. <TABLE BORDER=0 CELLPADDING=0 WIDTH = 200>
  260. <TR><TD> </TD>
  261.     <TD COLSPAN=2>
  262.         <FONT SIZE=1 FACE="Helv,ARIAL">
  263.             <%= printradio("hdnMSDOSDirOutput", not instobj.MSDOSDirOutput, "SetBool();",false) %>
  264.              
  265.             <%= L_UNIX_TEXT %>®
  266.         </FONT>
  267.     </TD>
  268. </TR>
  269. <TR><TD> </TD>
  270.     <TD COLSPAN=2>
  271.         <FONT SIZE=1 FACE="Helv,ARIAL">
  272.             <%= printradio("hdnMSDOSDirOutput", instobj.MSDOSDirOutput, "SetBool();",false) %>
  273.              
  274.             <%= L_MSDOS_TEXT %>®
  275.             <% if instobj.MSDOSDirOutput then %>
  276.                 <INPUT TYPE="hidden" NAME="MSDOSDirOutput" VALUE="True">
  277.             <% else %>
  278.                 <INPUT TYPE="hidden" NAME="MSDOSDirOutput" VALUE="False">
  279.             <% end if %>
  280.         </FONT>
  281.     </TD>
  282. </TR>
  283. </TABLE>
  284. <% end if %>
  285. </FORM>
  286. </BLOCKQUOTE>
  287. </FONT>
  288. </BODY>
  289.  
  290. </HTML>
  291.  
  292. <%end if %>
  293.  
  294.  
  295.