home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 March / VPR0003B.ISO / alpha / iimltihd.asp < prev    next >
Text File  |  1999-10-14  |  9KB  |  369 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. Const L_MULTIPLE_TEXT="この Web サイトの複数の ID。"
  11. Const L_IPADDRESS_TEXT="IP アドレス"
  12. Const L_IPPORT_TEXT="TCP ポート"
  13. Const L_SSLPORT_TEXT="SSL ポート"
  14. Const L_HOST_TEXT="ホスト ヘッダー名"
  15. Const L_ACCESSDENIED_TEXT="アクセスは拒否されました"
  16. Const L_SELECTITEM_TEXT="削除するアイテムを選んでください。"
  17. dim listSort
  18.  
  19. listSort = Session("ListSort")
  20.  
  21. function heading(width,thestring,sortstr)
  22.     dim i
  23.     width = width - len(thestring)
  24.     for i = width to 0 step -1
  25.         thestring = thestring & " "
  26.     Next
  27.  
  28.     if listSort and (sortstr <> "") then
  29.         thestring = "<A HREF = " & quote & "javascript:sortList('"& sortstr & "');" & quote & ">" & thestring & "</A>"
  30.     end if
  31.     
  32.     heading = thestring
  33. end function
  34. %>
  35.  
  36. <HTML>
  37. <HEAD>
  38.     <TITLE></TITLE>
  39. </HEAD>
  40.  
  41. <BODY BGCOLOR="#CCCCCC" LINK="#000000" VLINK="#000000" ALINK="navy" TOPMARGIN=10 TEXT="#000000" onLoad="loadList();loadHelp();">
  42. <FORM NAME="userform">
  43.  
  44. <TABLE WIDTH=490 BORDER=0>
  45.     <TR>
  46.         <TD COLSPAN=3 STYLE="font-size:10pt;">
  47.             <FONT SIZE=2>
  48.                 <%= L_MULTIPLE_TEXT %>
  49.                 <BR> 
  50.             </FONT>
  51.         </TD>
  52.     </TR>
  53. </TABLE>
  54.  
  55. <TABLE BORDER=1  BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#CCCCCC" BORDERCOLORLIGHT="#CCCCCC" CELLSPACING=0 CELLPADDING=2>
  56. <TR>
  57. <TD BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" STYLE="font-size:10pt;">
  58. <FONT SIZE=2>
  59.     <% if Session("FONTSIZE")="LARGE" then %>
  60.         <%= heading(36,L_IPADDRESS_TEXT, "ipaddress") %>
  61.     <% else %>
  62.         <%= heading(32,L_IPADDRESS_TEXT, "ipaddress") %>    
  63.     <% end if %>
  64.     </FONT>
  65. </TD>
  66. <TD  BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" STYLE="font-size:10pt;">
  67. <FONT SIZE=2>
  68.     <% if Session("FONTSIZE")="LARGE" then %>
  69.         <%= heading(7,L_IPPORT_TEXT, "ipport") %>
  70.     <% else %>
  71.         <%= heading(9,L_IPPORT_TEXT, "ipport") %>    
  72.     <% end if %>        
  73.     </FONT>
  74. </TD>
  75. <TD  BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" STYLE="font-size:10pt;">
  76. <FONT SIZE=2>
  77.     <% if Session("FONTSIZE")="LARGE" then %>
  78.         <%= heading(8,L_SSLPORT_TEXT, "sslport") %>
  79.     <% else %>
  80.         <%= heading(2,L_SSLPORT_TEXT, "sslport") %>    
  81.     <% end if %>
  82.     </FONT>    
  83. </TD>
  84. <TD  BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" STYLE="font-size:10pt;">
  85. <FONT SIZE=2>
  86.         <% if Session("FONTSIZE")="LARGE" then %>
  87.             <%= heading(21,L_HOST_TEXT, "host") %>
  88.         <% else %>
  89.             <%= heading(22,L_HOST_TEXT, "host") %>
  90.         <% end if %>
  91.     </FONT>    
  92. </TD>
  93. </TR>
  94. </TABLE>
  95. </FORM>
  96.  
  97. <FORM name="hiddenform">
  98.     <INPUT TYPE="hidden" NAME="index" VALUE=0>
  99.     <INPUT TYPE="hidden" NAME="MustDisplayFirstTime" VALUE=0>
  100. </FORM>
  101. </BODY>
  102. <SCRIPT LANGUAGE="JavaScript">
  103.  
  104.  
  105.     function loadHelp(){
  106.         top.title.Global.helpFileName="iipy_27";
  107.     }
  108.  
  109.     function loadList(){
  110.         parent.list.location.href="iimltils.asp";
  111.     }
  112.  
  113.     function addItem(){
  114.         i=cachedList.length
  115.         listFunc.noupdate = true;    
  116.         cachedList[i]=new listObj(i,"","","","");
  117.         cachedList[i].newitem=true;
  118.         cachedList[i].updated=true;
  119.         document.hiddenform.index.value=i;
  120.         document.hiddenform.MustDisplayFirstTime.value=1;
  121.     loadList();
  122.     }
  123.  
  124.     function delItem(){
  125.  
  126.         if (document.hiddenform.index.value >= 0){
  127.             i=eval(document.hiddenform.index.value);
  128.             listFunc.noupdate = true;                
  129.             cachedList[i].deleted=true;
  130.             cachedList[i].updated=true;
  131.              i=i-1;
  132.             <% 'run through the list to find the Next non-deleted item %>
  133.             for (var j=i; j >=0; j--) {
  134.  
  135.                 if (cachedList[j].deleted){
  136.                 }
  137.                 else{
  138.                     break            
  139.                 }
  140.             }    
  141.  
  142.             document.hiddenform.index.value=j;
  143.  
  144.             document.hiddenform.MustDisplayFirstTime.value=0;
  145.  
  146.             loadList();
  147.  
  148.         }
  149.         else{
  150.             alert("<%= L_SELECTITEM_TEXT %>");
  151.         }
  152.     }
  153.     
  154.     function setLastSel(id){
  155.         for (var i=0; i < cachedList.length; i++) {
  156.             if (cachedList[i].id == id){
  157.                 document.hiddenform.index.value = i;
  158.                 return;
  159.             }
  160.         }
  161.         
  162.     }
  163.  
  164.     function sortList(sortby)
  165.         {
  166.         
  167.         i=eval(document.hiddenform.index.value);
  168.         if ( i != -1)
  169.         {
  170.             lastsel = cachedList[i].id
  171.         }
  172.         
  173.         if (sortby != listFunc.sortby)
  174.             {
  175.             listFunc.sortby = sortby;
  176.             listFunc.sortAsc = true;
  177.             }
  178.         else
  179.             {
  180.             listFunc.sortAsc = !listFunc.sortAsc;
  181.             }
  182.             
  183.         var num = parseFloat(cachedList[sortby]);
  184.         
  185.         if (isNaN(num))
  186.             {
  187.             cachedList.sort(sortOrder);
  188.             }
  189.         else
  190.             { 
  191.             cachedList.sort(numOrder);
  192.             }
  193.         if ( i != -1)
  194.         {
  195.             setLastSel(lastsel);
  196.         }
  197.         loadList();
  198.         }
  199.  
  200.     function sortOrder(a,b)
  201.     {
  202.  
  203.         
  204.         if (listFunc.sortAsc){
  205.             astr = a["isSecure"] + a[listFunc.sortby];
  206.             bstr = b["isSecure"] + b[listFunc.sortby];
  207.             
  208.             if (astr.toLowerCase() < bstr.toLowerCase()){
  209.                 return -1;
  210.             }
  211.             else{
  212.                 if (astr.toLowerCase() > bstr.toLowerCase()){
  213.                     return 1;
  214.                 }
  215.                 else{
  216.                     return 0;
  217.                 }
  218.             }            
  219.         }
  220.         else{
  221.             astr = !a["isSecure"] + a[listFunc.sortby];
  222.             bstr = !b["isSecure"] + b[listFunc.sortby];
  223.             
  224.             if (astr.toLowerCase() < bstr.toLowerCase()){
  225.                 return 1;
  226.             }
  227.             else{
  228.                 if (astr.toLowerCase() > bstr.toLowerCase()){
  229.                     return -1;
  230.                 }
  231.                 else{
  232.                     return 0;
  233.                 }
  234.             }
  235.         }
  236.     }
  237.     
  238.     function reSort(){
  239.         //set our sortAsc so we aren't just reversing the list...
  240.         listFunc.sortAsc = !listFunc.sortAsc;
  241.         sortList(listFunc.sortby);
  242.     }
  243.     
  244.     function buildListForm(){
  245.         numrows=0;
  246.         for (var i=0; i < cachedList.length; i++) {
  247.             numrows=numrows + 1;
  248.         }
  249.         qstr="numrows="+numrows;
  250.         qstr=qstr+"&cols=ServerBindings&cols=SecureBindings"
  251.  
  252.         top.hlist.location.href="iihdn.asp?"+qstr;
  253.         <% 'the list values will be grabbed by the hiddenlistform script... %>
  254.     }
  255.  
  256.     function SetListVals(){
  257.         listForm=top.hlist.document.hiddenlistform;
  258.         j=0;
  259.         var bindings = "";
  260.         first=true;
  261.         for (var i=0; i < cachedList.length; i++) {
  262.             if (!cachedList[i].deleted){
  263.                 if (first)
  264.                 {
  265.                     top.opener.document.userform.hdnPort.value= cachedList[i].ipport;
  266.                     top.opener.document.userform.hdnIPA.value= cachedList[i].ipaddress;
  267.                     top.opener.document.userform.hdnHost.value= cachedList[i].host;
  268.                     first = false;
  269.                 }
  270.                 if (cachedList[i].sslport != ""){    
  271.                     listForm.elements[j++].value="";
  272.                     listForm.elements[j++].value=cachedList[i].ipaddress+":"+cachedList[i].sslport +":"+cachedList[i].host;
  273.                 }
  274.                 else{
  275.                     bindings += (cachedList[i].ipaddress+":"+cachedList[i].ipport+":"+cachedList[i].host + ",");
  276.                     listForm.elements[j++].value=cachedList[i].ipaddress+":"+cachedList[i].ipport+":"+cachedList[i].host;
  277.                     listForm.elements[j++].value="";
  278.                 }
  279.             }
  280.             cachedList[i].updated=false; 
  281.         }
  282.         top.opener.document.userform.ServerBindings.value = bindings
  283.  
  284.     }
  285.  
  286.     function listFuncs(){
  287.         this.bHasList = true;
  288.         this.sortList = sortList;
  289.         this.reSort = reSort;        
  290.         this.sortby = "ipaddress";
  291.         this.sortAsc = true;
  292.         this.addItem=addItem;
  293.         this.delItem=delItem;
  294.         this.writeList=buildListForm;
  295.         this.SetListVals=SetListVals;
  296.         this.mainframe = top.opener.top;        
  297.         this.lastSel = 0;
  298.         this.noupdate = false;
  299.     }
  300.  
  301.     function listObj(id,ia,ip,sp,hn){
  302.         this.id = id;
  303.         this.isSecure = (sp != "");
  304.         this.ipaddress=ia;
  305.         this.ipport=ip;
  306.         this.sslport=sp;
  307.         this.host=hn;
  308.         this.deleted=false;
  309.         this.newitem=false;
  310.         this.updated=false;
  311.     }
  312.     listFunc=new listFuncs();
  313.     cachedList=new Array()
  314.  
  315. <!--#include file="iibind.inc"-->
  316.         
  317. <%  
  318.  
  319.     On Error Resume Next 
  320.  
  321.     Dim path, currentobj
  322.     Dim aBinding, ssl, arraybound, Binding, SecureBinding
  323.     Dim barraysize, added, i, j, nexti
  324.     
  325.     path=Session("spath")
  326.     Session("path")=path
  327.     Session("SpecObj")=path
  328.     Session("SpecProps")="ServerBindings"    
  329.     Set currentobj=GetObject(path)
  330.  
  331.  
  332.      Redim aBinding(UBound(currentobj.ServerBindings))
  333.      Redim ssl(UBound(currentobj.SecureBindings))    
  334.     
  335.     aBinding=currentobj.ServerBindings
  336.     ssl=currentobj.SecureBindings
  337.  
  338.     if not IsArray(ssl) then
  339.         ssl=Array(1)
  340.         ssl(0)=currentobj.SecureBindings
  341.     end if
  342.  
  343.     nexti=0
  344.     arraybound=UBound(aBinding)
  345.     if aBinding(0) = "" then
  346.         aBinding(0) = ":80:"
  347.     end if
  348.     for i=0 to arraybound
  349.         Binding=getBinding(aBinding(i))
  350.          %>cachedList[<%= i %>]=new listObj(<%= i %>,"<%= Binding(0) %>","<%= Binding(1) %>","","<%= Binding(2) %>");<%          
  351.     Next
  352.     nexti = i
  353.  
  354.     arraybound=UBound(ssl)
  355.     for each secitem in ssl
  356.         SecureBinding=getBinding(secitem)
  357.         %>cachedList[<%= nexti %>]=new listObj(<%= nexti %>,"<%= SecureBinding(0) %>","","<%= SecureBinding(1) %>","<%= SecureBinding(2) %>");<%  
  358.         nexti=nexti + 1    
  359.     Next
  360.  %>
  361.  
  362.  
  363.  
  364.  
  365. </SCRIPT>
  366.  
  367. </HTML>
  368.  
  369. <% end if %>