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

  1. <% 
  2.     path = SysInfo.SkinPath
  3.     dim szPath
  4.     szPath = "Table"
  5.     SkinTable = SysInfo.GetSkinParameter(szPath)
  6.     szPath = "Font"
  7.     SkinFont = SysInfo.GetSkinParameter(szPath)
  8.     szPath = "Link"
  9.     SkinLink = SysInfo.GetSkinParameter(szPath)
  10.     szPath = "VLink"
  11.     SkinVLink= SysInfo.GetSkinParameter(szPath)
  12. %>
  13. <script language="JavaScript">
  14. <!--
  15. function MM_preloadImages() { //v3.0
  16.   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  17.     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  18.     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
  19. }
  20.  
  21. function MM_swapImgRestore() { //v3.0
  22.   var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  23. }
  24.  
  25. function MM_findObj(n, d) { //v4.0
  26.   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  27.     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  28.   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  29.   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  30.   if(!x && document.getElementById) x=document.getElementById(n); return x;
  31. }
  32.  
  33. function MM_swapImage() { //v3.0
  34.   var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  35.    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
  36. }
  37. //-->
  38. </script>
  39. <html>
  40. <head>
  41. <title>Professional GateKeeper - Infopulse</title>
  42. <!--              -->
  43. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
  44. <title>MediaFamily - Welcome</title>
  45.  
  46. </head>
  47. <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">
  48.   <tr> 
  49.     <td width="344"><img src="images/1_r1_c2.jpg" width="344" height="70"></td>
  50.     <td width="135"><img src="images/1_r1_c3.jpg" width="135" height="70"></td>
  51.     <td width="100"><a href="hlpProxies.agp"><img src="images/1_r1_c4.jpg" width="100" height="70"border=0></a></td>
  52.     <td width="1000"> </td>
  53.   </tr>
  54. </table>
  55. <map name="n1_r4_c3Map"> 
  56.   <area shape="rect" coords="492,45,567,76" href="#">
  57. </map>
  58.  
  59. <%
  60.     action = Request.ReqParam("action")
  61.     order = Request.ReqParam("ProxyNo")
  62.     Set proxy = Proxies.item( order )
  63.     
  64.     if action = "Cancel" Then
  65.         Response.Redirect("curentproxies.agp")
  66.     end if    
  67.  
  68.  
  69.     if action = "Commit" Then
  70.         ' Process the new settings
  71.  
  72.         strProps = proxy.GetPropertyNames
  73.         tmpProps = strProps
  74.         While Len(tmpProps)
  75.  
  76.             pos = InStr(tmpProps,",")
  77.             If pos > 0 Then
  78.                 propName = Left(tmpProps,pos - 1)
  79.                 tmpProps = Mid(tmpProps,pos + 1)
  80.             Else
  81.                 propName = tmpProps
  82.                 tmpProps = ""
  83.             End If
  84.  
  85.             propType = proxy.GetPropertyType(propName)
  86.             if propType = "BOOL" Then
  87.                 propVal = Request.ReqParam(propName)
  88.                 if propVal <> "" then
  89.                     proxy.SetBoolProperty propName,True
  90.                 else
  91.                     proxy.SetBoolProperty propName,False
  92.                 end if
  93.             End if
  94.             if propType = "NUMBER" Then
  95.                 propVal = Request.ReqParam(propName)
  96.                 If Len(propVal) = 0 Then
  97.                     propVal = 0
  98.                 End If
  99.                 proxy.SetNumberProperty propName,propVal
  100.             End If
  101.             if propType = "STRING" Then
  102.                 propVal = Request.ReqParam(propName)
  103.  
  104.                 ' now .. here do the dirty job of creating the list of available options
  105.                 Dim sPropCount
  106.                 sPropCount = Request.ReqParam( propName & "_CheckCount" )
  107.                 if propVal = "" AND sPropCount <> "" Then
  108.                     ' there is no property with this name
  109.                     ' but there might be a list of properties (if the value was a list of strings)
  110.                     ' and we have combos around there
  111.                     Dim i, sValue, sTmpValue
  112.                     i = 0
  113.                     i = CInt(sPropCount)
  114.                     while i > 0
  115.                         sTmpValue = Request.ReqParam( propName & "_" & (i-1) )
  116.                         if sTmpValue <> "" then
  117.                             sValue = sValue & sTmpValue & vbCrLf & "CHECKED" & vbCrLf
  118.                         End If
  119.                         i = i - 2
  120.                     wend
  121.                     propVal = sValue
  122.                 end if
  123.  
  124.                 proxy.SetStringProperty propName,propVal
  125.             End If
  126.             if propType = "PASSWORD" Then
  127.                 propVal = Request.ReqParam(propName)
  128.                 proxy.SetStringProperty propName,propVal
  129.             End If
  130.  
  131.         Wend
  132.  
  133.         On Error Resume Next
  134.         proxy.Commit
  135.         
  136.         If Not Err.Number = 0 Then 
  137.             ErrLine = Err.Description
  138.         else
  139.             Response.Redirect("curentproxies.agp")
  140.         End If
  141.     Else
  142.         if( action = "Delete" ) then
  143.             proxy.Remove
  144.             Response.Redirect("curentproxies.agp")
  145.         End if
  146.     End If
  147. %>
  148. <p><big><strong><font face="Arial">Edit proxy</font></strong></big></p>
  149. <%
  150.     If Not Len(ErrLine) = 0 Then
  151.         Response.Write("<B><FONT COLOR=""#FF0000"">" & ErrLine & "</FONT></B><br>")
  152.     End If
  153. %>
  154. <form method="POST" action= "/proxies/editproxy.agp">
  155.     <input type="hidden" name="ProxyNo" value="<%Response.Write( order )%>" >
  156.     <div align="center"><center>
  157.     <table border="1" cellpadding="0" cellspacing="0" width="100%">
  158.     <tr>
  159.         <td width="50%" bgcolor="<%Response.Write(SkinTable)%>"><strong><font face="Arial" color="<%Response.Write(SkinFont)%>">
  160.             Option
  161.         </font></strong></td>
  162.         <td width="50%" bgcolor="<%Response.Write(SkinTable)%>"><strong><font face="Arial" color="<%Response.Write(SkinFont)%>">
  163.             Value
  164.         </font></strong></td>
  165.     </tr>
  166.     <%
  167.         On Error Resume Next
  168.         strProps = proxy.GetPropertyNames
  169.         tmpProps = strProps
  170.         While Len(tmpProps)
  171.             pos = InStr(tmpProps,",")
  172.             If pos > 0 Then
  173.                 propName = Left(tmpProps,pos - 1)
  174.                 tmpProps = Mid(tmpProps,pos + 1)
  175.             Else
  176.                 propName = tmpProps
  177.                 tmpProps = ""
  178.             End If
  179.  
  180.             propDesc = proxy.GetPropertyDescription(propName)
  181.             If Not Err.Number = 0 Then    ' No property Description found!
  182.                 propDesc = propName
  183.             End If
  184.     %>
  185.     <tr>
  186.         <td><strong><font face="Arial">
  187.             <%Response.Write(propDesc)%>  <font size=1>(<%Response.Write(propName)%>)</font>
  188.         </font></strong></td>
  189.        <td>
  190.             <%
  191.                 propType = proxy.GetPropertyType(propName)
  192.                 if propType = "BOOL" Then
  193.                     if proxy.GetBoolProperty(propName) Then
  194.             %>
  195.                         <input type="checkbox" name="<%Response.Write(propName)%>" checked >
  196.             <%
  197.                     Else
  198.             %>
  199.                         <input type="checkbox" name="<%Response.Write(propName)%>">
  200.             <%
  201.                     End if
  202.                 End if
  203.                 if propType = "NUMBER" Then
  204.                     propVal = proxy.GetNumberProperty(propName)
  205.             %>
  206.                     <input type="text" size="5" maxlength="5" name="<%Response.Write(propName)%>" value="<%Response.Write(propVal)%>">
  207.                     <% 
  208.                         If propName = "Timeout" Then 
  209.                     %>
  210.                         second(s)    
  211.                     <% 
  212.                         End If 
  213.                     %>
  214.             <%
  215.                 End If
  216.                 if propType = "STRING" Then
  217.                     propVal = proxy.GetStringProperty(propName)
  218.                     ' For string properties, see if they do not represent a list of values
  219.                     ' then show a combo list
  220.                     ' Read Default Value
  221.                     propDef = propVal
  222.  
  223.                     bList = FALSE
  224.  
  225.                     Dim myOptionList
  226.  
  227.                     OptionListSize = 0
  228.  
  229.                     if InStr ( propDef, vbCrLf ) Then
  230.                         ReDim myOptionList(30)
  231.                         bList = TRUE    ' Show a list of checkboxes instead of a simple textbox
  232.                         iPos = InStr ( propDef , vbCrLf )
  233.                         while ( iPos > 0 ) 
  234.                             theOption = Left ( propDef, iPos - 1 )
  235.                             propDef = Mid ( propDef, iPos + 2 )
  236.                             iPos = InStr ( propDef , vbCrLf )
  237.                             OptionListSize = OptionListSize + 1
  238.                             myOptionList(OptionListSize) = theOption
  239.  
  240.                             'OptionListSize = OptionListSize + 1
  241.                             'if OptionListSize = 4 Then
  242.                             '    myOptionList(OptionListSize) = "CHECKED"
  243.                             'End If
  244.                         wend
  245.                     End If
  246.             %>
  247.  
  248. <%                
  249.                 If bList Then                    'Show a list of checkboxes
  250. %>
  251.  
  252. <%
  253.                 for i = 1 to OptionListSize
  254. %>
  255.                 <Input Type=CheckBox <%Response.Write(myOptionList(i+1))%> Name="<%Response.Write( propName & "_" & i )%>" VALUE="<%Response.Write( myOptionList(i) )%>"><%Response.Write( myOptionList(i) )%></Input><br>
  256. <%
  257.                 i = i + 1
  258.                 Next
  259. %>
  260.                 <Input Type=Hidden Name="<%Response.Write( propName & "_CheckCount" )%>" Value="<%Response.Write( OptionListSize )%>">
  261.  
  262.  
  263. <%
  264.                 Else                            ' Show a Text box
  265. %>
  266.                     <input    type="text"    size="30" name="<%Response.Write(propName)%>" value="<%Response.Write(propVal)%>">
  267. <%
  268.                 End If                            ' if bList
  269. %>
  270.  
  271.             <%
  272.                 End If
  273.                 if propType = "PASSWORD" Then
  274.                     propVal = proxy.GetStringProperty(propName)
  275.             %>
  276.                     <input type="password" size="30" name="<%Response.Write(propName)%>" value="<%Response.Write(propVal)%>">
  277.             <%
  278.                 End If
  279.             %>
  280.  
  281.        </td>        
  282.     </tr>
  283.     <%
  284.         Wend
  285.     %>
  286.     </td>
  287.     </table>
  288.     </center></div>
  289.     <p><input type="submit" name="action" value="Commit">
  290.     <input type="submit" name="action" value="Cancel"></p>
  291. </form>
  292.  
  293. <font size="1" face="Arial"><%Response.Write(GateKeeper.Version)%></font>
  294.  
  295. </body>
  296. </html>
  297.