home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 August / CHIP_08_2003.iso / Spesial / proxy / ProxPro / ProxyPro.exe / data1.cab / ConfigSite_Files / rules / protocoledit.agp < prev    next >
Encoding:
Text File  |  2002-12-09  |  7.2 KB  |  258 lines

  1. <%
  2.    dim szPath
  3.    szPath = "Table"
  4.    SkinTable = SysInfo.GetSkinParameter(szPath)
  5.    szPath = "Font"
  6.    SkinFont = SysInfo.GetSkinParameter(szPath)
  7.     
  8.    On Error Resume Next
  9.    nou = False
  10.    ruleName = Request.ReqParam("rule")
  11.    Set rule = Rules.item(ruleName)
  12.    protName = Request.ReqParam("protocol")
  13.    
  14.    if Request.ReqParam("action") = "Cancel" Then
  15.         Response.Redirect( "/rules/rule.agp?rule="+ ruleName)
  16.    end if
  17.  
  18.    if protName = "" then
  19.     nou = True
  20.    else
  21.     action = Request.ReqParam("action")
  22.     if action = "Commit" then
  23.         nou = Request.ReqParam("nou")
  24.         if nou then
  25.             rule.AddProtocol(protName)
  26.             rule.Commit
  27.             Response.Redirect( "/rules/protocoledit.agp?rule=" & ruleName & "&protocol=" & protName )
  28.         end if
  29.         chkBoxes = Request.ReqParam("cb")
  30.         for i = 1 to 7
  31.             for j = 0 to 23
  32.                 rule.SetPermission protName, i, j, True
  33.             next
  34.         next
  35.         if( chkBoxes <> ""  ) then
  36.             while ( chkBoxes <> "" )
  37.                 aBox = Mid(chkBoxes,1,3)
  38.                 chkBoxes = Mid(chkBoxes,5)
  39.                 sI = Mid(aBox,1,1)
  40.                 sJ = Mid(aBox,2,2)
  41.                 rule.SetPermission protName, sI, sJ, False
  42.             wend
  43.             rule.Commit
  44.             Response.Redirect( "/rules/rule.agp?rule=" & ruleName )
  45.         else
  46.             if Not nou then  
  47.                 action = "Remove"
  48.             end if
  49.         end if
  50.     end if
  51.     if action = "Remove" then
  52.         rule.DelProtocol(protName)
  53.         rule.Commit
  54.         Response.Redirect( "/rules/rule.agp?rule=" & ruleName )
  55.     end if
  56.    end if
  57. %>
  58. <script language="JavaScript">
  59. <!--
  60. function MM_preloadImages() { //v3.0
  61.   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  62.     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  63.     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
  64. }
  65.  
  66. function MM_swapImgRestore() { //v3.0
  67.   var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  68. }
  69.  
  70. function MM_findObj(n, d) { //v4.0
  71.   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  72.     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  73.   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  74.   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  75.   if(!x && document.getElementById) x=document.getElementById(n); return x;
  76. }
  77.  
  78. function MM_swapImage() { //v3.0
  79.   var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  80.    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
  81. }
  82. //-->
  83. </script>
  84. <html>
  85. <head>
  86. <title>Professional GateKeeper - Infopulse</title>
  87. <!--              -->
  88. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
  89. <title>MediaFamily - Welcome</title>
  90.  
  91. </head>
  92. <body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" background="../images/backgr_x.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  93.   <tr> 
  94.     <td width="344"><img src="images/1_r1_c2.jpg" width="344" height="70"></td>
  95.     <td width="135"><img src="images/1_r1_c3.jpg" width="135" height="70"></td>
  96.     <td width="100"><a href="hlpRules.agp"><img src="images/1_r1_c4.jpg" width="100" height="70"border=0></a></td>
  97.     <td width="1000"> </td>
  98.   </tr>
  99. </table>
  100. <map name="n1_r4_c3Map"> 
  101.   <area shape="rect" coords="492,45,567,76" href="#">
  102. </map>
  103. <%
  104.    if nou then
  105. %>
  106.     <p><big><strong><font face="Arial">Select the protocol you want to add the rule for</font></strong></big></p>
  107. <%
  108.    else
  109. %>
  110.     <p><big><strong><font face="Arial">Edit <%Response.Write(protName)%> protocol time schedule for <%Response.Write(ruleName)%></font></strong></big></p>
  111.     <font face="Arial">
  112.         <strong>Note:</strong>0 means hour 0.00.00 - 0.59.59, checked means DENIED
  113.     </font>
  114. <%
  115.    end if
  116.    if Not Err.Number = 0 Then
  117.     Response.Write("<B><FONT COLOR=""#FF0000"">" & Err.Description & ": " & ruleName & "</FONT></B><br>")
  118.    end if
  119. %>
  120.  
  121. <form method="POST" action= "/rules/protocoledit.agp?rule=<%Response.Write(ruleName)%>">
  122.  
  123. <%
  124.    if nou then
  125. %>
  126.     
  127.     <div>
  128.     <table border="1" cellpadding="0" cellspacing="0" width="60%">
  129.         <tr>
  130.             <td width="20%" bgcolor="<%Response.Write(SkinTable)%>"><strong><font face="Arial" color="<%Response.Write(SkinFont)%>">
  131.                 Option
  132.             </font></strong></td>
  133.             <td width="40%" bgcolor="<%Response.Write(SkinTable)%>"><strong><font face="Arial" color="<%Response.Write(SkinFont)%>">
  134.                 Value
  135.             </font></strong></td>
  136.         <tr>
  137.         <tr>
  138.             <td width="50%"><strong><font face="Arial">
  139.                 Protocol
  140.             </font></strong></td>
  141.             <td width="50%">
  142.                 <select name="protocol" size="1">
  143. <%
  144.                     Set proxy = Proxies.NewProxy
  145.                     proxy.GetFirstDLL sFile, sType, sVersion, sName
  146.                     
  147.                     if sFile <> "" then
  148.                         Response.Write("<option value=All>All Protocols</option>")
  149.                         bExist = True
  150.                     else
  151.                         bExist = False
  152.                     end if
  153.                     
  154.                     Response.Write("<option value=""" & sType & """>" & sType & "</option>")
  155.  
  156.                     proxy.GetNextDLL sFile, sType, sVersion, sName
  157.                     while Len(sFile)
  158.                         Response.Write("<option value=""" & sType & """>" & sType & "</option>")
  159.                            proxy.GetNextDLL sFile, sType, sVersion, sName
  160.                     wend
  161.  
  162.                     if bExist then
  163.                         Response.Write("<option value=Schedule>Schedule</option>")
  164.                     end if
  165. %>
  166.                 </select>
  167.             </td>
  168.            </tr>
  169.     </table></div>
  170. <%
  171.    else
  172. ' procedure for checking rights
  173. Sub IsChecked( nume, zi, ora )
  174.     if(rule.GetPermission( nume, zi, ora ) = False ) then
  175.         Response.Write(" checked")
  176.     end if
  177. end sub
  178. %>
  179.  
  180.     <input type="hidden" name="protocol" value="<%Response.Write(protName)%>"></td>
  181.  
  182.     <div align="center"><center>
  183.     <table border="1" cellpadding="0" cellspacing="0" width="100%">
  184.         <tr>
  185.             <td bgcolor="<%Response.Write(SkinTable)%>"><strong><font face="Arial" color="<%Response.Write(SkinFont)%>">
  186.                  
  187.             </font></strong></td>
  188.             <%
  189.                 for i = 0 to 23
  190.             %>
  191.             <td bgcolor="<%Response.Write(SkinTable)%>" align="center"><strong><font face="Arial" color="<%Response.Write(SkinFont)%>">
  192.                 <%Response.Write(i)%>
  193.             </font></strong></td>
  194.             <%
  195.                 next
  196.             %>
  197.            </tr>
  198. <%
  199.     Sub WriteDay( nr )
  200.         Select case nr
  201.             Case 1
  202.                 Response.Write("Sunday")
  203.             Case 2
  204.                 Response.Write("Monday")
  205.             Case 3
  206.                 Response.Write("Tuesday")
  207.             Case 4
  208.                 Response.Write("Wednesday")
  209.             Case 5
  210.                 Response.Write("Thursday")
  211.             Case 6
  212.                 Response.Write("Friday")
  213.             Case 7
  214.                 Response.Write("Saturday")
  215.         End Select
  216.     End Sub
  217. %>
  218.         <%
  219.             for i = 1 to 7
  220.         %> 
  221.             <tr>
  222.                 <td><strong><font face="Arial">
  223.                     <%WriteDay(i)%>
  224.                 </font></strong></td>
  225.                 <%
  226.                     for j = 0 to 23
  227.                 %>
  228.                 <td width="50">
  229.                     <input type="checkbox" name="cb" value="<%Response.Write(i*100+j)%>" <% IsChecked protName,i,j %>>
  230.                 </td>
  231.                 <%
  232.                     next
  233.                 %>
  234.                </tr>
  235.         <%
  236.            next
  237.         %>
  238.     </table></center></div>
  239. <%
  240.    end if
  241. %>
  242. <br>
  243.     <input type="hidden" name="nou" value="<%Response.Write(nou)%>"></td>
  244.     <input type="submit" name="action" value="Commit">
  245.     <input type="submit" name="action" value="Cancel">
  246.  
  247. <%
  248.    if Not nou then
  249. %>
  250.     <input type="submit" name="action" value="Remove">
  251. <%
  252.    end if
  253. %>
  254. </form>
  255. <font size="1" face="Arial"><%Response.Write(GateKeeper.Version)%></font>
  256. </body>
  257. </html>
  258.