home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 August / CHIP_08_2003.iso / Spesial / proxy / ProxPro / ProxyPro.exe / data1.cab / ConfigSite_Files / proxies / addproxy.agp next >
Encoding:
Text File  |  2002-12-09  |  9.4 KB  |  328 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.     If Request.ReqParam("action") = "Cancel" Then 
  61.         Response.Redirect("curentproxies.agp")
  62.     End If
  63.     sFile = Request.ReqParam("file")
  64.     Set proxy = Proxies.NewProxy
  65.     proxy.FileName = sFile
  66.  
  67.     if Request.ReqParam("action") = "Commit" Then
  68.         ' Process the proxy settings
  69.         strProps = proxy.GetPropertyNames
  70.         tmpProps = strProps
  71.         While Len(tmpProps)
  72.             pos = InStr(tmpProps,",")
  73.             If pos > 0 Then
  74.                 propName = Left(tmpProps,pos - 1)
  75.                 tmpProps = Mid(tmpProps,pos + 1)
  76.             Else
  77.                 propName = tmpProps
  78.                 tmpProps = ""
  79.             End If
  80.                 
  81.             propType = proxy.GetPropertyType(propName)
  82.             if propType = "BOOL" Then
  83.                 propVal = Request.ReqParam(propName)
  84.                 if propVal <> "" then
  85.                     proxy.SetBoolProperty propName,True
  86.                 else
  87.                     proxy.SetBoolProperty propName,False
  88.                 end if
  89.             End if
  90.             if propType = "NUMBER" Then
  91.                 propVal = Request.ReqParam(propName)
  92.                 If Len(propVal) = 0 Then
  93.                     propVal = 0
  94.                 End If
  95.                 proxy.SetNumberProperty propName,propVal
  96.             End If
  97.             if propType = "STRING" Then
  98.                 propVal = Request.ReqParam(propName)
  99.  
  100.                 ' now .. here do the dirty job of creating the list of available options
  101.                 Dim sPropCount
  102.                 sPropCount = Request.ReqParam( propName & "_CheckCount" )
  103.                 if propVal = "" AND sPropCount <> "" Then
  104.                     ' there is no property with this name
  105.                     ' but there might be a list of properties (if the value was a list of strings)
  106.                     ' and we have combos around there
  107.                     Dim i, sValue, sTmpValue
  108.                     i = 0
  109.                     i = CInt(sPropCount)
  110.                     while i > 0
  111.                         sTmpValue = Request.ReqParam( propName & "_" & (i-1) )
  112.                         if sTmpValue <> "" then
  113.                             sValue = sValue & sTmpValue & vbCrLf & "CHECKED" & vbCrLf
  114.                         End If
  115.                         i = i - 2
  116.                     wend
  117.                     propVal = sValue
  118.                 end if
  119.  
  120.                 proxy.SetStringProperty propName,propVal
  121.             End If
  122.             if propType = "PASSWORD" Then
  123.                 propVal = Request.ReqParam(propName)
  124.                 proxy.SetStringProperty propName,propVal
  125.             End If
  126.         Wend
  127.     
  128.         On Error Resume Next
  129.         proxy.Commit
  130.         If Not Err.Number = 0 Then 
  131.             ErrLine = Err.Description
  132.         else
  133.             Response.Redirect("curentproxies.agp")
  134.         End If
  135.     End If
  136.  
  137.     sType = Request.ReqParam("type")
  138. %>
  139. <p><big><strong><font face="Arial">Add a new <%Response.Write(sType)%> proxy</font></strong></big></p>
  140. <%
  141.     If Not Len(ErrLine) = 0 Then
  142.         Response.Write("<B><FONT COLOR=""#FF0000"">" & ErrLine & "</FONT></B><br>")
  143.     End If
  144. %>
  145.  
  146. <form method="POST" action= "/proxies/addproxy.agp">
  147.     <input type="hidden" name="file" value="<%Response.Write(sFile)%>">
  148.     
  149.     <div align="center"><center>
  150.     <table border="1" cellpadding="0" cellspacing="0" width="100%">
  151.     <tr>
  152.         <td width="50%" bgcolor="<%Response.Write(SkinTable)%>"><strong><font face="Arial" color="<%Response.Write(SkinFont)%>">
  153.             Option
  154.         </font></strong></td>
  155.         <td width="50%" bgcolor="<%Response.Write(SkinTable)%>"><strong><font face="Arial" color="<%Response.Write(SkinFont)%>">
  156.             Value
  157.         </font></strong></td>
  158.     </tr>
  159.     <%
  160.         strProps = proxy.GetPropertyNames
  161.         tmpProps = strProps
  162.         While Len(tmpProps)
  163.             pos = InStr(tmpProps,",")
  164.             If pos > 0 Then
  165.                 propName = Left(tmpProps,pos - 1)
  166.                 tmpProps = Mid(tmpProps,pos + 1)
  167.             Else
  168.                 propName = tmpProps
  169.                 tmpProps = ""
  170.             End If
  171.             propDesc = proxy.GetPropertyDescription(propName)
  172.             If Not Err.Number = 0 Then    ' No property Description found!
  173.                 propDesc = propName
  174.             End If
  175.     %>
  176.     <tr>
  177.         <td><strong><font face="Arial">
  178.             <%Response.Write(propDesc)%>  <font size=1>(<%Response.Write(propName)%>)</font>
  179.         </font></strong></td>
  180.         <td>
  181.             <%
  182.                 propType = proxy.GetPropertyType(propName)
  183.                 if propType = "BOOL" Then
  184.             %>
  185.                         <input    type="checkbox"
  186.                                 name="<%Response.Write(propName)%>"
  187.                             <%
  188.                                 If Not Len(ErrLine) = 0 Then
  189.                                     if Request.ReqParam(propName) <> "" Then
  190.                                         Response.Write("checked")
  191.                                     End If
  192.                                 Else    ' Show Defaults
  193.                                     If proxy.GetDefaultBoolProperty ( propName ) Then
  194.                                         Response.Write("checked")
  195.                                     End If
  196.                                 End If
  197.                             %>
  198.                         >
  199.             <%
  200.                 End if
  201.                 if propType = "NUMBER" Then
  202.             %>
  203.                     <input    type="text"
  204.                             size="5"
  205.                             maxlength="5"
  206.                             name="<%Response.Write(propName)%>"
  207.                         <%
  208.                             If Not Len(ErrLine) = 0 Then
  209.                                 Response.Write("Value=""" & Request.ReqParam(propName) & """")
  210.                             Else
  211.                                 ' Show Default Value
  212.                                 propDef = ""
  213.                                 propDef = proxy.GetDefaultNumberProperty( propName )
  214.                                 If propDef <> -1 Then
  215.                                     Response.Write("Value=""" & propDef & """")
  216.                                 End If
  217.                             End If
  218.                         %>
  219.                     >     
  220.                     <% 
  221.                         If propName = "Timeout" Then 
  222.                     %>
  223.                         second(s)    
  224.                     <% 
  225.                         End If 
  226.                     %>
  227.             <%
  228.                 End If
  229.                 if propType = "STRING" Then
  230.  
  231.                 ' For string properties, see if they do not represent a list of values
  232.                 ' then show a combo list
  233.                 ' Read Default Value
  234.                 propDef = ""
  235.                 propDef = proxy.GetDefaultStringProperty( propName )
  236.  
  237.                 bList = FALSE
  238.  
  239.                 Dim myOptionList
  240.  
  241.                 OptionListSize = 0
  242.  
  243.                     if InStr ( propDef, vbCrLf ) Then
  244.                         ReDim myOptionList(30)
  245.                         bList = TRUE    ' Show a list of checkboxes instead of a simple textbox
  246.                         iPos = InStr ( propDef , vbCrLf )
  247.                         while ( iPos > 0 ) 
  248.                             theOption = Left ( propDef, iPos - 1 )
  249.                             propDef = Mid ( propDef, iPos + 2 )
  250.                             iPos = InStr ( propDef , vbCrLf )
  251.                             OptionListSize = OptionListSize + 1
  252.                             myOptionList(OptionListSize) = theOption
  253.  
  254.                             'OptionListSize = OptionListSize + 1
  255.                             'if OptionListSize = 4 Then
  256.                             '    myOptionList(OptionListSize) = "CHECKED"
  257.                             'End If
  258.                         wend
  259.                     End If
  260.             %>
  261.  
  262. <%                
  263.                 If bList Then                    'Show a combo box
  264. %>
  265.  
  266. <%
  267.                 for i = 1 to OptionListSize
  268. %>
  269.                 <Input Type=CheckBox <%Response.Write(myOptionList(i+1))%> Name="<%Response.Write( propName & "_" & i )%>" VALUE="<%Response.Write( myOptionList(i) )%>"><%Response.Write( myOptionList(i) )%></Input><br>
  270. <%
  271.                 i = i + 1
  272.                 Next
  273. %>
  274.                 <Input Type=Hidden Name="<%Response.Write( propName & "_CheckCount" )%>" Value="<%Response.Write( OptionListSize )%>">
  275.  
  276. <%
  277.                 Else                            ' Show a Text box
  278. %>
  279.                     <input    type="text"
  280.                             size="30"
  281.                             name="<%Response.Write(propName)%>"
  282.                         <%
  283.                             If propName = "Separator" Then
  284.                                 Response.Write("Value=""#""")
  285.                             End If
  286.                             If Not Len(ErrLine) = 0 Then
  287.                                 Response.Write("Value=""" & Request.ReqParam(propName) & """")
  288.                             Else
  289.                                 Response.Write("Value=""" & propDef & """")
  290.                             End If
  291.                         %>
  292.                     >
  293. <%
  294.                 End If                            ' if bList
  295. %>
  296.  
  297.             <%
  298.                 End If
  299.                 if propType = "PASSWORD" Then
  300.             %>
  301.                     <input    type="password"
  302.                             size="30"
  303.                             name="<%Response.Write(propName)%>"
  304.                         <%
  305.                             If Not Len(ErrLine) = 0 OR ShowDefaults Then
  306.                                 Response.Write("Value=""" & Request.ReqParam(propName) & """")
  307.                             End If
  308.                         %>
  309.                     >
  310.             <%
  311.                 End If
  312.             %>
  313.  
  314.         </td>        
  315.     </tr>
  316.     <%
  317.         Wend
  318.     %>
  319.     </table>
  320.     </center></div>
  321.     <p><input type="submit" name="action" value="Commit"><input type="submit" name="action" value="Cancel"></p>
  322. </form>
  323.  
  324. <font size="1" face="Arial"><%Response.Write(GateKeeper.Version)%></font>
  325.  
  326. </body>
  327. </html>
  328.