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