home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_03.cab / iivs.asp < prev    next >
Text File  |  1997-11-12  |  14KB  |  512 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. <% 
  11. '    strings for localization
  12. Const L_ACCESSDENIED_TEXT="Access Denied" 
  13. Const L_ENTERINT_ERRORMESSAGE="Please enter an integer."
  14. Const L_UNSAVEDCHANGES_ERRORMESSAGE="You have unsaved changes. Save now?"
  15. Const L_VIRTUALSERVERID_TEXT="Web Site Identification"
  16. Const L_MULTIBINDING_TEXT="This resource has multiple bindings"
  17. Const L_HOSTHEADER_TEXT="Host header name:"
  18. Const L_DESCRIPTION_TEXT="Description:"
  19. Const L_IPADDRESS_TEXT="IP address:"
  20. Const L_TCPPORT_TEXT="TCP port:"
  21. Const L_SSLPORT_TEXT="SSL port:"
  22. Const L_UNLIMITED_TEXT="Unlimited"
  23. Const L_LIMITTO_TEXT="Limit to:"
  24. Const L_CONNPARAMS_TEXT="Connection"
  25. Const L_MAXCON_TEXT="Maximum connections:"
  26. Const L_CONNTIMEOUT_TEXT="Connection timeout:"
  27. Const L_SECONDS_TEXT="seconds"
  28. Const L_ADVANCED_TEXT="Advanced..."
  29. Const L_ALLUNASSIGNED_TEXT="(All Unassigned)"
  30. Const L_CONNECTIONS_TEXT="connections"
  31. Const L_LOGGING_TEXT="Enable Logging"
  32. Const L_LOGFORMAT_TEXT="Active log format:"
  33. Const L_NONEINSTALLED_TEXT = " [No logging modules are currently installed] "
  34. Const L_EDIT_TEXT = "Properties..."
  35.  
  36. Const DEFAULTPORT = 80
  37.  
  38.  
  39. Const L_CHGBINDING_TEXT="WARNING!\r\rYou are modifying the bindings of the server you are currently connected to. Changing these bindings will result In you loosing connection to this site.\r\rAre you sure you want to continue?"
  40. Const L_SAVING_TEXT="Saving..."
  41.  
  42. On Error Resume Next 
  43.  
  44. Dim blanks,path,currentobj, ipport, ipaddress, readonly,i, multibind
  45.  
  46. path=Session("spath")
  47. Session("path")=path
  48. Session("SpecObj")=""
  49. Session("SpecProps")=""
  50.  
  51. Set currentobj=GetObject(path)
  52.  
  53. blanks="" 
  54. for i=0 to 23
  55.     blanks=blanks & " "
  56. Next
  57.  
  58.  
  59. %>
  60.  
  61. <!--#include file="iiset.inc"-->
  62.  
  63. <!--#include file="iibind.inc"-->
  64.  
  65. <% 
  66.  
  67.  
  68. function writeBinding(fieldname,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
  69.  
  70.     On Error Resume Next 
  71.     
  72.     Dim aBinding, aSecBinding
  73.     Dim Binding
  74.     Dim SecBinding
  75.     
  76.     Dim host,ipport, ipaddress, secport, j
  77.  
  78.     aBinding=currentobj.ServerBindings
  79.  
  80.     if Session("vtype") = "svc" then
  81.         multibind = false
  82.         readonly = true
  83.         Binding=getBinding(aBinding(0))        
  84.     else
  85.     
  86.         if aBinding(0) <> "" then
  87.             'global readonly variable...
  88.             multibind=(UBound(aBinding)>0)
  89.             readonly = multibind
  90.             Binding=getBinding(aBinding(0))
  91.         else
  92.             readonly=false
  93.             aBinding(0)=":" & DEFAULTPORT & ":"
  94.             Binding=getBinding(aBinding(0))
  95.         end if
  96.     end if
  97.     
  98.         if fieldname="Host" then
  99.             host=Binding(2)
  100.             if readonly then
  101.                 if host="" then
  102.                     host="(none)"
  103.                 end if
  104.                 writeBinding=host 
  105.             else
  106.  
  107.                 writeBinding=inputbox(err,"TEXT","hdnHost",host,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  108.             end if
  109.     
  110.         elseif fieldname="IPPort" then
  111.             ipport=Binding(1)
  112.             if readonly then
  113.                 if ipport="" then
  114.                     ipport=DEFAULTPORT
  115.                 end if            
  116.                 
  117.                 writeBinding=ipport
  118.             else            
  119.                 writeBinding=inputbox(err,"TEXT","hdnPort",ipport,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  120.             end if
  121.     
  122.         elseif fieldname="IPAddress" then
  123.             ipaddress=Binding(0)
  124.             if readonly then
  125.                 if ipaddress="" then
  126.                     ipaddress=L_ALLUNASSIGNED_TEXT
  127.                 end if    
  128.                 writeBinding=ipaddress
  129.             else
  130.                 writeBinding=inputbox(err,"TEXT","hdnIPA",ipaddress,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  131.             end if
  132.     
  133.         elseif fieldname="SecureBinding" then
  134.             secPort=""
  135.             aSecBinding=currentobj.SecureBindings
  136.             if aSecBinding(0) <> "" then 
  137.             arraybound=UBound(aSecBinding)            
  138.             for j=0 to arraybound
  139.                 SecBinding=getBinding(aSecBinding(0))
  140.                 if SecBinding(0)=Binding(0) then
  141.                     secPort=SecBinding(1)
  142.                     exit for
  143.                 end if
  144.             Next
  145.             end if 
  146.  
  147.             if readonly then
  148.                 writeBinding=secPort 
  149.  
  150.             else
  151.                 writeBinding=inputbox(err,"TEXT","hdnSecBinding",secPort,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  152.             end if 
  153.     
  154.         end if
  155.  
  156.  
  157. end function
  158.  
  159. function writeLogTypes(fieldname,value, id, adminonly)
  160.     On Error Resume Next 
  161.  
  162.     if id = currentobj.Get("LogPluginClsid") then
  163.         writeLogTypes="<OPTION SELECTED VALUE='" & id & "'>" & value
  164.     else
  165.         writeLogTypes="<OPTION VALUE='" & id & "'>" & value    
  166.     end if
  167. end function
  168.  
  169.  
  170.  %>
  171.  
  172.  
  173.  
  174. <html>
  175.  
  176. <head>
  177. <title></title>
  178. <script language="JavaScript">
  179.  
  180.     top.title.Global.helpFileName="iipy";
  181.     top.title.Global.siteProperties = true;
  182.  
  183.     function SetBinding(){
  184.         if (top.title.nodeList[top.title.Global.selId].isWorkingServer){
  185.             if (!confirm("<%= L_CHGBINDING_TEXT %>")){
  186.                 document.userform.hdnIPA.value=document.userform.hdnhdnIPA.value
  187.                 document.userform.hdnPort.value=document.userform.hdnhdnPort.value
  188.                 return;
  189.             }
  190.         }
  191.         document.userform.ServerBindings.value=document.userform.hdnIPA.value + ":" + document.userform.hdnPort.value + ":"; 
  192.         document.userform.hdnhdnIPA.value=document.userform.hdnIPA.value;
  193.         document.userform.hdnhdnPort.value=document.userform.hdnPort.value;            
  194.     }
  195.  
  196.     function isNum(txtcntrl,min,max) {
  197.         str=txtcntrl.value;
  198.         for (var i=0; i < str.length; i++) {
  199.               num = parseInt(str);
  200.             if (isNaN(num)){
  201.                    alert("Please enter an integer.");
  202.                 return false;
  203.               }
  204.             if (num < min) {
  205.                 alert("Please enter an integer greater than " + (min-1) + ".");
  206.                 return false;
  207.             }
  208.             if (num > max) {
  209.                 alert("Please enter an integer less than " + (max + 1) + ".");
  210.                 return false;
  211.             }            
  212.          }
  213.         return true;
  214.     }
  215.  
  216.     function SetMax(theIndex){
  217.         if (theIndex==1) {
  218.             if (document.userform.hdnhdnMaxConnections.value !=""){
  219.                 document.userform.hdnMaxConnections.value=document.userform.hdnhdnMaxConnections.value;
  220.             }
  221.         }
  222.         else {
  223.             if (document.userform.hdnMaxConnections.value !=""){
  224.                 document.userform.hdnhdnMaxConnections.value=document.userform.hdnMaxConnections.value;    
  225.             }
  226.             document.userform.hdnMaxConnections.value=2000000000;                    
  227.         }
  228.         SetMaxConn();
  229.  
  230.     }
  231.  
  232.     function SetrdoMax(){
  233.         document.userform.rdoMaxConnections[1].checked=true;
  234.         document.userform.hdnhdnMaxConnections.value=document.userform.hdnMaxConnections.value;        
  235.     }
  236.  
  237.     function SetMaxConn(){
  238.         curval=parseInt(document.userform.hdnMaxConnections.value);
  239.         if (curval >=2000000000){
  240.             document.userform.rdoMaxConnections[0].checked=true;
  241.             document.userform.MaxConnections.value=2000000000;
  242.             document.userform.hdnMaxConnections.value="";            
  243.         }
  244.         else{    
  245.             document.userform.MaxConnections.value=document.userform.hdnMaxConnections.value;
  246.         }
  247.  
  248.     }
  249.     
  250.     function setState(mState,mControl){
  251.         <% if Session("Browser") = "IE4" then %>
  252.             mControl.disabled = ! mState;
  253.         <% end if %>
  254.     }
  255.     
  256.     function setLogType(logCntrl,hdncntrl){
  257.         if (logCntrl.checked){
  258.             hdncntrl.value = 1;
  259.         }
  260.         else{
  261.             hdncntrl.value = 0;
  262.         }
  263.     }
  264.     
  265.     function setLogUIType(logCntrl){
  266.         
  267.         var logName = logCntrl.options[logCntrl.selectedIndex].text;
  268.  
  269.         var logType = "";
  270.         
  271.         if (logName.indexOf("Ext") > -1){
  272.             logType = "EXT";
  273.         }
  274.         if (logName.indexOf("ODBC") > -1) {
  275.             logType = "ODBC";
  276.         }
  277.  
  278.         top.connect.location.href = "iisess.asp?setLogUI=" + logType;        
  279.     }
  280.         
  281.     
  282.     function popBox(title, width, height, filename){
  283.         thefile=(filename + ".asp");
  284.         thefile="iipop.asp?pg="+thefile;
  285.         <% if Session("Browser") <> "IE3" then %>
  286.             width=width +25;
  287.             height=height + 50;                
  288.         <% end if %>
  289.  
  290.         popbox=window.open(thefile,title,"toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+width+",height="+height);
  291.         if(popbox !=null){
  292.             if (popbox.opener==null){
  293.                 popbox.opener=self;
  294.             }
  295.         }
  296.     }
  297.  
  298.     
  299.  
  300. </script>
  301. </head>
  302.  
  303. <body bgcolor="#CCCCCC" topmargin="5" text="#000000" STYLE="font-face: Helv,Arial; font-size:10pt;">
  304.  
  305. <font size="1" face="HELV,ARIAL"><form name="userform">
  306. <b><%= L_VIRTUALSERVERID_TEXT %></b>
  307. <blockquote>
  308.  
  309. <table border="0" cellpadding="0">
  310.  
  311. <tr>
  312.     <td valign="bottom">
  313.         <font size="1" face="HELV,ARIAL">
  314.             <%= L_DESCRIPTION_TEXT %>
  315.         </font>
  316.     </td>
  317.     <td valign="bottom" colspan="2">
  318.         <font size="1" face="HELV,ARIAL">
  319.             <%= text("ServerComment",25,"","","",false,false) %>
  320.         </font>
  321.     </td>
  322. </tr>
  323.  
  324.  
  325. <tr>
  326.     <td valign="bottom"><font size="1" face="HELV,ARIAL"><%= L_IPADDRESS_TEXT %></font></td>
  327.     <td valign="bottom">
  328.         <font size="1" face="HELV,ARIAL">
  329.             <%= writeBinding("IPAddress",15,"","","SetBinding();",true,true) %>
  330.             <% if (not readonly) and Session("isAdmin") then %>
  331.                 <input type="hidden" name="ServerBindings" value="<%= currentobj.ServerBindings(0)(0) %>">
  332.             <% end if %>
  333.         </font>
  334.     </td>
  335.         <td align="right" valign="bottom"><font size="1" face="HELV,ARIAL">  
  336.             <% if Session("vtype") <> "svc" then %>
  337.             <% if Session("isAdmin") then %>
  338.                 <% if Session("FONTSIZE")="LARGE" then %>
  339.                     <input type="button" name="hdnAdvanced" value="<%= L_ADVANCED_TEXT %>" onclick="popBox('Advanced',595,375,'iimlti');">
  340.                 <% else %>
  341.                     <input type="button" name="hdnAdvanced" value="<%= L_ADVANCED_TEXT %>" onclick="popBox('Advanced',470,325,'iimlti');">
  342.                 <% end if %>                
  343.             <% end if %>
  344.             <% end if %>            
  345.         </font>
  346.     </td>
  347. </tr>
  348.  
  349. <tr>
  350.     <td valign="bottom"><font size="1" face="HELV,ARIAL"><%= L_TCPPORT_TEXT %></font></td>
  351.     <td valign="bottom">        
  352.         <font size="1" face="HELV,ARIAL">
  353.             <%= writeBinding("IPPort",5,"","","isNum(this,0,9999);SetBinding();",true,true) %>
  354.         </font>
  355.     </td>
  356.  
  357. </tr>
  358.  
  359. <% if Session("isAdmin") then %>
  360.     <% if multibind then %>
  361.     <tr>
  362.         <td valign="bottom" colspan="4">
  363.         <font size="1" face="HELV,ARIAL">
  364.         (<%= L_MULTIBINDING_TEXT %>)
  365.         </font>
  366.         </td>
  367.     </tr>
  368.     <% end if %>
  369. <% end if %>
  370.  
  371. </table>
  372.  
  373. </blockquote>
  374.  
  375. <hr>
  376. <font size="1" face="HELV,ARIAL">
  377. <b><%= L_CONNPARAMS_TEXT %></b>
  378. <blockquote>
  379.  
  380. <table border="0" cellpadding="0">
  381. <tr>
  382.     <td colspan="2">
  383.         <font size="1" face="HELV,ARIAL">
  384.             <%= printradio("MaxConnections", (currentobj.MaxConnections >=2000000000), "SetMax(0);",true) %>
  385.             <%= L_UNLIMITED_TEXT %>
  386.         </font>
  387.     </td>
  388. </tr>
  389.  
  390.  
  391. <tr>    
  392.     <td valign="middle">
  393.         <font size="1" face="HELV,ARIAL">
  394.             <%= printradio("MaxConnections", (currentobj.MaxConnections < 2000000000), "SetMax(1);",true) %>
  395.             <%= L_LIMITTO_TEXT %><input type="hidden" name="MaxConnections" value="<%= currentobj.MaxConnections %>">
  396.         </font>
  397.     </td>
  398.     <td valign="bottom">
  399.         <font size="1" face="HELV,ARIAL">
  400.             <% if (currentobj.MaxConnections < 2000000000) then %>    
  401.                 <%= inputbox(0,"TEXT","hdnMaxConnections",currentobj.MaxConnections,10,"","", "isNum(this,1,2000000001);SetMaxConn();",True,True,False) %>
  402.             <% else %>
  403.                 <%= inputbox(0,"TEXT","hdnMaxConnections","",10,"","", "isNum(this,1,2000000001);SetMaxConn();",True,True,False) %>
  404.             <% end if %>                                
  405.     </td>
  406.     <td valign="middle">
  407.         <font size="1" face="HELV,ARIAL">        
  408.                  <%= L_CONNECTIONS_TEXT %>
  409.         </font>    
  410.     </td>
  411. </tr>
  412. <tr>
  413.     <td>  </td>
  414. </tr>
  415.  
  416. <tr>
  417.     <td valign="middle"><font size="1" face="HELV,ARIAL"><%= L_CONNTIMEOUT_TEXT %>  </font></td>
  418.     <td valign="bottom">
  419.             <%= text("ConnectionTimeout",10,"","", "isNum(this,1,2147483646);",True,True) %>
  420.     </td>
  421.     <td valign="middle">
  422.         <font size="1" face="HELV,ARIAL">    
  423.          <%= L_SECONDS_TEXT %>
  424.         </font>
  425.     </td>
  426. </tr>
  427.  
  428. <tr>
  429.     <td colspan="2" height="4"></td>
  430. </tr>
  431.  
  432. </table>
  433.  
  434. </blockquote>
  435. </font>
  436.  
  437.  
  438. <hr>
  439. <font size="1" face="HELV,ARIAL">
  440.  
  441. <%
  442. On Error Resume Next
  443. Dim LoggingModules,noLogging, Module
  444.  
  445. Set LoggingModules = GetObject("IIS://localhost/logging")
  446. if err <> 0 then
  447.     noLogging = True
  448. end if
  449.                 
  450. %>
  451. <% if noLogging then %>
  452.     <img align="top" src="images/checkoff.gif" width="13" height="13">
  453. <% else %>
  454.     <% if currentobj.LogType = 1 then %>
  455.         <INPUT TYPE="checkbox" NAME="hdnLogType" checked OnClick = "setLogType(this,document.userform.LogType);setState(this.checked,document.userform.hdnBtnLogProps);setState(this.checked,document.userform.LogPlugInClsid);top.title.Global.updated=true;">
  456.     <% else %>
  457.         <INPUT TYPE="checkbox" NAME="hdnLogType" OnClick = "setLogType(this,document.userform.LogType);setState(this.checked,document.userform.hdnBtnLogProps);setState(this.checked,document.userform.LogPlugInClsid);top.title.Global.updated=true;">    
  458.     <% end if %>
  459.     <INPUT TYPE="hidden" NAME="LogType" VALUE="<%= currentobj.LogType %>">
  460. <% end if %>
  461. <%= L_LOGGING_TEXT %>
  462.  
  463. <blockquote>
  464.  
  465. <table border="0" cellpadding="0">
  466. <tr>
  467.     <td colspan="1">
  468.         <font size="1" face="HELV,ARIAL">        
  469.             <%= L_LOGFORMAT_TEXT %>
  470.             <select size="1" name="LogPlugInClsid" onchange="setLogUIType(this);">            
  471.                 <%
  472.                 
  473.                     if noLogging then
  474.                         Response.write "<OPTION>" & L_NONEINSTALLED_TEXT & "</OPTION>"                            
  475.                     else
  476.                         For Each Module in LoggingModules
  477.                             Response.write writeLogTypes("LogPluginClsid", Module.Name, Module.LogModuleId,false)                         
  478.                         Next
  479.                     end if
  480.                 %>
  481.             </select>
  482.         </font>
  483.     </td>
  484.     <td>
  485.     <% if not noLogging then %>
  486.         <% if Session("FONTSIZE") = "LARGE" then %>
  487.         <input type="button" name="hdnBtnLogProps" value="<%= L_EDIT_TEXT %>" onclick="popBox('LogDetail',450,400,'iilog');">
  488.         <% else %>
  489.         <input type="button" name="hdnBtnLogProps" value="<%= L_EDIT_TEXT %>" onclick="popBox('LogDetail',400,400,'iilog');">        
  490.         <% end if %>
  491.     <% end if %>
  492.     </td>
  493. </tr>
  494.  
  495. </table>
  496.  
  497. </blockquote>
  498. </form>
  499. </font>
  500. <% if not noLogging then %>
  501. <script language="JavaScript">
  502.     setState(document.userform.hdnLogType.checked,document.userform.LogPlugInClsid);
  503.     setState(document.userform.hdnLogType.checked,document.userform.hdnBtnLogProps)
  504.     setLogUIType(document.userform.LogPlugInClsid)
  505. </script>
  506. <% end if %>
  507. </body>
  508. </html>
  509.  
  510.  
  511. <% end if %>
  512.