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