home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 July / Chip_2000-07_cd.bin / servis / SPNT / sp6x86.exe / iimltils.asp < prev    next >
Encoding:
Text File  |  1999-12-15  |  12.7 KB  |  332 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <% 
  6. Const L_BROWSE_TEXT="Browse"
  7. Const L_FILE_TEXT="File"
  8. Const L_URL_TEXT="URL"
  9. Const L_ALLUNASSIGNED_TEXT="All Unassigned"
  10. Const L_NA_TEXT="N/A"
  11. Const L_SECURE_TEXT="Secure Bindings"
  12. Const L_SERVER_TEXT="Server Bindings"
  13. %>
  14.  
  15. <HTML>
  16. <HEAD>
  17.     <TITLE></TITLE>
  18.  
  19.     <SCRIPT LANGUAGE="JavaScript">
  20.         function chgStatus(indexnum){
  21.             parent.head.document.hiddenform.index.value=indexnum;
  22.                    parent.head.document.hiddenform.MustDisplayFirstTime.value=1;
  23.             self.location.href="iimltils.asp";
  24.             
  25.         }
  26.  
  27.     function SetUpdated(){
  28.         if (parent.head.listFunc.noupdate){
  29.             parent.head.listFunc.noupdate = false;
  30.         }
  31.         else{
  32.             if (parent.head.document.hiddenform != null){        
  33.             if (parent.head.document.hiddenform.index.value != -1){
  34.                 i=parent.head.document.hiddenform.index.value
  35.                 reSort = setVals(parent.head.cachedList[i],"ipaddress",document.listform.editMe);
  36.                 reSort = reSort || setVals(parent.head.cachedList[i],"ipport",document.listform.ipport);
  37.                 reSort = reSort || setVals(parent.head.cachedList[i],"sslport",document.listform.sslport);
  38.                 reSort = reSort || setVals(parent.head.cachedList[i],"host",document.listform.host);
  39.                 
  40.                 parent.head.cachedList[i].updated=true;
  41.                 if (reSort){
  42.                     parent.head.listFunc.reSort();
  43.                 }
  44.             }
  45.         }
  46.         }
  47.     }
  48.     
  49.     
  50.     function setVals(cachedItem, propName, formCntrl){
  51.         if (cachedItem[propName] != formCntrl.value){
  52.             cachedItem[propName] = formCntrl.value;
  53.             return (parent.head.listFunc.sortby == propName);
  54.         }        
  55.         else{
  56.             return false;
  57.         }
  58.     }
  59.     function SetSecure(item,formCntrl,isSecure)
  60.     {
  61.         if (formCntrl.value != "")
  62.         {
  63.             parent.head.cachedList[item].isSecure = isSecure;
  64.         }
  65.     }
  66.     
  67.     </SCRIPT>
  68. </HEAD>
  69.  
  70. <BODY BGCOLOR="#FFFFFF" LEFTMARGIN=0 TOPMARGIN=0>
  71.  
  72. <FORM NAME="listform">
  73.  
  74. <SCRIPT LANGUAGE="JavaScript">
  75.  
  76.     editOK=false;
  77.     writeSecHdr = true;
  78.     writeHdr = true;    
  79.     sel=eval(parent.head.document.hiddenform.index.value);    
  80.     list = writeList();
  81.     writeLine(list);
  82.  
  83. function writeList(){    
  84.     <% if Session("IsIE") then %>
  85.     <% if Session("FONTSIZE") = "LARGE" then %>
  86.         writestr = "<TABLE WIDTH=470 BORDER=0 CELLPADDING=2 CELLSPACING=0>";
  87.     <% else %>
  88.         writestr = "<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0>";    
  89.     <% end if %>
  90.     <% else %>
  91.     <% if Session("FONTSIZE") = "LARGE" then %>
  92.         writestr = "<TABLE WIDTH=475 BORDER=0 CELLPADDING=2 CELLSPACING=0>";
  93.     <% else %>
  94.         writestr = "<TABLE WIDTH=344 BORDER=0 CELLPADDING=2 CELLSPACING=0>";
  95.     <% end if %>
  96.     <% end if %>    
  97.     
  98.         //Create a new Array to store the list in a resonable order
  99.         var tmpArray;
  100.         tmpArray = new Array();
  101.         var CurrentPos,PosSeparator;
  102.         CurrentPos=0;
  103.         PosSeparator=0;
  104.         for (var j=0;j < parent.head.cachedList.length; j++) {
  105.             // first of all the ServerBindings
  106.             if (!((parent.head.cachedList[j].ipport  == "") &&
  107.                 (parent.head.cachedList[j].sslport == "") &&
  108.                 (parent.head.cachedList[j].host    == "") &&
  109.                 (parent.head.cachedList[j].deleted == false) &&
  110.                 (parent.head.cachedList[j].newitem == false) ))
  111.             {
  112.                 // ipport BUT NOT sslport
  113.                 if ((parent.head.cachedList[j].ipport  != "") &&
  114.                     (parent.head.cachedList[j].sslport == "")) 
  115.                 { 
  116.                     tmpArray[CurrentPos]=parent.head.cachedList[j];
  117.                     CurrentPos++;
  118.                 }
  119.             } 
  120.         };
  121.         // now aggregate SSL Bindings
  122.         for (var j=0;j < parent.head.cachedList.length; j++) {
  123.             if (!((parent.head.cachedList[j].ipport  == "") &&
  124.                 (parent.head.cachedList[j].sslport == "") &&
  125.                 (parent.head.cachedList[j].host    == "") &&
  126.                 (parent.head.cachedList[j].deleted == false) &&
  127.                 (parent.head.cachedList[j].newitem == false) ))
  128.             {
  129.                 // sllport BUT NOT ipport AND NOT host
  130.                 if ((parent.head.cachedList[j].sllport  != "") &&
  131.                     (parent.head.cachedList[j].ipport   == "") &&
  132.                     (parent.head.cachedList[j].host   == "")) 
  133.                 { 
  134.                     tmpArray[CurrentPos]=parent.head.cachedList[j];
  135.                     CurrentPos++;
  136.                 }
  137.             } 
  138.         };
  139.         // now the most important thing, exchange the arrays
  140.         parent.head.cachedList = tmpArray; 
  141.         
  142.     for (var i=0;i < parent.head.cachedList.length; i++) {
  143.     
  144.         if (parent.head.cachedList[i].sslport != ""){
  145.             if (writeSecHdr){
  146.                 writestr += "<TR>"
  147.                 writestr += writeCol(4,150," ");
  148.                 writestr += "</TR>";                    
  149.                 writestr += "<TR BGCOLOR=#CCCCCC>"
  150.                 writestr += writeCol(4,150,"<B><%= L_SECURE_TEXT %></B>");
  151.                 writestr += "</TR>";
  152.                 writeSecHdr = false;
  153.             }
  154.         }
  155.         else{
  156.             if (writeHdr){        
  157.                 writestr += "<TR BGCOLOR=#CCCCCC>"
  158.                 writestr += writeCol(4,150,"<B><%= L_SERVER_TEXT %></B>");
  159.                 writestr += "</TR>";
  160.                 writeHdr = false;
  161.             }            
  162.         }
  163.  
  164.         if(parent.head.document.hiddenform.MustDisplayFirstTime.value == 0){
  165.                 if (parent.head.cachedList[i].deleted){
  166.                 }
  167.                 else{
  168.             
  169.                     <% if Session("IsIE") then %>
  170.                         <% if Session("FONTSIZE") = "LARGE" then %>
  171.                             writestr += "<TR>"
  172.                             writestr += writeCol(1,150,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  173.                             writestr += writeCol(1,65,displayVal(parent.head.cachedList[i].ipport,"<%= L_NA_TEXT %>"));
  174.                             writestr += writeCol(1,65,displayVal(parent.head.cachedList[i].sslport,"<%= L_NA_TEXT %>"));                    
  175.                             writestr += writeCol(1,190,parent.head.cachedList[i].host);
  176.                             writestr += "</TR>";
  177.                         <% else %>
  178.                         
  179.                             writestr += "<TR>"
  180.                             writestr += writeCol(1,110,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  181.                             writestr += writeCol(1,50,displayVal(parent.head.cachedList[i].ipport,"<%= L_NA_TEXT %>"));
  182.                             writestr += writeCol(1,50,displayVal(parent.head.cachedList[i].sslport,"<%= L_NA_TEXT %>"));                    
  183.                             writestr += writeCol(1,140,parent.head.cachedList[i].host);
  184.                             writestr += "</TR>";
  185.                 
  186.                         <% end if %>
  187.                     <% else %>
  188.                         <% if Session("FONTSIZE") = "LARGE" then %>
  189.                             writestr += "<TR>"
  190.                             writestr += writeCol(1,150,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  191.                             writestr += writeCol(1,60,parent.head.cachedList[i].ipport);
  192.                             writestr += writeCol(1,60,displayVal(parent.head.cachedList[i].sslport,"N/A"));                    
  193.                             writestr += writeCol(1,195,parent.head.cachedList[i].host);
  194.                             writestr += "</TR>";
  195.                         <% else %>
  196.                             writestr += "<TR>"
  197.                             writestr += writeCol(1,116,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  198.                             writestr += writeCol(1,43,parent.head.cachedList[i].ipport);
  199.                             writestr += writeCol(1,47,displayVal(parent.head.cachedList[i].sslport,"N/A"));                    
  200.                             writestr += writeCol(1,148,parent.head.cachedList[i].host);
  201.                             writestr += "</TR>";
  202.                         <% end if %>
  203.                     <% end if %>
  204.                 }
  205.         } 
  206.         else  // use the old code
  207.         { 
  208.             if (parent.head.document.hiddenform.index.value !=i) {
  209.                 if (parent.head.cachedList[i].deleted){
  210.                 }
  211.                 else{
  212.             
  213.                     <% if Session("IsIE") then %>
  214.                         <% if Session("FONTSIZE") = "LARGE" then %>
  215.                             writestr += "<TR>"
  216.                             writestr += writeCol(1,150,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  217.                             writestr += writeCol(1,65,displayVal(parent.head.cachedList[i].ipport,"<%= L_NA_TEXT %>"));
  218.                             writestr += writeCol(1,65,displayVal(parent.head.cachedList[i].sslport,"<%= L_NA_TEXT %>"));                    
  219.                             writestr += writeCol(1,190,parent.head.cachedList[i].host);
  220.                             writestr += "</TR>";
  221.                         <% else %>
  222.                         
  223.                             writestr += "<TR>"
  224.                             writestr += writeCol(1,110,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  225.                             writestr += writeCol(1,50,displayVal(parent.head.cachedList[i].ipport,"<%= L_NA_TEXT %>"));
  226.                             writestr += writeCol(1,50,displayVal(parent.head.cachedList[i].sslport,"<%= L_NA_TEXT %>"));                    
  227.                             writestr += writeCol(1,140,parent.head.cachedList[i].host);
  228.                             writestr += "</TR>";
  229.                 
  230.                         <% end if %>
  231.                     <% else %>
  232.                         <% if Session("FONTSIZE") = "LARGE" then %>
  233.                             writestr += "<TR>"
  234.                             writestr += writeCol(1,150,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  235.                             writestr += writeCol(1,60,parent.head.cachedList[i].ipport);
  236.                             writestr += writeCol(1,60,displayVal(parent.head.cachedList[i].sslport,"N/A"));                    
  237.                             writestr += writeCol(1,195,parent.head.cachedList[i].host);
  238.                             writestr += "</TR>";
  239.                         <% else %>
  240.                             writestr += "<TR>"
  241.                             writestr += writeCol(1,116,"<A HREF='javascript:chgStatus("+i+");'>" + displayVal(parent.head.cachedList[i].ipaddress,"<%= L_ALLUNASSIGNED_TEXT %>") + "</A>");
  242.                             writestr += writeCol(1,43,parent.head.cachedList[i].ipport);
  243.                             writestr += writeCol(1,47,displayVal(parent.head.cachedList[i].sslport,"N/A"));                    
  244.                             writestr += writeCol(1,148,parent.head.cachedList[i].host);
  245.                             writestr += "</TR>";
  246.                         <% end if %>
  247.                     <% end if %>
  248.                 }
  249.             }
  250.             else{
  251.                 editOK=true;
  252.                 <% if Session("IsIE") then %>
  253.             
  254.                     writestr += "<TR>"
  255.                     writestr += writeCol(1,110,"<INPUT NAME='editMe' VALUE='"+parent.head.cachedList[i].ipaddress +"' SIZE=13 onBlur='SetUpdated();'>");
  256.                     writestr += writeCol(1,40,"<INPUT NAME='ipport' VALUE='"+parent.head.cachedList[i].ipport +"' SIZE=5 onBlur='SetSecure(" + i + ",this,false);SetUpdated();'>");
  257.                     writestr += writeCol(1,40,"<INPUT NAME='sslport' VALUE='"+parent.head.cachedList[i].sslport +"' SIZE=5 onBlur='SetSecure(" + i + ",this,true);SetUpdated();'>");                    
  258.                     writestr += writeCol(1,140,"<INPUT NAME='host' VALUE='"+parent.head.cachedList[i].host +"' SIZE=15 onBlur='SetUpdated();'>");
  259.                     writestr += "</TR>";        
  260.  
  261.                 <% else %>
  262.                     <% if Session("FONTSIZE") = "LARGE" then %>
  263.                 
  264.                         writestr += "<TR>"
  265.                         writestr += writeCol(1,150,"<INPUT NAME='editMe' VALUE='"+parent.head.cachedList[i].ipaddress +"' SIZE=13 onBlur='SetUpdated();'>");
  266.                         writestr += writeCol(1,60,"<INPUT NAME='ipport' VALUE='"+parent.head.cachedList[i].ipport +"' SIZE=5 onBlur='SetSecure(" + i + ",this,false);SetUpdated();'>");
  267.                         writestr += writeCol(1,60,"<INPUT NAME='sslport' VALUE='"+parent.head.cachedList[i].sslport +"' SIZE=5 onBlur='SetSecure(" + i + ",this,true);SetUpdated();'>");                    
  268.                         writestr += writeCol(1,195,"<INPUT NAME='host' VALUE='"+parent.head.cachedList[i].host +"' SIZE=25 onBlur='SetUpdated();'>");
  269.                         writestr += "</TR>";
  270.                 
  271.                     <% else %>
  272.                     
  273.                         writestr += "<TR>"
  274.                         writestr += writeCol(1,116,"<INPUT NAME='editMe' VALUE='"+parent.head.cachedList[i].ipaddress +"' SIZE=13 onBlur='SetUpdated();'>");
  275.                         writestr += writeCol(1,43,"<INPUT NAME='ipport' VALUE='"+parent.head.cachedList[i].ipport +"' SIZE=5 onBlur='SetSecure(" + i + ",this,false);SetUpdated();'>");
  276.                         writestr += writeCol(1,47,"<INPUT NAME='sslport' VALUE='"+parent.head.cachedList[i].sslport +"' SIZE=5 onBlur='SetSecure(" + i + ",this,true);SetUpdated();'>");                    
  277.                         writestr += writeCol(1,148,"<INPUT NAME='host' VALUE='"+parent.head.cachedList[i].host +"' SIZE=25 onBlur='SetUpdated();'>");
  278.                         writestr += "</TR>";
  279.  
  280.                     <% end if %>
  281.                 <% end if %>
  282.             }
  283.         } // end if on testing for displaying the first time
  284.  
  285.  
  286.     }
  287.     writestr += "</TABLE>";
  288.     
  289.     return writestr;
  290. }    
  291.     
  292. function displayVal(dispstr, altstr){
  293.     if (dispstr == ""){
  294.         dispstr = altstr;
  295.     }
  296.     return dispstr;
  297. }
  298.  
  299. function writeCol(colspan,w,str){
  300.         var writestr = "<TD";
  301.         if (colspan != ""){
  302.             writestr += " COLSPAN = " + colspan
  303.         }
  304.         if (w != ""){
  305.             writestr += " WIDTH = " + w;
  306.         }        
  307.         <% if Session("IsIE") then %>
  308.                 writestr += " STYLE = 'font-face: Helv; font-size: 8pt;'";
  309.         <% end if %>        
  310.         writestr += "><FONT FACE='Helv,Arial' SIZE=1>" + str + "</FONT></TD>";
  311.  
  312.         return writestr;    
  313. }    
  314.  
  315. function writeLine(str){
  316.     document.write(str);
  317. }
  318. </SCRIPT>
  319.  
  320. <P> 
  321. <P> 
  322. </FORM>
  323. <SCRIPT LANGUAGE="JavaScript">
  324.     if (editOK){
  325.         document.listform.editMe.focus();
  326.         document.listform.editMe.select();
  327.     }
  328. </SCRIPT>
  329. </BODY>
  330. </HTML>
  331.  
  332.