home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2002 March / PCWMAR02.iso / software / windowsxp / ftgateoffice / ftgateoffice.exe / Main / proxyhttp.fts < prev    next >
Encoding:
Text File  |  2001-11-29  |  10.8 KB  |  372 lines

  1. <%
  2. #include </utility/security.fts>
  3. #include </utility/global.fts>
  4. #include </utility/theme.fts>
  5. #include </utility/ftgate.fts>
  6.  
  7. var h = new server.httpproxy
  8. var id
  9.  
  10. session.system.error=0
  11.  
  12. if (form.config=="1")
  13. {
  14.     h.id = form.id
  15.     id = form.id
  16.  
  17.     if (form.command=="1")
  18.     {
  19.         h.bindaddr = form.bindaddr
  20.         h.bindport = form.bindport
  21.         h.timeout = form.timeout
  22.         h.logaccess = (form.logaccess=="on")
  23.         h.cachesize = form.cachesize
  24.     }
  25.     else if (form.command=="2")
  26.     {
  27.         h.flush();
  28.     }
  29.  
  30.     if (form.redirect!="")
  31.         output.redirect(form.redirect+"?id="+id+"&type=5")
  32. }
  33. else if (form.config=="2")
  34. {
  35.     if (form.redirect!="")
  36.         output.redirect(form.redirect+"?id="+form.id+"&type=5")
  37. }
  38. else
  39. {
  40.     h.id = request.id
  41.     id = request.id
  42. }
  43. %>
  44. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
  45. <HTML>
  46. <HEAD>
  47. <LINK REL=STYLESHEET HREF="/utility/main<%=nn4%>.css" TYPE="text/css">
  48. <META name="GENERATOR" content="Microsoft Developer Studio">
  49. <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  50. <TITLE>Services -- HTTP Proxy General</TITLE>
  51.  
  52. <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
  53. <!--
  54. var dir="<%=buttons%>";
  55. var pro=<%=build()==FTGATE_PRO%>;
  56.  
  57. if (!document.images) {}
  58. else {
  59.     plus0 = new Image();
  60.     plus0.src  = dir+"open.gif";
  61.     plus1 = new Image();
  62.     plus1.src = dir+"openon.gif";
  63.     minus0 = new Image();
  64.     minus0.src  = dir+"close.gif";
  65.     minus1 = new Image();
  66.     minus1.src = dir+"closeon.gif";
  67.     flush0 = new Image();
  68.     flush0.src  = dir+"flush.gif";
  69.     flush1 = new Image();
  70.     flush1.src = dir+"flushon.gif";
  71. }
  72.  
  73. <%
  74. if (netscape)
  75. {
  76.     %>
  77.     document.captureEvents(Event.KEYPRESS);
  78.     document.onkeypress = keypress;
  79.  
  80.     function keypress(event)
  81.     {
  82.         if (event.which==13)
  83.         {
  84.             onApply();
  85.             return false;
  86.         }
  87.  
  88.         return true;
  89.     }
  90.     <%
  91. }
  92. else
  93. {
  94.     %>
  95.     function keypress()
  96.     {
  97.         if (event.keyCode==13)
  98.         {
  99.             event.returnValue=null;
  100.             onApply();
  101.         }
  102.     }
  103.     <%
  104. }
  105. %>
  106.  
  107. function onLoad()
  108. {
  109.     setPage(5, "HTTP Proxy Service");
  110.  
  111.     document.ftgate.timeout.value = toNicePeriod(<%=h.timeout%>);
  112.     document.ftgate.cachesize.value = toNiceBytes(<%=h.cachesize%>);
  113.  
  114.     document.ftgate.bindaddr.focus();
  115. }
  116.  
  117. function isOK(form)
  118. {
  119.     if (!isPort(form.bindport.value))
  120.     {
  121.         alert(errPort);
  122.         form.bindport.focus();
  123.         return false;
  124.     }
  125.  
  126.     if (!isPeriod(form.timeout.value))
  127.     {
  128.         alert(errPeriod);
  129.         form.timeout.focus()
  130.         return false;
  131.     }
  132.  
  133.     if (!isBytes(form.cachesize.value))
  134.     {
  135.         alert(errBytes);
  136.         form.cachesize.focus();
  137.         return false;
  138.     }
  139.  
  140.     document.ftgate.timeout.value = fromNicePeriod(document.ftgate.timeout.value);
  141.     document.ftgate.cachesize.value = fromNiceBytes(document.ftgate.cachesize.value);
  142.     return true;
  143. }
  144.  
  145. function onUpEdit(el, name, type)
  146. {
  147.     change(name, 'plus', 0);
  148.  
  149.     switch (type)
  150.     {
  151.         case 1:
  152.             onUpPeriod(el);
  153.             break;
  154.  
  155.         case 2:
  156.             onUp(el);
  157.             break;
  158.  
  159.         case 3:
  160.             onUpBytes(el);
  161.     }
  162.  
  163.     setModified(true);
  164. }
  165.  
  166. function onDownEdit(el, name, type)
  167. {
  168.     change(name, 'minus', 0);
  169.  
  170.     switch (type)
  171.     {
  172.         case 1:
  173.             onDownPeriod(el);
  174.             break;
  175.  
  176.         case 2:
  177.             onDown(el);
  178.             break;
  179.  
  180.         case 3:
  181.             onDownBytes(el);
  182.     }
  183.  
  184.     setModified(true);
  185. }
  186.  
  187. function onFlush()
  188. {
  189.     change('flushA', 'flush', 0);
  190.     document.ftgate.command.value="2";
  191.     document.ftgate.submit();
  192. }
  193. //-->
  194. </SCRIPT>
  195. <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/cookies.js" TYPE="text/javascript"></SCRIPT>
  196. <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/core.js" TYPE="text/javascript"></SCRIPT>
  197. <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/time.js" TYPE="text/javascript"></SCRIPT>
  198. <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/spin.js" TYPE="text/javascript"></SCRIPT>
  199. <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/dialog.js" TYPE="text/javascript"></SCRIPT>
  200. </HEAD>
  201.  
  202. <BODY BGCOLOR="white" onLoad="onLoad()" MARGINHEIGHT="0" MARGINWIDTH="0" onkeypress="keypress()">
  203.  
  204. <TABLE BORDER="0" BGCOLOR="<%=border%>" WIDTH="<%=bodywidth%>" HEIGHT="<%=bodyheight%>" CELLPADDING="0" CELLSPACING="0"><TR><TD> </TD><TD VALIGN="TOP">
  205.  
  206. <A HREF="index.fts"><SPAN ID="top">Services</SPAN></A><SPAN ID="top"> /</SPAN>
  207. <SPAN ID="topsel"><%=h.name%></SPAN>
  208.  
  209. <FORM NAME="ftgate" METHOD="POST" onSubmit="return isOK(this)" ACTION="proxyhttp.fts">
  210. <!-- hidden variables -->
  211. <INPUT TYPE="HIDDEN" NAME="config" VALUE="1">
  212. <INPUT TYPE="HIDDEN" NAME="command" VALUE="1">
  213. <INPUT TYPE="HIDDEN" NAME="id" VALUE="<%=id%>">
  214. <INPUT TYPE="HIDDEN" NAME="redirect" VALUE="">
  215.  
  216. <!-- start of the tabs -->
  217. <TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0">
  218.   <TR>
  219.         <TD WIDTH="5" HEIGHT="18"><IMG SRC="/images/left-s.gif" VSPACE="0" BORDER="0" WIDTH="5" HEIGHT="18"></TD>
  220.         <TD CLASS="navon" WIDTH="50" HEIGHT="18" ALIGN="CENTER"><A HREF="javascript:onLaunch('proxyhttp.fts')" CLASS="navon">General</A></TD>
  221.         <TD BGCOLOR="black" WIDTH="1" HEIGHT="18" ALIGN="CENTER"><IMG SRC="/images/1pixel.gif" WIDTH="1" HEIGHT="18"></TD>
  222.         <TD CLASS="navoff" WIDTH="75" HEIGHT="18" ALIGN="CENTER"><A HREF="javascript:onLaunch('typeshttp.fts')" CLASS="navoff">Files Types</A></TD>
  223.         <TD BGCOLOR="black" WIDTH="1" HEIGHT="18" ALIGN="CENTER"><IMG SRC="/images/1pixel.gif" WIDTH="1" HEIGHT="18"></TD>
  224.         <TD CLASS="navoff" WIDTH="55" HEIGHT="18" ALIGN="CENTER"><A HREF="javascript:onLaunch('times.fts')" CLASS="navoff">Times</A></TD>
  225.         <TD BGCOLOR="black" WIDTH="1" HEIGHT="18" ALIGN="CENTER"><IMG SRC="/images/1pixel.gif" WIDTH="1" HEIGHT="18"></TD>
  226.         <TD CLASS="navoff" WIDTH="50" HEIGHT="18"ALIGN="CENTER"><A HREF="javascript:onLaunch('addressproxy.fts')" CLASS="navoff">Addresses</A></TD>
  227.         <TD WIDTH="5" HEIGHT="18"><IMG SRC="/images/right.gif" VSPACE="0" BORDER="0" WIDTH="5" HEIGHT="18"></TD>
  228.         <TD WIDTH="<%=bodywidth-243%>" HEIGHT="18"> </TD>
  229.   </TR>
  230. </TABLE>
  231. <!-- end of the tabs -->
  232.  
  233. <!-- start of the tab body -->
  234. <TABLE BORDER="0" BGCOLOR="<%=border%>" WIDTH="100%" CELLPADDING="0" CELLSPACING="0"><TR><TD>
  235. <TABLE <%=table%> CELLPADDING="0" CELLSPACING="0">
  236. <!-- start of block -->
  237. <TR>
  238. <TD VALIGN="TOP">
  239.     <TABLE BORDER="0" WIDTH="100%">
  240.         <!-- sub table goes here -->
  241.         <TR>
  242.             <TD>
  243.             <TABLE CLASS="box" WIDTH="100%">
  244.                     <TR>
  245.                         <TD>
  246.                             <TABLE BORDER="0" WIDTH="100%">
  247.                                 <TR>
  248.                                     <TD>Address</TD>
  249.                                     <TD>
  250.                                         <SELECT NAME="bindaddr">
  251.                                         <%
  252.                                             output.write("<OPTION VALUE=\"\" ")
  253.                                             if (h.bindaddr==0)
  254.                                                 output.write("SELECTED")
  255.                                             output.writeln(">Any unbound address</OPTION>")
  256.                                             
  257.                                             var str=h.bindaddrlist
  258.                                             var pos=0
  259.                                             var i=str.indexof(";", pos)
  260.  
  261.                                             while (i!=-1)
  262.                                             {
  263.                                                 var entry = str.slice(pos, i)
  264.  
  265.                                                 output.write("<OPTION VALUE=\""+entry+"\" ")
  266.                                                 if (entry==h.bindaddr)
  267.                                                     output.write("SELECTED")
  268.                                                 output.writeln(">"+entry+"</OPTION>")
  269.  
  270.                                                 pos=i+1
  271.                                                 i=str.indexof(";", pos)
  272.                                             }
  273.                                         %>
  274.                                         </SELECT>
  275.                                     </TD>
  276.                                     <TD>Port</TD>
  277.                                     <TD><INPUT TYPE="TEXT" NAME="bindport" VALUE="<%=h.bindport%>" SIZE="6" onChange="setModified(true)"></TD>
  278.                                 </TR>
  279.                                 <TR>
  280.                                     <TD>Idle timeout</TD>
  281.                                     <TD COLSPAN="3">
  282.                                         <INPUT TYPE="TEXT" NAME="timeout" VALUE="<%=h.timeout%>" SIZE="6" onChange="setModified(true)">
  283.                                         <A HREF="javascript:onUpEdit(document.ftgate.timeout, 'plusA', 1)"
  284.                                         onMouseDown="change('plusA', 'plus', 1)"
  285.                                         onMouseOut="change('plusA', 'plus', 0)"><IMG SRC="<%=buttons%>open.gif" NAME="plusA" BORDER="0" WIDTH="20" HEIGHT="20" ALT="Increment"></A>
  286.                                         <A HREF="javascript:onDownEdit(document.ftgate.timeout, 'minusA', 1)"
  287.                                         onMouseDown="change('minusA', 'minus', 1)"
  288.                                         onMouseOut="change('minusA', 'minus', 0)"><IMG SRC="<%=buttons%>close.gif" NAME="minusA" BORDER="0" WIDTH="20" HEIGHT="20" ALT="Decrement"></A>
  289.                                     </TD>
  290.                                 </TR>
  291.                                 <TR>
  292.                                     <TD COLSPAN="4" NOWRAP>
  293.                                         <INPUT TYPE="CHECKBOX" NAME="logaccess" onClick="setModified(true)"
  294.                                         <% if (h.logaccess) output.write("CHECKED") %>>Create connection log
  295.                                     </TD>
  296.                                 </TR>
  297.                             </TABLE>
  298.                         </TD>
  299.                     </TR>
  300.                 </TABLE>
  301.             </TD>
  302.         </TR>
  303.         <!-- sub table ends here -->
  304.         <!-- sub table goes here -->
  305.         <TR>
  306.             <TD>
  307.                 <TABLE CLASS="box" WIDTH="100%">
  308.                     <TR>
  309.                         <TD>
  310.                             <TABLE BORDER="0" WIDTH="100%">
  311.                                 <TR>
  312.                                     <TD>Total cache size</TD>
  313.                                     <TD>
  314.                                         <INPUT TYPE="TEXT" NAME="cachesize" VALUE="<%=h.cachesize%>" SIZE="6" onChange="setModified(true)">
  315.                                         <A HREF="javascript:onUpEdit(document.ftgate.cachesize, 'plusB', 3)"
  316.                                         onMouseDown="change('plusB', 'plus', 1)"
  317.                                         onMouseOut="change('plusB', 'plus', 0)"><IMG SRC="<%=buttons%>open.gif" NAME="plusB" BORDER="0" WIDTH="20" HEIGHT="20" ALT="Increment"></A>
  318.                                         <A HREF="javascript:onDownEdit(document.ftgate.cachesize, 'minusB', 3)"
  319.                                         onMouseDown="change('minusB', 'minus', 1)"
  320.                                         onMouseOut="change('minusB', 'minus', 0)"><IMG SRC="<%=buttons%>close.gif" NAME="minusB" BORDER="0" WIDTH="20" HEIGHT="20" ALT="Decrement"></A>
  321.                                     </TD>
  322.                                     <TD>
  323.                                         <A HREF="javascript:onFlush()"
  324.                                         onMouseDown="change('flushA', 'flush', 1)"
  325.                                         onMouseOut="change('flushA', 'flush', 0)"><IMG SRC="<%=buttons%>flush.gif" NAME="flushA" BORDER="0" WIDTH="75" HEIGHT="20" ALT="Delete Files in Cache"></A>
  326.                                     </TD>
  327.                                 </TR>
  328.                             </TABLE>
  329.                         </TD>
  330.                     </TR>
  331.                 </TABLE>
  332.             </TD>
  333.         </TR>
  334.         <!-- sub table ends here -->
  335.         <!-- table footer goes here -->
  336.         <TR>
  337.             <TD ALIGN="RIGHT">
  338.                 <A HREF="javascript:onClose()"
  339.                 onMouseDown="change('closeA', 'ok', 1)"
  340.                 onMouseOut="change('closeA', 'ok', 0)"><IMG SRC="<%=buttons%>ok.gif" NAME="closeA" BORDER="0" WIDTH="50" HEIGHT="20" ALT="Apply changes and close" HSPACE="5"></A>
  341.                 <A HREF="javascript:onCancel()"
  342.                 onMouseDown="change('cancelA', 'cancel', 1)"
  343.                 onMouseOut="change('cancelA', 'cancel', 0)"><IMG SRC="<%=buttons%>cancel.gif" NAME="cancelA" BORDER="0" WIDTH="50" HEIGHT="20" ALT="Cancel"></A>
  344.                 <A HREF="javascript:onApply()"
  345.                 onMouseDown="change('applyA', 'apply', 1)"
  346.                 onMouseOut="change('applyA', 'apply', 0)"><IMG SRC="<%=buttons%>apply.gif" NAME="applyA" BORDER="0" WIDTH="50" HEIGHT="20" ALT="Apply changes" HSPACE="5"></A>
  347.             </TD>
  348.         </TR>
  349.         <!-- table footer ends here -->
  350.   </TABLE>
  351. </TD>
  352. </TR>
  353. <!-- end of block -->
  354.  
  355. </TABLE>
  356. <!-- end of the tab body -->
  357. </TD></TR></TABLE>
  358.  
  359. <!-- footer starts here -->
  360. <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
  361. <!--
  362.     var href="/services/proxyhttp.fts?id=<%=id%>&type=5";
  363.     var bodywidth=<%=bodywidth%>;
  364. //-->
  365. </SCRIPT>
  366. <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/footer.js" TYPE="text/javascript"></SCRIPT>
  367. <!-- footer ends here -->
  368. </FORM>
  369. </TD><TD WIDTH="10"> </TD></TR></TABLE>
  370. </BODY>
  371. </HTML>
  372.