⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ad_admin.asp

📁 该软件是帮助大学生更好的生活
💻 ASP
📖 第 1 页 / 共 4 页
字号:
	rs.close
	set rs=nothing
end sub

sub ModifyPurview()
	dim UserID
	UserID=trim(Request("ID"))
	if UserID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定要修改的管理员ID</li>"
		exit sub
	else
		UserID=Clng(UserID)
	end if
	sql="Select * from Admin where ID=" & UserID
	Set rs=Server.CreateObject("Adodb.RecordSet")
	rs.Open sql,conn,1,3
	if rs.Bof and rs.EOF then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>不存在此用户!</li>"
	else
%>
<form method="post" action="Ad_Admin.asp" name="form1" onsubmit="javascript:CheckModifyPurview();">
  <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
    <tr class="title"> 
      <td height="22" colspan="2"> <div align="center"><font size="2"><strong>修 改 管 理 员 权 限</strong></font></div></td>
    </tr>
    <tr> 
      <td width="300" class="tdbg"><strong>用 户 名:</strong></td>
      <td class="tdbg"><%=rs("UserName")%> <input name="ID" type="hidden" value="<%=rs("ID")%>"></td>
    </tr>
    <tr class="tdbg"> 
      <td width="35%" class="tdbg"><strong>权限设置: </strong></td>
      <td width="65%" class="tdbg"><table width="100%" border="0" cellspacing="1" cellpadding="2">
        <tr>
          <td width="100"><input name="Purview" type="radio" value="1" onClick="PurviewDetail.style.display='none'" <%if rs("Purview")=1 then response.write "checked"%>>
超级管理员:</td>
          <td>拥有所有权限。某些权限(如管理员管理、网站信息配置、网站选项配置等管理权限)只有超级管理员才有</td>
        </tr>
        <tr>
          <td width="100"><input type="radio" name="Purview" value="2" onClick="PurviewDetail.style.display=''" <%if rs("Purview")=2 then response.write "checked"%>>
普通管理员:</td>
          <td>需要详细指定每一项管理权限</td>
        </tr>
      </table>
</td>
    </tr>
    <tr class="tdbg">
      <td colspan="2"><table id="PurviewDetail" width="100%" border="0" cellspacing="10" cellpadding="0" <%if rs("Purview")=1 then response.write "style='display:none'"%>>
        <tr>
          <td colspan="2" align="center"><strong>管 理 员 权 限 详 细 设 置</strong></td>
        </tr>
        <tr valign="top">
          <td width="49%"><fieldset><legend>文章频道</legend>
              <input type="radio" name="AdminPurview_Article" value="1" <%if rs("AdminPurview_Article")=1 then response.write "checked"%>>
频道管理员:拥有所有栏目的管理权限,并可以添加栏目和专题<br>
<input type="radio" name="AdminPurview_Article" value="2" <%if rs("AdminPurview_Article")=2 then response.write "checked"%>>
栏目总编:拥有所有栏目的管理权限,但不能添加栏目和专题<br>
<input name="AdminPurview_Article" type="radio" value="3" <%if rs("AdminPurview_Article")=3 then response.write "checked"%>>
栏目管理员:只拥有部分栏目管理权限,不能添加栏目和专题<br>
<input type="radio" name="AdminPurview_Article" value="4" <%if rs("AdminPurview_Article")=4 then response.write "checked"%>> 
在此频道里无任何管理权限<br>
<iframe id="frmArticle" height="200" width="100%" src="Ad_SetClassPurview.asp?ChannelID=2&Action=Modify&UserID=<%=UserID%>"></iframe>  <br>
<strong><font color="#0000FF">注:</font></strong>栏目权限采用继承制度,即在某一栏目拥有某项管理权限,则在此栏目的所有子栏目中都拥有这项管理权限,并可在子栏目中指定更多的管理权限。
          <input name="ClassMaster_Article" type="hidden" id="ClassMaster_Article">
          <input name="ClassChecker_Article" type="hidden" id="ClassChecker_Article">
          <input name="ClassInputer_Article" type="hidden" id="ClassInputer_Article">
          </fieldset></td>
          <td width="49%"><fieldset><legend>下载频道</legend>
              <input type="radio" name="AdminPurview_Soft" value="1" <%if rs("AdminPurview_Soft")=1 then response.write "checked"%>>
频道管理员:拥有所有栏目的管理权限,并可以添加栏目和专题<br>
<input type="radio" name="AdminPurview_Soft" value="2" <%if rs("AdminPurview_Soft")=2 then response.write "checked"%>>
栏目总编:拥有所有栏目的管理权限,但不能添加栏目和专题<br>
<input name="AdminPurview_Soft" type="radio" value="3" <%if rs("AdminPurview_Soft")=3 then response.write "checked"%>>
栏目管理员:只拥有部分栏目管理权限,不能添加栏目和专题<br>
<input type="radio" name="AdminPurview_Soft" value="4" <%if rs("AdminPurview_Soft")=4 then response.write "checked"%>> 
在此频道里无任何管理权限<br>
<iframe id="frmSoft" height="200" width="100%" src="Ad_SetClassPurview.asp?ChannelID=3&Action=Modify&UserID=<%=UserID%>"></iframe><br> 
<strong><font color="#0000FF">注:</font></strong>栏目权限采用继承制度,即在某一栏目拥有某项管理权限,则在此栏目的所有子栏目中都拥有这项管理权限,并可在子栏目中指定更多的管理权限。
<input name="ClassMaster_Soft" type="hidden" id="ClassMaster_Soft">
<input name="ClassChecker_Soft" type="hidden" id="ClassChecker_Soft">
<input name="ClassInputer_Soft" type="hidden" id="ClassInputer_Soft">
                    </fieldset></td>
        </tr>
        <tr valign="top">
          <td width="49%"><fieldset><legend>图片频道</legend>
              <input type="radio" name="AdminPurview_Photo" value="1" <%if rs("AdminPurview_Photo")=1 then response.write "checked"%>>
频道管理员:拥有所有栏目的管理权限,并可以添加栏目和专题<br>
<input type="radio" name="AdminPurview_Photo" value="2" <%if rs("AdminPurview_Photo")=2 then response.write "checked"%>>
栏目总编:拥有所有栏目的管理权限,但不能添加栏目和专题<br>
<input name="AdminPurview_Photo" type="radio" value="3" <%if rs("AdminPurview_Photo")=3 then response.write "checked"%>>
栏目管理员:只拥有部分栏目管理权限,不能添加栏目和专题 <br>
<input type="radio" name="AdminPurview_Photo" value="4" <%if rs("AdminPurview_Photo")=4 then response.write "checked"%>> 
在此频道里无任何管理权限<br>
<iframe id="frmPhoto" height="200" width="100%" src="Ad_SetClassPurview.asp?ChannelID=4&Action=Modify&UserID=<%=UserID%>"></iframe><br>
<strong><font color="#0000FF">注:</font></strong>栏目权限采用继承制度,即在某一栏目拥有某项管理权限,则在此栏目的所有子栏目中都拥有这项管理权限,并可在子栏目中指定更多的管理权限。          
<input name="ClassMaster_Photo" type="hidden" id="ClassMaster_Photo">
<input name="ClassChecker_Photo" type="hidden" id="ClassChecker_Article3">
<input name="ClassInputer_Photo" type="hidden" id="ClassInputer_Photo">
          </fieldset></td>
          <td width="49%"><fieldset>
          <legend>产品、影视权限</legend>
              <table width="100%" border="0" cellspacing="1" cellpadding="2">
                <tr>
                  <td width="33%"><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="shop1" <%if CheckPurview(rs("AdminPurview_Others"),"shop1")=True then response.write "checked"%>>
产品添加/管理</td>
                  <td width="33%"><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="shop2" <%if CheckPurview(rs("AdminPurview_Others"),"shop2")=True then response.write "checked"%>>
产品分类/图片</td>
                  <td width="34%"><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="shop3" <%if CheckPurview(rs("AdminPurview_Others"),"shop3")=True then response.write "checked"%>>
产品订单管理</td>
                </tr>
                <tr>
                  <td width="33%"><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="movie1" <%if CheckPurview(rs("AdminPurview_Others"),"movie1")=True then response.write "checked"%>>
影视添加/管理</td>
                  <td colspan="2"><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="movie2" <%if CheckPurview(rs("AdminPurview_Others"),"movie2")=True then response.write "checked"%>>
影视分类/图片</td>
                </tr>
              </table>
          </fieldset><br>
            <fieldset>
            <legend>留言板</legend>
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
              <tr>
                <td width="50%"><input name="AdminPurview_Guest" type="checkbox" id="AdminPurview_Guest" value="Reply" <%if CheckPurview(rs("AdminPurview_Guest"),"Reply")=True then response.write "checked"%>>
      回复留言 </td>
                <td width="50%"><input name="AdminPurview_Guest" type="checkbox" id="AdminPurview_Guest" value="Modify" <%if CheckPurview(rs("AdminPurview_Guest"),"Modify")=True then response.write "checked"%>>
      修改留言</td>
              </tr>
              <tr>
                <td width="50%"><input name="AdminPurview_Guest" type="checkbox" id="AdminPurview_Guest" value="Del" <%if CheckPurview(rs("AdminPurview_Guest"),"Del")=True then response.write "checked"%>>
      删除留言</td>
                <td width="50%"><input name="AdminPurview_Guest" type="checkbox" id="AdminPurview_Guest" value="Check" <%if CheckPurview(rs("AdminPurview_Guest"),"Check")=True then response.write "checked"%>>
      审核留言</td>
              </tr>
            </table>
            </fieldset>            <br>
            <fieldset>
            <legend>网站管理权限</legend>
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
              <tr>
                <td width="50%"><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="Channel" <%if CheckPurview(rs("AdminPurview_Others"),"Channel")=True then response.write "checked"%>>
                  频道管理</td>
                <td width="50%"><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="AD" <%if CheckPurview(rs("AdminPurview_Others"),"AD")=True then response.write "checked"%>>
                  广告管理</td>
              </tr>
              <tr>
                <td width="50%"><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="Announce" <%if CheckPurview(rs("AdminPurview_Others"),"Announce")=True then response.write "checked"%>>
                  公告管理</td>
                <td width="50%"><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="FriendSite" <%if CheckPurview(rs("AdminPurview_Others"),"FriendSite")=True then response.write "checked"%>>
                  友情链接管理</td>
              </tr>
              <tr>
                <td width="50%"><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="Vote" <%if CheckPurview(rs("AdminPurview_Others"),"Vote")=True then response.write "checked"%>>
调查管理&nbsp;/产品管理</td>
                <td width="50%"><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="Counter" <%if CheckPurview(rs("AdminPurview_Others"),"Counter")=True then response.write "checked"%>>
统计管理</td>
              </tr>
              <tr>
                <td width="50%"><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="User" <%if CheckPurview(rs("AdminPurview_Others"),"User")=True then response.write "checked"%>>
注册用户管理</td>
                <td width="50%"><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="MailList" <%if CheckPurview(rs("AdminPurview_Others"),"MailList")=True then response.write "checked"%>>
                  邮件列表管理</td>
              </tr>
              <tr>
                <td><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="Skin" <%if CheckPurview(rs("AdminPurview_Others"),"Skin")=True then response.write "checked"%>>
                  配色模板管理</td>
                <td><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="Layout" <%if CheckPurview(rs("AdminPurview_Others"),"Layout")=True then response.write "checked"%>>
                  版面设计模板管理</td>
              </tr>
              <tr>
                <td><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="JS" <%if CheckPurview(rs("AdminPurview_Others"),"JS")=True then response.write "checked"%>>                  
                  JS代码管理</td>
                <td><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="Database" <%if CheckPurview(rs("AdminPurview_Others"),"Database")=True then response.write "checked"%>  disabled>
                  数据库管理</td>
              </tr>
              <tr>
                <td><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="UpFile" <%if CheckPurview(rs("AdminPurview_Others"),"UpFile")=True then response.write "checked"%>>
                  上传文件管理</td>
                <td><input name="AdminPurview_Others" type="checkbox" id="AdminPurview_Others" value="ModifyPwd" <%if CheckPurview(rs("AdminPurview_Others"),"ModifyPwd")=True then response.write "checked"%>>
				修改自己的登录密码</td>
              </tr>
            </table>
            </fieldset></td>
        </tr>
      </table></td>
    </tr>
    <tr> 
      <td colspan="2" align="center" class="tdbg"><input name="Action" type="hidden" id="Action" value="SaveModifyPurview"> 
        <input  type="submit" name="Submit" value="保存修改结果" style="cursor:hand;">
        &nbsp;
        <input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='Ad_Admin.asp'" style="cursor:hand;"></td>
    </tr>
  </table>
</form>
<%
	end if
	rs.close
	set rs=nothing
end sub
%>
</body>
</html>
<%
sub SaveAdd()
	dim username, password,PwdConfirm, purview
	dim AdminPurview_Article,AdminPurview_Soft,AdminPurview_Photo,AdminPurview_Guest,AdminPurview_Others
	dim ClassInputer_Article,ClassChecker_Article,ClassMaster_Article
	dim ClassInputer_Soft,ClassChecker_Soft,ClassMaster_Soft
	dim ClassInputer_Photo,ClassChecker_Photo,ClassMaster_Photo

	username=trim(Request("username"))
	password=trim(Request("Password"))
	PwdConfirm=trim(request("PwdConfirm"))
	purview=trim(Request("purview"))
	AdminPurview_Article=Clng(trim(Request("AdminPurview_Article")))
	AdminPurview_Soft=Clng(trim(Request("AdminPurview_Soft")))
	AdminPurview_Photo=Clng(trim(Request("AdminPurview_Photo")))
	AdminPurview_Guest=replace(replace(trim(request("AdminPurview_Guest"))," ",""),"'","")
	AdminPurview_Others=replace(replace(trim(request("AdminPurview_Others"))," ",""),"'","")
	ClassInputer_Article=replace(replace(trim(request("ClassInputer_Article"))," ",""),"'","")
	ClassChecker_Article=replace(replace(trim(request("ClassChecker_Article"))," ",""),"'","")
	ClassMaster_Article=replace(replace(trim(request("ClassMaster_Article"))," ",""),"'","")
	ClassInputer_Soft=replace(replace(trim(request("ClassInputer_Soft"))," ",""),"'","")
	ClassChecker_Soft=replace(replace(trim(request("ClassChecker_Soft"))," ",""),"'","")
	ClassMaster_Soft=replace(replace(trim(request("ClassMaster_Soft"))," ",""),"'","")
	ClassInputer_Photo=replace(replace(trim(request("ClassInputer_Photo"))," ",""),"'","")
	ClassChecker_Photo=replace(replace(trim(request("ClassChecker_Photo"))," ",""),"'","")
	ClassMaster_Photo=replace(replace(trim(request("ClassMaster_Photo"))," ",""),"'","")
	if AdminPurview_Guest<>"" then
		AdminPurview_Guest=AdminPurview_Guest & "," & "Manage"
	end if
	if username="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>用户名不能为空!</li>"
	end if
	if password="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>初始密码不能为空!</li>"
	end if
	if PwdConfirm<>Password then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>确认密码必须与初始密码相同!</li>"
	end if
	if purview="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>用户权限不能为空!</li>"
	else
		purview=CInt(purview)
	end if

	if FoundErr=True then
		exit sub
	end if
	sql="Select * from Admin where username='"&username&"'"
	Set rs=Server.CreateObject("Adodb.RecordSet")
	rs.Open sql,conn,1,3
	if not (rs.bof and rs.EOF) then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>数据库中已经存在此管理员!</li>"
		rs.close
		set rs=nothing
		exit sub
	end if
   	rs.addnew
 	rs("username")=username
   	rs("password")=md5(password)
    rs("purview")=purview
	if purview=1 then
		rs("AdminPurview_Article")=3
		rs("AdminPurview_Soft")=3
		rs("AdminPurview_Photo")=3
		rs("AdminPurview_Guest")=""
		rs("AdminPurview_Others")=""
	else
		rs("AdminPurview_Article")=AdminPurview_Article

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -