admin_group.asp
上传用户:comthink
上传日期:2021-05-06
资源大小:1280k
文件大小:15k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <!--#include file=conn.asp-->
  2. <!-- #include file="inc/const.asp" -->
  3. <title><%=txl_info(0)%>--管理页面</title>
  4. <!--#include file="inc/admin_css.asp"-->
  5. <meta NAME=GENERATOR Content="Microsoft FrontPage 3.0" CHARSET=GB2312>
  6. <BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0">
  7. <%
  8. if not supermaster or session("flag")="" then
  9. Errmsg=Errmsg+"<br>"+"<li>本页面为管理员专用,请<a href=admin_index.asp target=_top>登陆</a>后进入。<br><li>您没有管理本页面的权限。"
  10. call txl_error()
  11. else
  12. call main()
  13. conn.close
  14. set conn=nothing
  15. end if
  16. sub main()
  17. if request("action")="save" then
  18. call savegroup()
  19. elseif request("action")="editgroup" then
  20. call editgroup()
  21. else
  22. call maingroup()
  23. end if
  24. end sub
  25. sub maingroup()
  26. %>
  27. <table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center class="tableBorder">
  28. <tr> 
  29. <th height="23" colspan="4" >用户组管理</th>
  30. </tr>
  31. <tr align=center>
  32. <td height="23" width="30%" class=txlHeaderBackgroundAlternate><B>用户组</B></td>
  33. <td height="23" width="20%" class=txlHeaderBackgroundAlternate><B>用户数量</B></td>
  34. <td height="23" width="20%" class=txlHeaderBackgroundAlternate><B>编辑</B></td>
  35. <td height="23" width="30%" class=txlHeaderBackgroundAlternate><B>列出用户</B></td>
  36. </tr>
  37. <%
  38. dim trs
  39. set rs=conn.execute("select * from usergroups order by usergroupID")
  40. do while not rs.eof
  41. set trs=conn.execute("select count(*) from [user] where UsergroupID="&rs("UsergroupID"))
  42. %>
  43. <tr align=center>
  44. <td height="23" width="30%" class="txlrow"><%=rs("groupname")%></td>
  45. <td height="23" width="20%" class="txlrow"><%=trs(0)%></td>
  46. <td height="23" width="20%" class="txlrow"><a href="?action=editgroup&groupid=<%=rs("usergroupID")%>">编辑</a></td>
  47. <td height="23" width="30%" class="txlrow"><a href="admin_user.asp?userSearch=10">列出所有用户</td>
  48. </tr>
  49. <%
  50. rs.movenext
  51. loop
  52. rs.close
  53. set rs=nothing
  54. %>
  55. <tr><td colspan=4 height=25 class="txlrow"><B>说明</B>:<BR>①可以对用户组名进行修改;<BR>②点击编辑,可以对相应用户组进行同学录权限的设置;<BR>③点击列出所有用户,可以查看相应组下的用户情况。</td></tr>
  56. </table>
  57. <%
  58. end sub
  59. sub editgroup()
  60. if not isnumeric(request("groupid")) then
  61. response.write "错误的参数!"
  62. exit sub
  63. end if
  64. if request("ClassAction")="yes" then
  65. dim GroupSetting
  66. if request.form("groupname")="" then
  67. response.write "请输入用户组名称!"
  68. exit sub
  69. end if
  70. GroupSetting=Request.Form("Cview") & "," & Request.Form("Ccard") & "," & Request.Form("Cuser") & "," & Request.Form("Cskin") & "," & Request.Form("Cdiary") & "," & Request.Form("Gview") & "," & Request.Form("Gpost") & "," & Request.Form("Greply") & "," & Request.Form("Bview") & "," & Request.Form("Btopic") & "," & Request.Form("Bbest") & "," & Request.Form("Bpost") & "," & Request.Form("Breply") & "," & Request.Form("Bedit") & "," & Request.Form("Bdel") & "," & Request.Form("Bpaper") & "," & Request.Form("Bmoney") & "," & Request.Form("Pview") & "," & Request.Form("Plook") & "," & Request.Form("Psend") & "," & Request.Form("Psay") & "," & Request.Form("Pedit") & "," & Request.Form("Pdel") & "," & Request.Form("Msend") & "," & Request.Form("Mmax") & "," & Request.Form("Msize") & "," & Request.Form("Mbox") & "," & Request.Form("Agbook") & "," & Request.Form("Abbs") & "," & Request.Form("Amana") & "," & Request.Form("Aphoto") & "," & Request.Form("Gedit") & "," & Request.Form("Gdel")
  71. Set rs= Server.CreateObject("ADODB.Recordset")
  72. sql="select * from usergroups where usergroupid="&request("groupid")
  73. rs.open sql,conn,1,3
  74. rs("groupname")=request.form("groupname")
  75. rs("groupsetting")=GroupSetting
  76. rs.update
  77. rs.close
  78. set rs=nothing
  79. response.write "修改成功!"
  80. else
  81. Dim reGroupSetting
  82. set rs=conn.execute("select * from usergroups where usergroupid="&request("groupid"))
  83. if rs.eof and rs.bof then
  84. response.write "未找到该用户组!"
  85. exit sub
  86. end if
  87. reGroupSetting=split(rs("GroupSetting"),",")
  88. %>
  89. <FORM METHOD=POST ACTION="?action=editgroup">
  90. <input type=hidden name="groupid" value="<%=request("groupid")%>">
  91. <table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center class="tableBorder">
  92. <tr>
  93. <th height="23" colspan="2">编辑用户组:<%=rs("groupname")%></th>
  94. </tr>
  95. <tr>
  96. <td height="23" width="60%" class=txlrow>用户组名称</td>
  97. <td height="23" width="40%" class=txlrow><input size=35 name="groupname" type=text value="<%=rs("groupname")%>"></td>
  98. </tr>
  99. <tr> 
  100. <th height="23" colspan="2"  align=left>==查看权限</th>
  101. </tr>
  102. <tr>
  103. <td height="23" width="60%" class=txlrow>可以访问同学录</td>
  104. <td height="23" width="40%" class=txlrow><input name="Cview" type=radio value="0" <%if reGroupSetting(0)=0 then%>checked<%end if%>>是