home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 August / CHIP_08_2003.iso / Spesial / proxy / ProxPro / ProxyPro.exe / data1.cab / ConfigSite_Files / accounts / groupedit.agp < prev    next >
Encoding:
Text File  |  2002-12-09  |  7.7 KB  |  260 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">
  48. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  49.   <tr> 
  50.     <td width="344"><img src="images/1_r1_c2.jpg" width="344" height="70"></td>
  51.     <td width="135"><img src="images/1_r1_c3.jpg" width="135" height="70"></td>
  52.     <td width="100"><a href="hlpAccounts.agp"><img src="images/1_r1_c4.jpg" width="100" height="70"border=0></a></td>
  53.     <td width="1000"> </td>
  54.   </tr>
  55. </table>
  56. <map name="n1_r4_c3Map"> 
  57.   <area shape="rect" coords="492,45,567,76" href="#">
  58. </map>
  59.  
  60.  
  61. <%
  62.     Set groups        = Accounts.groups
  63. %>
  64. <%
  65.     If Request.ReqParam("action") = "Cancel" Then 
  66.             Response.Redirect("groups.agp")
  67.     End If
  68.     If Request.ReqParam("name") = "" Then
  69.         Set group = Accounts.Groups.NewGroup
  70.         NewGroup = TRUE
  71.     Else
  72.         If Request.ReqParam("newgroup") = "True" Then
  73.             Set group = Accounts.Groups.NewGroup
  74.             group.Name = Request.ReqParam("name")
  75.             NewGroup = TRUE
  76.         Else
  77.             Set group = Accounts.Groups.item(Request.ReqParam("name"))
  78.             NewGroup = FALSE
  79.         End If
  80.     End If
  81.  
  82.     If Request.ReqParam("action") = "Remove" AND Not NewGroup = TRUE Then
  83.         On Error Resume Next
  84.         group.Remove
  85.         If Not Err.Number = 0 Then 
  86.             ErrLine = Err.Description
  87.         Else
  88.             Response.Redirect("groups.agp")
  89.         End If
  90.     ElseIf Request.ReqParam("action") = "Commit" Then
  91.         ' Process the group account
  92.         group.Description = Request.ReqParam("description")
  93.  
  94.         ' Process the user list
  95.         Dim userlist()
  96.         userline = Request.ReqParam("users")
  97.         userlistidx = 1
  98.         While Len(userline)
  99.             pos = InStr(userline,",")
  100.             If pos > 0 Then
  101.                 useritem = Left(userline,pos - 1)
  102.                 userline = Mid(userline,pos + 1)
  103.             Else
  104.                 useritem = userline
  105.                 userline = ""
  106.             End If
  107.             ReDim Preserve userlist(userlistidx+1)
  108.             userlist(userlistidx) = useritem
  109.             userlistidx = userlistidx + 1
  110.         Wend
  111.  
  112.         Set users = Accounts.Users
  113.         For usercnt = 1 to users.count
  114.             Set user = Accounts.Users.Item(usercnt)
  115.  
  116.             bIsMemberOfThisGroup = FALSE
  117.             For listcnt = 1 to userlistidx-1
  118.                 If userlist(listcnt) = user.name Then
  119.                     bIsMemberOfThisGroup = TRUE
  120.                 End If
  121.             Next
  122.  
  123.             If group.IsMember(user.name) AND Not bIsMemberOfThisGroup = TRUE Then
  124.                 group.DelMember(user.name)
  125.             ElseIf Not group.IsMember(user.name) AND bIsMemberOfThisGroup = TRUE Then
  126.                 group.AddMember(user.name)
  127.             End If
  128.  
  129.         Next
  130.  
  131.         On Error Resume Next
  132.         group.Commit
  133.         If Not Err.Number = 0 Then 
  134.             ErrLine = Err.Description
  135.         Else
  136.             Response.Redirect("groups.agp")
  137.         End If
  138.     End If
  139.  
  140.     If Not NewGroup Then
  141. %>
  142.     <p><big><strong><font face="Arial">
  143.         Edit group account
  144.     </font></strong></big></p>
  145. <%
  146.     Else
  147. %>
  148.     <p><big><strong><font face="Arial">
  149.         Add new group account
  150.     </font></strong></big></p>
  151. <%
  152.     End If
  153.  
  154.     If Not Len(ErrLine) = 0 Then
  155.         Response.Write("<B><FONT COLOR=""#FF0000"">" & ErrLine & "</FONT></B><br>")
  156.     End If
  157. %>
  158.  
  159. <form name="useredit_form" method="POST" action="/accounts/groupedit.agp">
  160.     <input type="hidden" name="newgroup" value="<%Response.Write(NewGroup)%>">
  161.     <div align="center"><center>
  162.     <table border="1" cellpadding="0" cellspacing="0" width="100%">
  163.         <tr>
  164.             <td width="20%" bgcolor="<%Response.Write(SkinTable)%>"><strong><font face="Arial" color="<%Response.Write(SkinFont)%>">
  165.                 Option
  166.             </font></strong></td>
  167.             <td width="40%" bgcolor="<%Response.Write(SkinTable)%>"><strong><font face="Arial" color="<%Response.Write(SkinFont)%>">
  168.                 Value
  169.             </font></strong></td>
  170.         <tr>
  171.         <tr>
  172.             <td width="20%"><strong><font face="Arial">
  173.                 Name
  174.             </font></strong></td>
  175.             <td width="40%">
  176. <%
  177.     If NewGroup Then
  178. %>
  179.     <input type="text" size="20" name="name" value="<%Response.Write(group.name)%>">
  180. <%
  181.     Else
  182. %>
  183.     <input type="hidden" name="name" value="<%Response.Write(group.name)%>">
  184.     <%Response.Write(group.name)%>
  185. <%
  186.     End If
  187. %>
  188.             </td>
  189.         </tr>
  190.         <tr>
  191.             <td width="20%"><strong><font face="Arial">
  192.                 Description
  193.             </font></strong></td>
  194.             <td width="40%">
  195.                 <input type="text" size="40" name="description" value="<%Response.Write(group.description)%>">
  196.             </td>
  197.         </tr>
  198.     </table>
  199.     </center></div>
  200. <br>
  201. <font face="Arial">
  202. <%
  203.     Set users = Accounts.Users
  204.     usercount = 1
  205. %>
  206.     The following users are members of this group
  207.     <table border="0" width="100%">
  208. <%
  209.     While Not usercount > users.count
  210. %>
  211.         <tr>
  212. <%
  213.         For subcount = 0 to 3 
  214. %>
  215.             <td width="25%">
  216. <%
  217.             If Not usercount > users.count Then
  218.                 Set user = users.item(usercount)
  219.                 Response.Write("<input type=""checkbox"" ")
  220.                 If group.IsMember(user.name) Then
  221.                     Response.Write("Checked ")
  222.                 End If
  223.                 Response.Write("name=""users"" value="""&user.name&""">")
  224.                 Response.Write(user.name)
  225.             End If
  226.             usercount = usercount + 1
  227. %>
  228.             </td>
  229. <%
  230.         Next
  231. %>
  232.         </tr>
  233. <%
  234.     WEnd
  235. %>
  236.     </table>
  237.     </font>
  238.     <p>
  239. <!--    <span style="cursor:hand" value="Commit" onClick="javascript:useredit_form.action.value='Commit';useredit_form.submit()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('commit.gif','','../images/commit01.gif',1)"><img src='../images/commit.gif' name='commit.gif'></span>-->
  240.     <input type="submit" name="action" value="Commit">
  241.     <input type="submit" name="action" value="Cancel">
  242. <!--    <span style="cursor:hand" value="Cancel" onClick="javascript:useredit_form.action.value='Cancel';useredit_form.submit()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('cancel.gif','','../images/cancel01.gif',1)"><img src='../images/cancel.gif' name='cancel.gif'></span>-->
  243. <!--    <input type="hidden" name="action" value="Cancel">-->
  244. <% 
  245.     If Not NewUser Then 
  246. %>
  247. <!--    <span style="cursor:hand" value="Remove" onClick="javascript:useredit_form.action.value='Remove';useredit_form.submit()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Remove.gif','','../images/Remove01.gif',1)"><img src='../images/Remove.gif' name='Remove.gif'></span>-->
  248.     <input type="submit" name="action" value="Remove">
  249. <%
  250.     End If
  251. %>
  252.     </p>
  253. </form>
  254.  
  255. <p><br>
  256. <font size="1" face="Arial"><%Response.Write(GateKeeper.Version)%></font>
  257. </p>
  258. </body>
  259. </html>
  260.