home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 March / VPR0003B.ISO / i386 / iivs.asp < prev    next >
Text File  |  1999-10-14  |  15KB  |  544 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="アクセスは拒否されました" 
  13. Const L_ENTERINT_ERRORMESSAGE="整数を入力してください。"
  14. Const L_UNSAVEDCHANGES_ERRORMESSAGE="変更内容が保存されていません。保存しますか?"
  15. Const L_VIRTUALSERVERID_TEXT="Web サイトの識別"
  16. Const L_WORKINGSERVER_TEXT="警告! 現在接続しているサイトのプロパティを変更しいます。これによりリモート セッションが無効になる可能性があります。"
  17. Const L_MULTIBINDING_TEXT="このリソースは多重結合を持っています"
  18. Const L_HOSTHEADER_TEXT="ホスト ヘッダー名:"
  19. Const L_DESCRIPTION_TEXT="説明:"
  20. Const L_IPADDRESS_TEXT="IP アドレス:"
  21. Const L_TCPPORT_TEXT="TCP ポート:"
  22. Const L_SSLPORT_TEXT="SSL ポート:"
  23. Const L_UNLIMITED_TEXT="無制限"
  24. Const L_LIMITTO_TEXT="最大接続数:"
  25. Const L_CONNPARAMS_TEXT="接続"
  26. Const L_MAXCON_TEXT="最大接続数:"
  27. Const L_CONNTIMEOUT_TEXT="接続のタイムアウト:"
  28. Const L_SECONDS_TEXT="秒"
  29. Const L_ADVANCED_TEXT="詳細..."
  30. Const L_ALLUNASSIGNED_TEXT="(未使用の IP アドレスすべて)"
  31. Const L_CONNECTIONS_TEXT="接続"
  32. Const L_LOGGING_TEXT="ログを収集する"
  33. Const L_LOGFORMAT_TEXT="アクティブ ログ形式:"
  34. Const L_NONEINSTALLED_TEXT = " [現在ログ モジュールはインストールされていません] "
  35. Const L_EDIT_TEXT = "プロパティ..."
  36.  
  37. Const DEFAULTPORT = 80
  38. Const L_DEFAULTMAXCONNECTIONS_NUM = 1000
  39.  
  40. Const L_CHGBINDING_TEXT="警告!\r\r現在接続しているのサーバーの結合を変更しようとしています。結合を変更するとこのサイトへの接続が切断されます。\r\r続けますか?"
  41. Const L_SAVING_TEXT="保存中..."
  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.  
  132.             else
  133.                 writeBinding=inputbox(err,"TEXT","hdnIPA",ipaddress,fieldsize,onchangeproc,onfocusproc, onblurproc,True,adminonly,False)
  134.             end if
  135.     
  136.         elseif fieldname="SecureBinding" then
  137.             secPort=""
  138.             aSecBinding=currentobj.SecureBindings
  139.             if aSecBinding(0) <> "" then 
  140.             arraybound=UBound(aSecBinding)            
  141.             for j=0 to arraybound
  142.                 SecBinding=getBinding(aSecBinding(0))
  143.                 if SecBinding(0)=Binding(0) then
  144.                     secPort=SecBinding(1)
  145.                     exit for
  146.                 end if
  147.             Next
  148.             end if 
  149.  
  150.             if readonly then
  151.                 writeBinding=secPort & inputbox(err,"TEXT","hdnSecBinding",secPort,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  152.  
  153.  
  154.             else
  155.                 writeBinding=inputbox(err,"TEXT","hdnSecBinding",secPort,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  156.             end if 
  157.     
  158.         end if
  159.  
  160.  
  161. end function
  162.  
  163.  
  164. function allBindings()
  165.     dim sBinding,sBindingList
  166.     sBindingList = ""
  167.     for each sBinding in currentobj.ServerBindings
  168.         sBindingList = sBindingList & sBinding & ","
  169.     next
  170.     'trim trailing comma
  171.     if sBindingList <> "" then
  172.         sBindingList = Left(sBindingList, Len(sBindingList) -1)
  173.     end if
  174.     allBindings = sBindingList
  175. end function
  176.  
  177. function writeLogTypes(fieldname,value, id, adminonly)
  178.     On Error Resume Next 
  179.  
  180.     if id = currentobj.Get("LogPluginClsid") then
  181.         writeLogTypes="<OPTION SELECTED VALUE='" & id & "'>" & value
  182.     else
  183.         writeLogTypes="<OPTION VALUE='" & id & "'>" & value    
  184.     end if
  185. end function
  186.  
  187.  
  188.  %>
  189.  
  190.  
  191.  
  192. <html>
  193.  
  194. <head>
  195. <title></title>
  196. <script language="JavaScript">
  197.  
  198.     var Global=top.title.Global;
  199.  
  200.     Global.helpFileName="iipy";
  201.     Global.siteProperties = true;
  202.  
  203.     function warnWrkingSite()
  204.     {
  205.         if (top.title.nodeList[Global.selId].isWorkingServer)
  206.         {
  207.             alert("<%= L_WORKINGSERVER_TEXT %>");
  208.         }
  209.     }
  210.     
  211.     function SetBinding(){
  212.         
  213.         if (top.title.nodeList[top.title.Global.selId].isWorkingServer){
  214.             if (!confirm("<%= L_CHGBINDING_TEXT %>")){
  215.                 document.userform.hdnIPA.value=document.userform.hdnhdnIPA.value
  216.                 document.userform.hdnPort.value=document.userform.hdnhdnPort.value
  217.                 return;
  218.             }
  219.         }
  220.         if (document.userform.hdnIPA.value == "<%= L_ALLUNASSIGNED_TEXT%>"){
  221.             hdnIPA = "";
  222.         }
  223.         else{
  224.             hdnIPA = document.userform.hdnIPA.value;
  225.         }        
  226.         
  227.         document.userform.ServerBindings.value=hdnIPA + ":" + document.userform.hdnPort.value + ":" + document.userform.hdnHost.value; 
  228.         document.userform.hdnhdnIPA.value=hdnIPA;
  229.         document.userform.hdnhdnPort.value=document.userform.hdnPort.value;            
  230.         
  231.         if (hdnIPA == "")
  232.         {
  233.             document.userform.hdnIPA.value = "<%= L_ALLUNASSIGNED_TEXT%>";
  234.         }
  235.     }
  236.  
  237.     function isNum(txtcntrl,min,max) {
  238.         str=txtcntrl.value;
  239.     
  240.         for (var i=0; i < str.length; i++) {
  241.               num = parseInt(str.substring(i,i+1));
  242.             if (isNaN(num)){
  243.                alert("整数を入力してください。");
  244.                 return false;
  245.               }            
  246.          }
  247.         num = str;
  248.         
  249.         if (min != ""){    
  250.             if (num < min) {
  251.                 alert((min-1) + "より大きい整数を入力してください。");
  252.                 return false;
  253.             }
  254.         }
  255.         
  256.         if (max != ""){
  257.             if (num > max) {
  258.                 alert((max + 1) + "より小さい整数を入力してください。");
  259.                 return false;
  260.             }        
  261.         }
  262.         return true;
  263.     }
  264.  
  265.     function SetMaxConn(){
  266.         curval=parseInt(document.userform.hdnMaxConnections.value);
  267.         if (document.userform.rdoMaxConnections[0].checked){
  268.             document.userform.MaxConnections.value=2000000000;    
  269.         }
  270.         else{    
  271.             document.userform.MaxConnections.value=document.userform.hdnMaxConnections.value;
  272.         }
  273.     }
  274.     
  275.     function setState(mState,mControl){
  276.         <% if Session("Browser") = "IE4" then %>
  277.             mControl.disabled = ! mState;
  278.         <% end if %>
  279.     }
  280.     
  281.     function setLogType(logCntrl,hdncntrl){
  282.         if (logCntrl.checked){
  283.             hdncntrl.value = 1;
  284.         }
  285.         else{
  286.             hdncntrl.value = 0;
  287.         }
  288.     }
  289.     
  290.     function setLogUIType(logCntrl){
  291.         
  292.         var logName = logCntrl.options[logCntrl.selectedIndex].text;
  293.  
  294.         var logType = "";
  295.         
  296.         if (logName.indexOf("Ext") > -1){
  297.             logType = "EXT";
  298.         }
  299.         if (logName.indexOf("ODBC") > -1) {
  300.             logType = "ODBC";
  301.         }
  302.  
  303.         top.connect.location.href = "iisess.asp?setLogUI=" + logType;        
  304.     }
  305.         
  306.     
  307.     function popBox(title, width, height, filename){
  308.         thefile=(filename + ".asp");
  309.         thefile="iipop.asp?pg="+thefile;
  310.         <% if Session("Browser") <> "IE3" then %>
  311.             width=width +25;
  312.             height=height + 50;                
  313.         <% end if %>
  314.  
  315.         popbox=window.open(thefile,title,"toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+width+",height="+height);
  316.         if(popbox !=null){
  317.             if (popbox.opener==null){
  318.                 popbox.opener=self;
  319.             }
  320.         }
  321.     }
  322.  
  323.     
  324.  
  325. </script>
  326. </head>
  327.  
  328. <body bgcolor="#CCCCCC" topmargin="5" text="#000000" STYLE="font-size:10pt;">
  329.  
  330. <FONT SIZE=2>
  331. <form name="userform">
  332. <b><%= L_VIRTUALSERVERID_TEXT %></b>
  333. <blockquote>
  334.  
  335. <table border="0" cellpadding="0">
  336. <tr>
  337.     <td valign="bottom">
  338.         <FONT SIZE=2>
  339.             <%= L_DESCRIPTION_TEXT %>
  340.         </font>
  341.     </td>
  342.     <td valign="bottom" colspan="2">
  343.         <FONT SIZE=2>
  344.             <%= text("ServerComment",25,"","","",false,false) %>
  345.         </font>
  346.     </td>
  347. </tr>
  348.  
  349. <tr>
  350.     <td valign="bottom"><FONT SIZE=2><%= L_IPADDRESS_TEXT %></font></td>
  351.     <td valign="bottom">
  352.         <FONT SIZE=2>
  353.             <%= writeBinding("IPAddress",25,"","","warnWrkingSite();SetBinding();",true,true) %>
  354.             <input type="hidden" name="ServerBindings" value="<%= allBindings() %>">
  355.         </font>
  356.     </td>
  357.         <td align="right" valign="bottom"><FONT SIZE=2>  
  358.             <% if Session("vtype") <> "svc" then %>
  359.             <% if Session("isAdmin") then %>
  360.                 <% if Session("FONTSIZE")="LARGE" then %>
  361.                     <input type="button" name="hdnAdvanced" value="<%= L_ADVANCED_TEXT %>" onclick="popBox('Advanced',720,375,'iimlti');">
  362.                 <% else %>
  363.                     <input type="button" name="hdnAdvanced" value="<%= L_ADVANCED_TEXT %>" onclick="popBox('Advanced',570,325,'iimlti');">
  364.                 <% end if %>                
  365.             <% end if %>
  366.             <% end if %>            
  367.         </font>
  368.     </td>
  369. </tr>
  370.  
  371. <tr>
  372.     <td valign="bottom"><FONT SIZE=2><%= L_TCPPORT_TEXT %></font></td>
  373.     <td valign="bottom">        
  374.         <FONT SIZE=2>
  375.             <%= writeBinding("IPPort",5,"","","warnWrkingSite();isNum(this,0,9999);SetBinding();",true,true) %>
  376.             <%= writeBinding("Host",5,"","","warnWrkingSite();SetBinding();",true,true) %>        
  377.         </font>
  378.     </td>
  379.  
  380. </tr>
  381.  
  382. <% if Session("isAdmin") then %>
  383.     <% if multibind then %>
  384.     <tr>
  385.         <td valign="bottom" colspan="4">
  386.         <FONT SIZE=2>
  387.         (<%= L_MULTIBINDING_TEXT %>)
  388.         </font>
  389.         </td>
  390.     </tr>
  391.     <% end if %>
  392. <% end if %>
  393.  
  394. </table>
  395.  
  396. </blockquote>
  397.  
  398. <hr>
  399. <FONT SIZE=2>
  400. <b><%= L_CONNPARAMS_TEXT %></b>
  401. <blockquote>
  402.  
  403. <table border="0" cellpadding="0">
  404. <tr>
  405.     <td colspan="2">
  406.         <FONT SIZE=2>
  407.             <%= printradio("MaxConnections", (currentobj.MaxConnections >=2000000000), "SetMaxConn();setState(!this.checked,document.userform.hdnMaxConnections);",true) %>
  408.             <%= L_UNLIMITED_TEXT %>
  409.         </font>
  410.     </td>
  411. </tr>
  412.  
  413.  
  414. <tr>    
  415.     <td valign="middle">
  416.         <FONT SIZE=2>
  417.             <%= printradio("MaxConnections", (currentobj.MaxConnections < 2000000000), "SetMaxConn();setState(this.checked,document.userform.hdnMaxConnections);",true) %>
  418.             <%= L_LIMITTO_TEXT %>
  419.             <input type="hidden" name="MaxConnections" value="<%= currentobj.MaxConnections %>">            
  420.  
  421.         </font>
  422.     </td>
  423.     <td valign="bottom">
  424.         <FONT SIZE=2>
  425.             <% if (currentobj.MaxConnections < 2000000000) then %>    
  426.                 <%= inputbox(0,"TEXT","hdnMaxConnections",currentobj.MaxConnections,10,"","", "isNum(this,1,2000000001);SetMaxConn();",false,True,False) %>
  427.             <% else %>
  428.  
  429.                 <%= inputbox(0,"TEXT","hdnMaxConnections",L_DEFAULTMAXCONNECTIONS_NUM,10,"","", "isNum(this,1,2000000001);SetMaxConn();",false,True,False) %>
  430.             <% end if %>                                
  431.     </td>
  432.     <td valign="middle">
  433.         <FONT SIZE=2>        
  434.                  <%= L_CONNECTIONS_TEXT %>
  435.         </font>    
  436.     </td>
  437. </tr>
  438. <tr>
  439.     <td>  </td>
  440. </tr>
  441.  
  442. <tr>
  443.     <td valign="middle"><FONT SIZE=2><%= L_CONNTIMEOUT_TEXT %>  </font></td>
  444.     <td valign="bottom">
  445.             <%= text("ConnectionTimeout",10,"","", "isNum(this,1,2147483646);",True,True) %>
  446.     </td>
  447.     <td valign="middle">
  448.         <FONT SIZE=2>
  449.          <%= L_SECONDS_TEXT %>
  450.         </font>
  451.     </td>
  452. </tr>
  453.  
  454. <tr>
  455.     <td colspan="2" height="4"></td>
  456. </tr>
  457.  
  458. </table>
  459.  
  460. </blockquote>
  461. </font>
  462.  
  463.  
  464. <hr>
  465. <FONT SIZE=2>
  466.  
  467. <%
  468. On Error Resume Next
  469. Dim LoggingModules,noLogging, Module, InfoNode, AvailMods
  470.  
  471. Set LoggingModules = GetObject("IIS://localhost/logging")
  472. Set InfoNode = GetObject("IIS://localhost/W3SVC/Info")
  473. AvailMods = InfoNode.LogModuleList
  474. if err <> 0 then
  475.     noLogging = True
  476. end if
  477.                 
  478. %>
  479. <% if noLogging then %>
  480.     <img align="top" src="images/checkoff.gif" width="13" height="13">
  481. <% else %>
  482.     <% if currentobj.LogType = 1 then %>
  483.         <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;">
  484.     <% else %>
  485.         <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;">    
  486.     <% end if %>
  487.     <INPUT TYPE="hidden" NAME="LogType" VALUE="<%= currentobj.LogType %>">
  488. <% end if %>
  489. <%= L_LOGGING_TEXT %>
  490.  
  491. <blockquote>
  492.  
  493. <table border="0" cellpadding="0">
  494. <tr>
  495.     <td colspan="1">
  496.         <FONT SIZE=2>        
  497.             <%= L_LOGFORMAT_TEXT %>
  498.             <select size="1" name="LogPlugInClsid" onchange="setLogUIType(this);">            
  499.                 <%
  500.                 
  501.                     if noLogging then
  502.                         Response.write "<OPTION>" & L_NONEINSTALLED_TEXT & "</OPTION>"                            
  503.                     else
  504.                         For Each Module in LoggingModules
  505.                             If InStr(AvailMods, Module.Name) Then
  506.                                 Response.write writeLogTypes("LogPluginClsid", Module.Name, Module.LogModuleId,false)                         
  507.                             End If
  508.                         Next
  509.                     end if
  510.                 %>
  511.             </select>
  512.         </font>
  513.     </td>
  514.     <td><FONT SIZE=2>
  515.     <% if not noLogging then %>
  516.         <% if Session("FONTSIZE") = "LARGE" then %>
  517.         <input type="button" name="hdnBtnLogProps" value="<%= L_EDIT_TEXT %>" onclick="popBox('LogDetail',450,400,'iilog');">
  518.         <% else %>
  519.         <input type="button" name="hdnBtnLogProps" value="<%= L_EDIT_TEXT %>" onclick="popBox('LogDetail',400,400,'iilog');">        
  520.         <% end if %>
  521.     <% end if %>
  522.     </FONT>
  523.     </td>
  524. </tr>
  525.  
  526. </table>
  527.  
  528. </blockquote>
  529. </form>
  530. </font>
  531. <% if not noLogging then %>
  532. <script language="JavaScript">
  533.     setState(document.userform.rdoMaxConnections[1].checked,document.userform.hdnMaxConnections);
  534.     setState(document.userform.hdnLogType.checked,document.userform.LogPlugInClsid);
  535.     setState(document.userform.hdnLogType.checked,document.userform.hdnBtnLogProps)
  536.     setLogUIType(document.userform.LogPlugInClsid)
  537. </script>
  538. <% end if %>
  539. </body>
  540. </html>
  541.  
  542.  
  543. <% end if %>
  544.