home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 9 / IOPROG_9.ISO / contrib / iis4 / iis4_03.cab / iifvs.asp < prev    next >
Encoding:
Text File  |  1997-09-08  |  10.0 KB  |  394 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <%Option Explicit %>
  3.  
  4. <% 
  5. '    strings for localization
  6. Const L_ACCESSDENIED_TEXT="Access Denied" 
  7. Const L_ENTERINT_ERRORMESSAGE="Please enter an integer."
  8. Const L_UNSAVEDCHANGES_ERRORMESSAGE="You have unsaved changes. Save now?"
  9. Const L_VIRTUALSERVERID_TEXT="FTP Site Identification"
  10. Const L_HOSTHEADER_TEXT="Host header name"
  11. Const L_DESCRIPTION_TEXT="Description:"
  12. Const L_IPADDRESS_TEXT="IP address:"
  13. Const L_TCPPORT_TEXT="TCP port:"
  14. Const L_SSLPORT_TEXT="SSL port:"
  15. Const L_UNLIMITED_TEXT="Unlimited"
  16. Const L_LIMITTO_TEXT="Limit to:"
  17. Const L_CONNPARAMS_TEXT="Connection"
  18. Const L_MAXCON_TEXT="Maximum connections:"
  19. Const L_CONNTIMEOUT_TEXT="Connection timeout:"
  20. Const L_SECONDS_TEXT="seconds"
  21. Const L_ADVANCED_TEXT="Advanced..."
  22. Const L_ALLUNASSIGNED_TEXT="All Unassigned"
  23. Const L_CONNECTIONS_TEXT="connections"
  24. Const L_NONE_TEXT="None"
  25. Const L_SAVING_TEXT="Saving..."
  26. Const DEFAULTPORT = 21
  27. Const L_LOGGING_TEXT="Enable Logging"
  28. Const L_LOGFORMAT_TEXT="Active log format:"
  29. Const L_NONEINSTALLED_TEXT = " [No logging modules are currently installed] "
  30. Const L_EDIT_TEXT = "Properties..."
  31.  
  32. On Error Resume Next  
  33.  
  34. Dim path, currentobj
  35.  
  36. path=Session("spath")
  37. Session("path")=path
  38. Session("SpecObj")=""
  39. Session("SpecProps")=""
  40. Set currentobj=GetObject(path)
  41.  
  42.  %>
  43.  
  44. <!--#include file="iiset.inc"-->
  45.  
  46. <!--#include file="iibind.inc"-->
  47.  
  48. <% 
  49.  
  50. function writeBinding(fieldname,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
  51.     On Error Resume Next 
  52.     
  53.     Dim aBinding, Binding,host, ipport, ipaddress
  54.     
  55.     aBinding=currentobj.ServerBindings
  56.  
  57.  
  58.     if IsArray(aBinding) then
  59.         if aBinding(0) = "" then
  60.             aBinding(0) = ":" & DEFAULTPORT & ":"
  61.         end if
  62.         Binding=getBinding(aBinding(0))
  63.     else
  64.         if aBinding = "" then
  65.             aBinding = ":" & DEFAULTPORT & ":"
  66.         end if
  67.         Binding=getBinding(aBinding)
  68.     end if
  69.  
  70.     Select Case fieldname
  71.     Case "Host"
  72.         host=Binding(2)
  73.         writeBinding=inputbox(err,"TEXT","hdnHost",host,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
  74.  
  75.     Case "IPPort" 
  76.         ipport=Binding(1)
  77.         writeBinding=inputbox(err,"TEXT","hdnPort",ipport,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
  78.  
  79.     Case "IPAddress" 
  80.         ipaddress=Binding(0)
  81.         writeBinding=inputbox(err,"TEXT","hdnIPA",ipaddress,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
  82.     End Select
  83.  
  84. end function
  85.  
  86. function writeLogTypes(fieldname,value, id, adminonly)
  87.     On Error Resume Next 
  88.  
  89.     if id = currentobj.LogPlugInClsid then
  90.         writeLogTypes="<OPTION SELECTED VALUE='" & id & "'>" & value
  91.     else
  92.         writeLogTypes="<OPTION VALUE='" & id & "'>" & value    
  93.     end if
  94. end function
  95.  %>
  96.  
  97.  
  98.  
  99. <html>
  100.  
  101. <head>
  102. <title></title>
  103. <script language="JavaScript">
  104.  
  105.     top.head.Global.helpFileName="iipz";
  106.  
  107.     function SetBinding(){
  108.         document.userform.ServerBindings.value=document.userform.hdnIPA.value + ":" + document.userform.hdnPort.value + ":"; 
  109.     }
  110.  
  111.     function isNum(txtcntrl,min,max) {
  112.         str=txtcntrl.value;
  113.         for (var i=0; i < str.length; i++) {
  114.               num = parseInt(str);
  115.             if (isNaN(num)){
  116.                    alert("Please enter an integer.");
  117.                 return false;
  118.               }
  119.             if (num < min) {
  120.                 alert("Please enter an integer greater than " + (min-1) + ".");
  121.                 return false;
  122.             }
  123.             if (num > max) {
  124.                 alert("Please enter an integer less than " + (max + 1) + ".");
  125.                 return false;
  126.             }            
  127.          }
  128.         return true;
  129.     }
  130.  
  131.     function SetMax(theIndex){
  132.         if (theIndex==1) {
  133.             if (document.userform.hdnhdnMaxConnections.value !=""){
  134.                 document.userform.hdnMaxConnections.value=document.userform.hdnhdnMaxConnections.value;
  135.             }
  136.         }
  137.         else {
  138.             if (document.userform.hdnMaxConnections.value !=""){
  139.                 document.userform.hdnhdnMaxConnections.value=document.userform.hdnMaxConnections.value;    
  140.             }
  141.             document.userform.hdnMaxConnections.value=2000000000;                    
  142.         }
  143.         SetMaxConn();
  144.  
  145.     }
  146.  
  147.     function SetrdoMax(){
  148.         document.userform.rdoMaxConnections[1].checked=true;
  149.         document.userform.hdnhdnMaxConnections.value=document.userform.hdnMaxConnections.value;        
  150.     }
  151.  
  152.     function SetMaxConn(){
  153.         curval=parseInt(document.userform.hdnMaxConnections.value);
  154.         if (curval >=2000000000){
  155.             document.userform.rdoMaxConnections[0].checked=true;
  156.             document.userform.MaxConnections.value=2000000000;
  157.             document.userform.hdnMaxConnections.value="";            
  158.         }
  159.         else{    
  160.             document.userform.MaxConnections.value=document.userform.hdnMaxConnections.value;
  161.         }
  162.  
  163.     }
  164.  
  165.     function setState(mState,mControl){
  166.         <% if Session("Browser") = "IE4" then %>
  167.             mControl.disabled = ! mState;
  168.         <% end if %>
  169.     }
  170.     
  171.     function setLogUIType(logCntrl){
  172.         
  173.         var logName = logCntrl.options[logCntrl.selectedIndex].text;
  174.  
  175.         var logType = "";
  176.         
  177.         if (logName.indexOf("Ext") > -1){
  178.             logType = "EXT";
  179.         }
  180.         if (logName.indexOf("ODBC") > -1) {
  181.             logType = "ODBC";
  182.         }
  183.         
  184.         top.connect.location.href = "iisess.asp?setLogUI=" + logType;        
  185.     }
  186.  
  187.     
  188.     function popBox(title, width, height, filename){
  189.         thefile=(filename + ".asp");
  190.         thefile="iipop.asp?pg="+thefile;
  191.         <% if Session("Browser") <> "IE3" then %>
  192.             width=width +25;
  193.             height=height + 50;                
  194.         <% end if %>
  195.  
  196.         popbox=window.open(thefile,title,"toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+width+",height="+height);
  197.         if(popbox !=null){
  198.             if (popbox.opener==null){
  199.                 popbox.opener=self;
  200.             }
  201.         }
  202.     }
  203.  
  204.     
  205.  
  206. </script>
  207. </head>
  208.  
  209. <body bgcolor="#CCCCCC" topmargin="5" text="#000000" style="font-face: Helv; font-size: 8pt;">
  210. <font size="1" face="Helv">
  211. <b><%= L_VIRTUALSERVERID_TEXT %></b>
  212. <form name="userform">
  213. <blockquote>
  214.  
  215. <table border="0" cellpadding="0">
  216.  
  217. <tr>
  218.     <td valign="bottom">
  219.         <font size="1" face="Helv">
  220.             <%= L_DESCRIPTION_TEXT %>
  221.         </font>
  222.     </td>
  223.     <td valign="bottom" colspan="2">
  224.         <font size="1" face="Helv">
  225.             <%= text("ServerComment",25,"","","",false,false) %>
  226.         </font>
  227.     </td>
  228. </tr>
  229.  
  230. <tr>
  231.     <td valign="bottom">
  232.         <font size="1" face="Helv">
  233.             <%= L_IPADDRESS_TEXT %>
  234.         </font>
  235.     </td>
  236.     <td valign="bottom" colspan="2">
  237.         <font size="1" face="Helv">
  238.             <%= writeBinding("IPAddress",15,"","","SetBinding();",false,true) %>
  239.             <input type="hidden" name="ServerBindings" value="<%= currentobj.ServerBindings(0)(0) %>">
  240.         </font>
  241.     </td>
  242. </tr>
  243.  
  244. <tr>
  245.     <td valign="bottom">
  246.         <font size="1" face="Helv">
  247.             <%= L_TCPPORT_TEXT %>
  248.         </font>
  249.     </td>
  250.     <td valign="bottom">        
  251.         <font size="1" face="Helv">
  252.             <%= writeBinding("IPPort",5,"","","isNum(this);SetBinding();",false,true) %>
  253.         </font>
  254.     </td>
  255. </tr>
  256.  
  257. </table>
  258.  
  259. </blockquote>
  260.  
  261. <hr>
  262.  
  263. <b><%= L_CONNPARAMS_TEXT %></b>
  264.  
  265. <blockquote>
  266.  
  267. <table border="0" cellpadding="0">
  268. <tr>
  269.     <td colspan="2">
  270.         <font size="1" face="Helv">
  271.             <%= printradio("MaxConnections", (currentobj.MaxConnections >=2000000000), "SetMax(0);",true) %>
  272.             <%= L_UNLIMITED_TEXT %>
  273.         </font>
  274.     </td>
  275. </tr>
  276.  
  277.  
  278. <tr>    
  279.     <td valign="bottom">
  280.         <font size="1" face="Helv">
  281.             <%= printradio("MaxConnections", (currentobj.MaxConnections < 2000000000), "SetMax(1);",true) %>
  282.             <%= L_LIMITTO_TEXT %><input type="hidden" name="MaxConnections" value="<%= currentobj.MaxConnections %>">
  283.         </font>
  284.     </td>
  285.     <td valign="bottom">
  286.         <font size="1" face="Helv">
  287.             <% if (currentobj.MaxConnections < 2000000000) then %>    
  288.                 <%= inputbox(0,"TEXT","hdnMaxConnections",currentobj.MaxConnections,10,"","", "isNum(this,1,2000000001);SetMaxConn();",True,True) %>
  289.             <% else %>
  290.                 <%= inputbox(0,"TEXT","hdnMaxConnections","",10,"","", "isNum(this,1,2000000001);SetMaxConn();",True,True) %>
  291.             <% end if %>    
  292.                         
  293.     
  294.     </td>
  295.     <td valign="bottom">
  296.         <font size="1" face="Helv">        
  297.                  <%= L_CONNECTIONS_TEXT %>
  298.         </font>    
  299.     </td>
  300. </tr>
  301. <tr>
  302.     <td>  </td>
  303. </tr>
  304.  
  305. <tr>
  306.     <td valign="bottom"><font size="1" face="Helv"><%= L_CONNTIMEOUT_TEXT %>  </font></td>
  307.     <td valign="bottom">
  308.             <%= text("ConnectionTimeout",10,"","", "isNum(this,1,2147483646);",True,True) %>
  309.     </td>
  310.     <td valign="bottom">
  311.         <font size="1" face="Helv">    
  312.          <%= L_SECONDS_TEXT %>
  313.         </font>
  314.     </td>
  315. </tr>
  316.  
  317. <tr>
  318.     <td colspan="2" height="4"></td>
  319. </tr>
  320.  
  321. </table>
  322.  
  323. </blockquote>
  324.  
  325. <hr>
  326. <font size="1" face="Helv">
  327.  
  328. <%
  329. On Error Resume Next
  330. Dim LoggingModules,noLogging, Module
  331.  
  332. Set LoggingModules = GetObject("IIS://localhost/logging")
  333. if err <> 0 then
  334.     noLogging = True
  335. end if
  336.                 
  337. %>
  338. <% if noLogging then %>
  339.     <img align="top" src="images/checkoff.gif" width="13" height="13">
  340. <% else %>
  341.     <% if currentobj.LogPluginClsid <> "" then %>
  342.         <input type="checkbox" name="hdnLogState" checked onclick="setState(this.checked,document.userform.hdnBtnLogProps);setState(this.checked,document.userform.LogPlugInClsid);top.head.Global.updated=true;">
  343.     <% else %>
  344.         <input type="checkbox" name="hdnLogState" onclick="setState(this.checked,document.userform.hdnBtnLogProps);setState(this.checked,document.userform.LogPlugInClsid);top.head.Global.updated=true;">
  345.     <% end if %>
  346.     <%= checkbox("hdnLogState",,false) %>
  347. <% end if %>
  348. <%= L_LOGGING_TEXT %>
  349.  
  350. <blockquote>
  351.  
  352. <table border="0" cellpadding="0">
  353. <tr>
  354.     <td colspan="1">
  355.         <font size="1" face="Helv">        
  356.             <%= L_LOGFORMAT_TEXT %>
  357.             <select size="1" name="LogPlugInClsid" onchange="setLogUIType(this);">            
  358.                 <%
  359.                 
  360.                     if noLogging then
  361.                         Response.write "<OPTION>" & L_NONEINSTALLED_TEXT & "</OPTION>"                            
  362.                     else
  363.                         For Each Module in LoggingModules
  364.                             Response.write writeLogTypes("LogPluginClsid", Module.Name, Module.LogModuleId,false)                         
  365.                         Next
  366.                     end if
  367.                 %>
  368.             </select>
  369.         </font>
  370.     </td>
  371.     <td>
  372.     <% if not noLogging then %>
  373.         <input type="button" name="hdnBtnLogProps" value="<%= L_EDIT_TEXT %>" onclick="popBox('LogDetail',400,400,'iilog');">
  374.     <% end if %>
  375.     </td>
  376. </tr>
  377.  
  378. </table>
  379.  
  380. </blockquote>
  381. </form>
  382. </font>
  383. <% if not noLogging then %>
  384. <script language="JavaScript">
  385.     setState(document.userform.hdnLogState.checked,document.userform.LogPlugInClsid);
  386.     setState(document.userform.hdnLogState.checked,document.userform.hdnBtnLogProps)
  387.     setLogUIType(document.userform.LogPlugInClsid)
  388. </script>
  389. <% end if %>
  390. </body>
  391. </html>
  392.  
  393.  
  394.