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

  1. <% 
  2.     dim szPath
  3.     szPath = "Table"
  4.     SkinTable = SysInfo.GetSkinParameter(szPath)
  5.     szPath = "Font"
  6.     SkinFont = SysInfo.GetSkinParameter(szPath)
  7. %>
  8. <script language="JavaScript">
  9. <!--
  10. function MM_preloadImages() { //v3.0
  11.   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  12.     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  13.     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
  14. }
  15.  
  16. function MM_swapImgRestore() { //v3.0
  17.   var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  18. }
  19.  
  20. function MM_findObj(n, d) { //v4.0
  21.   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  22.     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  23.   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  24.   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  25.   if(!x && document.getElementById) x=document.getElementById(n); return x;
  26. }
  27.  
  28. function MM_swapImage() { //v3.0
  29.   var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  30.    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
  31. }
  32. //-->
  33. </script>
  34. <body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" background="../images/backgr_x.gif"onLoad="MM_preloadImages('../images/comit01.gif','../images/cancel01.gif')">
  35. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  36.   <tr> 
  37.     <td width="344"><img src="images/1_r1_c2.jpg" width="344" height="70"></td>
  38.     <td width="135"><img src="images/1_r1_c3.jpg" width="135" height="70"></td>
  39.     <td width="100"><a href="hlpAccounts.agp"><img src="images/1_r1_c4.jpg" width="100" height="70"border=0></a></td>
  40.     <td width="1000"> </td>
  41.   </tr>
  42. </table>
  43. <map name="n1_r4_c3Map"> 
  44.   <area shape="rect" coords="492,45,567,76" href="hlpAccounts.agp">
  45. </map>
  46. <html>
  47. <head>
  48. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  49. <meta NAME="Author,Design" Content="GateKeeper Team; GateKeeper3Support@infopulse.ro">
  50. <meta NAME="Copyright" Content="Infopulse; www.infopulse.ro">
  51. <title>Empty</title>
  52. </head>
  53.  
  54. <body>
  55. <%
  56.     If Request.ReqParam("action") = "Cancel" Then
  57.         Response.Redirect("users.agp")    
  58.     End If
  59.     bValidPwd = True
  60.     
  61.     If Request.ReqParam("name") = "" Then
  62.         Set user = Accounts.Users.NewUser
  63.         NewUser = TRUE
  64.     Else
  65.         If Request.ReqParam("newuser") = "True" Then
  66.             Set user = Accounts.Users.NewUser
  67.             user.Name = Request.ReqParam("name")
  68.             NewUser = TRUE
  69.         Else
  70.             Set user = Accounts.Users.item(Request.ReqParam("name"))
  71.             NewUser = FALSE
  72.         End If
  73.     End If
  74.  
  75.     If Request.ReqParam("action") = "Remove" AND Not NewUser = TRUE Then
  76.         On Error Resume Next
  77.         user.Remove
  78.         If Not Err.Number = 0 Then 
  79.             ErrLine = Err.Description
  80.         Else
  81.             Response.Redirect("users.agp")
  82.         End If
  83.     ElseIf Request.ReqParam("action") = "Commit" Then
  84.         ' Process the user account
  85.         If Request.ReqParam("CanChangePwd") = "True" Then
  86.             user.CanChangePassword = TRUE
  87.         Else
  88.             user.CanChangePassword = FALSE
  89.         End If
  90.         If Request.ReqParam("MustChangePwd") = "True" Then
  91.             user.MustChangePassword = TRUE
  92.         Else
  93.             user.MustChangePassword = FALSE
  94.         End If
  95.         If Request.ReqParam("Enabled") = "True" Then
  96.             user.Enabled = TRUE
  97.         Else
  98.             user.Enabled = FALSE
  99.         End If
  100.  
  101.         user.RealName = Request.ReqParam("realname")
  102.         user.Description = Request.ReqParam("description")
  103.  
  104.         If Accounts.IsNTVersion Then
  105.             if Request.ReqParam("NTAccount") = "True" Then
  106.                 user.NTAccount = TRUE
  107.             Else
  108.                 user.NTAccount = FALSE
  109.             End If
  110.             if Request.ReqParam("NonNTAccount") = "True" Then
  111.                 user.NonNTAccount = TRUE
  112.             Else
  113.                 user.NonNTAccount = FALSE
  114.             End If
  115.             user.DomainName = Request.ReqParam("domainname")
  116.  
  117.         Else
  118.             user.NTAccount = FALSE
  119.             user.NonNTAccount = FALSE
  120.             user.DomainName = ""
  121.         End If
  122.  
  123.         sPwd = Request.ReqParam("password")
  124.         sTestPwd = Request.ReqParam("testPassword")
  125.         if sPwd <> sTestPwd Then
  126.             bValidPwd = False
  127.         Else
  128.             user.Password = sPwd
  129.         End If
  130.  
  131.         ' Process the grouplist
  132.         Dim grouplist()
  133.         groupline = Request.ReqParam("groups")
  134.         grouplistidx = 1
  135.         While Len(groupline)
  136.             pos = InStr(groupline,",")
  137.             If pos > 0 Then
  138.                 groupitem = Left(groupline,pos - 1)
  139.                 groupline = Mid(groupline,pos + 1)
  140.             Else
  141.                 groupitem = groupline
  142.                 groupline = ""
  143.             End If
  144.             ReDim Preserve grouplist(grouplistidx+1)
  145.             grouplist(grouplistidx) = groupitem
  146.             grouplistidx = grouplistidx + 1
  147.         Wend
  148.  
  149.         Set groups = Accounts.Groups
  150.         For groupcnt = 1 to groups.count
  151.             Set group = Accounts.Groups.Item(groupcnt)
  152.  
  153.             bIsMemberOfThisGroup = FALSE
  154.             For listcnt = 1 to grouplistidx-1
  155.                 If grouplist(listcnt) = group.name Then
  156.                     bIsMemberOfThisGroup = TRUE
  157.                 End If
  158.             Next
  159.  
  160.             If group.IsMember(user.name) AND Not bIsMemberOfThisGroup = TRUE Then
  161.                 group.DelMember(user.name)
  162.                 group.Commit
  163.             ElseIf Not group.IsMember(user.name) AND bIsMemberOfThisGroup = TRUE Then
  164.                 group.AddMember(user.name)
  165.                 group.Commit
  166.             End If
  167.  
  168.         Next
  169.  
  170.         if bValidPwd Then
  171.             On Error Resume Next
  172.             user.Commit
  173.             If Not Err.Number = 0 Then 
  174.                 ErrLine = Err.Description
  175.             Else
  176.                 Response.Redirect("users.agp")
  177.             End If
  178.         Else
  179. %>
  180.             <B><FONT COLOR="#FF0000">
  181.                 The password was not confirmed correctly !
  182.             </FONT></B>
  183.             <br>
  184. <%
  185.         End if
  186.     End If
  187.     If Not NewUser Then
  188. %>
  189.         <p><big><strong><font face="Arial">
  190.             Edit user account
  191.         </font></strong></big></p>
  192. <%
  193.     Else
  194. %>
  195.         <p><big><strong><font face="Arial">
  196.             Add new user account
  197.         </font></strong></big></p>
  198. <%
  199.     End If
  200.  
  201.     If Not Len(ErrLine) = 0 Then
  202.         Response.Write("<B><FONT COLOR=""#FF0000"">" & ErrLine & "</FONT></B><br>")
  203.     End If
  204. %>
  205.  
  206. <form name='useredit_form' method="POST" action="/accounts/useredit.agp">
  207.     <input type="hidden" name="newuser" value="<%Response.Write(NewUser)%>">
  208.     <div align="center"><center>
  209.     <table border="1" cellpadding="0" cellspacing="0" width="100%">
  210.         <tr>
  211.             <td width="40%" bgcolor="<%Response.Write(SkinTable)%>"><strong><font face="Arial" color="<%Response.Write(SkinFont)%>">
  212.                 Option
  213.             </font></strong></td>
  214.             <td width="40%" bgcolor="<%Response.Write(SkinTable)%>"><strong><font face="Arial" color="<%Response.Write(SkinFont)%>">
  215.                 Value
  216.             </font></strong></td>
  217.         </tr>
  218.         <tr>
  219.             <td width="40%" title="Fill in with logon names like: jsmith, john.doe, and so on."><strong><font face="Arial">
  220.                 User name
  221.             </font></strong></td>
  222.             <td width="40%">
  223. <%
  224.     If NewUser Then
  225. %>
  226.     <input type="text" size="20" maxlength="40" name="name" value="<%Response.Write(user.name)%>">
  227. <%
  228.     Else
  229. %>
  230.     <input type="hidden" name="name" value="<%Response.Write(user.name)%>">
  231.     <%Response.Write(user.name)%>
  232. <%
  233.     End If
  234. %>
  235.             </td>
  236.         </tr>
  237.         <tr>
  238.             <td width="40%"><strong><font face="Arial">
  239.                 Password
  240.             </font></strong></td>
  241.             <td width="40%"><input type="password" size="20" name="password" value="<%Response.Write(user.password)%>"></td>
  242.         </tr>
  243.         <tr>
  244.             <td width="40%"><strong><font face="Arial">
  245.                 Confirm password
  246.             </font></strong></td>
  247.             <td width="40%"><input type="password" size="20" name="testPassword" value="<%Response.Write(user.password)%>"></td>
  248.         </tr>
  249.         <tr>
  250.             <td width="40%"><strong><font face="Arial">
  251.                 Full name
  252.             </font></strong></td>
  253.             <td width="40%"><input type="text" size="40" name="realname" value="<%Response.Write(user.realname)%>"></td>
  254.         </tr>
  255.         <tr>
  256.             <td width="40%"><strong><font face="Arial">
  257.                 Description
  258.             </font></strong></td>
  259.             <td width="40%"><input type="text" size="40" name="description" value="<%Response.Write(user.description)%>"></td>
  260.         </tr>
  261.         <tr>
  262.             <td width="40%" title="If the checkbox is unchecked the account cannot be used."><strong><font face="Arial">
  263.                 Enabled
  264.             </font></strong></td>
  265.             <td width="40%"><input type="checkbox" <% If user.Enabled Then Response.Write("Checked ") End If %> name="Enabled" value="True"></td>
  266.         </tr>
  267.         <tr>
  268.             <td width="40%"><strong><font face="Arial">
  269.                 The user can change the password
  270.             </font></strong></td>
  271.             <td width="40%"><input type="checkbox" <% If user.CanChangePassword Then Response.Write("Checked ") End If %> name="CanChangePwd" value="True"></td>
  272.         </tr>
  273.         <tr>
  274.             <td width="40%"><strong><font face="Arial">
  275.                 The user must change the password at next logon
  276.             </font></strong></td>
  277.             <td width="40%"><input type="checkbox" <% If user.MustChangePassword Then Response.Write("Checked ") End If %> name="MustChangePwd" value="True"></td>
  278.         </tr>
  279.         </table>
  280.     </center></div>
  281.  
  282. <% 
  283.     If Accounts.IsNTVersion AND NOT Request.ReqParam("name") = "Administrator" AND NOT Request.ReqParam("name") = "Guest" Then
  284. %>
  285.     
  286.     <p><big><strong><font face="Arial">
  287.         NT account properties 
  288.     </font></strong></big></p>
  289.     <div align="center"><center>
  290.     <table border="1" cellpadding="0" cellspacing="0" width="100%">
  291.         <tr>
  292.             <td width="40%" bgcolor="<%Response.Write(SkinTable)%>"><strong><font face="Arial" color="<%Response.Write(SkinFont)%>">
  293.                 Option
  294.             </font></strong></td>
  295.             <td width="40%" bgcolor="<%Response.Write(SkinTable)%>"><strong><font face="Arial" color="<%Response.Write(SkinFont)%>">
  296.                 Value
  297.             </font></strong></td>
  298.         </tr>
  299.         <tr>
  300.             <td width="40%"><strong><font face="Arial">
  301.                 Domain name
  302.             </font></strong></td>
  303.             <td width="40%"><input type="text" size="40" name="domainname" value="<%Response.Write(user.domainname)%>"></td>
  304.         </tr>
  305.         <tr>
  306.             <td width="40%"><strong><font face="Arial">
  307.                 Is NT domain account
  308.             </font></strong></td>
  309.             <td width="40%"><input type="checkbox" <% If user.NTAccount Then Response.Write("Checked ") End If %> name="NTAccount" value="True"></td>
  310.         </tr>
  311.         <tr>
  312.             <td width="40%"><strong><font face="Arial">
  313.                 Allow connection without NT domain authentication
  314.             </font></strong></td>
  315.             <td width="40%"><input type="checkbox" <% If user.NonNTAccount Then Response.Write("Checked ") End If %> name="NonNTAccount" value="True"></td>
  316.         </tr>
  317.     </table>
  318.     </center></div>
  319. <%
  320.     End If
  321. %>
  322.  
  323. <br>
  324. <font face="Arial">
  325. <%
  326.     Set groups = Accounts.Groups
  327.     groupcount = 1
  328.     if groups.count > 0 Then
  329.         if NewUser = TRUE Then
  330.             Response.Write("This user will be a member of the following groups:")
  331.         Else
  332.             Response.Write("This user is a member of the following groups:")
  333.         End If
  334. %>
  335.     <table border="0" width="100%">
  336. <%
  337.     End if
  338.     While Not groupcount > groups.count
  339. %>
  340.         <tr>
  341. <%
  342.         For subcount = 0 to 3 
  343. %>
  344.             <td width="25%">
  345. <%
  346.             If Not groupcount > groups.count Then
  347.                 Set group = groups.item(groupcount)
  348.                 Response.Write("<input type=""checkbox"" ")
  349.                 If group.IsMember(user.name) Then
  350.                     Response.Write("Checked ")
  351.                 End If
  352.                 if ( group.name = "Users" And NewUser = TRUE ) Then
  353.                     Response.Write("name=""groups"" value="""&group.name&""" checked>")
  354.                 Else
  355.                     Response.Write("name=""groups"" value="""&group.name&""">")
  356.                 End If
  357.                 Response.Write(group.name)
  358.             End If
  359.             groupcount = groupcount + 1
  360. %>
  361.             </td>
  362. <%
  363.         Next
  364. %>
  365.         </tr>
  366. <%
  367.     WEnd
  368. %>
  369.     </table>
  370.     <p>
  371. <!--    <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>-->
  372.     <input type="submit" name="action" value="Commit">
  373.     <input type="submit" name="action" value="Cancel">
  374. <!--    <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>-->
  375. <!--    <input type="hidden" name="action" value="Cancel">-->
  376. <% 
  377.     If Not NewUser Then 
  378. %>
  379. <!--    <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>-->
  380.     <input type="submit" name="action" value="Remove">
  381. <%
  382.     End If
  383. %>
  384.     </p>
  385. </form>
  386. </font>
  387. <p><br>
  388. <font size="1" face="Arial"><%Response.Write(GateKeeper.Version)%></font>
  389. </p>
  390. </body>
  391. </html>
  392.