edituser.asp

来自「top-cms内容管理系统」· ASP 代码 · 共 320 行

ASP
320
字号
<%
'###########################################################################################
'*  程序名称: Top-CMS
'*---------------------------------------------------------------------------------------
'*  系统版本: 1.0 0215
'*  版权所有: www.Net-Develop.com
'*  程序设计: 江南行客
'*  联系方式:
'*            OICQ:2503086
'*            EMAIL:net-oa@sohu.com
'*  网站地址: 
'*            http://www.net-develop.com  
'*            http://www.top-cms.com   
'*---------------------------------------------------------------------------------------
'*  Copyright 2004 www.net-develop.com - All Rights Reserved.
'###########################################################################################
%>
<!--#include file="../common/common.asp" -->
<html>
<head>
<title>:::WWW.NET-DEVELOP.COM:::</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/style.css">
<style type="text/css">
<!--
.active {  font-weight: bold;cursor:default;color:#F5F5F5;}
.unactive {  color: #dddddd; text-decoration: underline;cursor:hand;}
.uuu{position:relative; width:100%; height:expression(body.offsetHeight-t1.offsetHeight-2); z-index:1; left: 0px; top: 0px; overflow-x:hidden;overflow-y:scroll;}
.uuuu{position:relative; width:100%; height:expression(body.offsetHeight-t1.offsetHeight-2); z-index:1; left: 0px; top: 0px; scroll:no}

.e {  background-color: #CCCCCC}


-->
</style>
<script>
function MM_Change(selObj){
	if (selObj==1){
		ChangeDisplay(a,c2);
		a1.className="active";
		b1.className="unactive";
	}else{
		ChangeDisplay(c2,a);
		a1.className="unactive";
		b1.className="active";
	}
}
function ChangeDisplay(V,H){
	var aChildren = eval(H);
	for(i=0; i < aChildren.length; i++) {
		aChildren[i].className = "hidden"
	}
	var aChildren1 = eval(V);
	for(i=0; i < aChildren1.length; i++) {
		aChildren1[i].className = "";
	}
}
function MM_goToURL(ActionUrl) { 
		myform.action=ActionUrl;
		myform.submit();
}
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<%
Set objCMS = Server.CreateObject("TopCMS.EditUser")
	if objCMS.ChkAdminPower then
		uID=objCMS.ChkString(Replace(Request("uID")," ",""),"U")
		nT=objCMS.ChkString(Request("nT"),"U")
		P=objCMS.ChkString(Request("P"),"U")
		t=objCMS.ChkString(Request("t"),"U")
		X=objCMS.ChkString(Request("X"),"U")
		SystemI_Init
		objCMS.OpenDB()
		
		If Not objCMS.CheckAdminField("User") Then
			objCMS.OutInfo "对不起,你不具备管理用户的权限", ""
			Response.End
		End If
		
		if UCase(t)="DEL" and uID<>"" and X="T" then objCMS.DelUser(uID)
		
		
		If Request.ServerVariables("REQUEST_METHOD")="POST" and X<>"T" Then
			objCMS.SaveUser uID,nT
		else
			if nT="" then
%> 
				
<table width="100%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolor="#999999">
  <tr bgcolor="#CCCCCC"> 
    <td colspan="6" height="12" background="../Images/default_nav.gif"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="84%"><font color="#FFFFFF">用户管理 </font></td>
          <td width="16%"><font color="#FFFFFF">操作</font><font color="#666666"><b><a href="edituser.asp?nT=ADD"><img src="../images/add.gif" hspace=2 border=0 align="absmiddle" alt="添加新用户"></a><a href="javascript:MM_goToURL('edituser.asp?nT=edit&P=<%= P %>&X=T');"><img src="../images/edit.gif" hspace=2 border=0 alt="编辑所选用户" align="absmiddle"></a><img src="../images/del.gif" hspace=2 border=0 alt="删除所选用户" onClick="if (confirm('你确定要删除所选的用户吗?\n删除后不能恢复!')){MM_goToURL('edituser.asp?t=del&P=<%= P %>&X=T');}" style="cursor:hand;" align="absmiddle"></b></font></td>
        </tr>
      </table>
    </td>
  </tr>
  <form name="myform" method="post">
    <tr bgcolor="#EEEEEE"> 
      <td><b><font color="#666666">帐户</font></b></td>
      <td><b><font color="#666666">姓名</font></b></td>
      <td align="center"><b><font color="#666666">性别</font></b></td>
      <td><b><font color="#666666">Email</font></b></td>
      <td><b><font color="#666666">OICQ</font></b></td>
      <td align="center"><b><font color="#666666">用户属性</font></b></td>
    </tr>
    <%
				dbSql = "SELECT uID,uUser,uName,uSex,uEmail,uOicq,uLevel FROM db_User Where uUser<>'" & Session("CMS_User") & "' Order By uID Desc"
				set dbRs=objCMS.MyRs(dbSql,1,1,0)
				If dbRs.EOF Then
					Response.Write "<tr bgcolor=""#FFFFFF""><td align=""center"" colspan=""6"">[目前还没有其他用户]</td></tr>"
				else
					objCMS.PagingMain dbRs,16
					nPage=objCMS.PNum
					Do While not dbRs.eof and nPage>0
						if nPage mod 2 <>0 then nBGcolor="#FFFFFF" else nBGcolor="#EEEEEE"
						uID=Trim(dbRs("uID"))
						uUser=Trim(dbRs("uUser"))
						uName=Trim(dbRs("uName"))
						uSex=Trim(dbRs("uSex"))
						uEmail=Trim(dbRs("uEmail"))
						uOicq=Trim(dbRs("uOicq"))
						uLevel=Trim(dbRs("uLevel"))
						%>
    <tr bgcolor="<%= nBGcolor %>"> 
      <td width="25%"> 
        <input type="checkbox" name="uID" value="<%=uID%>"<%if cBool(uLevel) then response.write " disabled"%>>
        <a href="edituser.asp?uID=<%= uID %>&nT=edit&P=<%= P %>"><%= uUser %></a>&nbsp; 
      </td>
      <td width="15%"><%= uName %></td>
      <td width="6%" align="center"><%= uSex %></td>
      <td width="24%"><%= uEmail %></td>
      <td width="13%"><%= uOicq %> </td>
<td align="center"><%if cBool(uLevel) then response.write "管理员" else response.write "普通用户"%> </td>
    </tr>
    <%
						dbRs.MoveNext
						nPage=nPage-1
					Loop
					
				end if
				dbRs.close
				set dbRs=nothing
				%>
  </form>
</table>
				<div align="right">
				<%
				objCMS.DisplayNavigation("")
				%>
				</div>
			<%
			else
			'修改/添加信息管理人员
		
				if UCase(nT)="EDIT" then 
					if uID="" then
						objCMS.OutInfo "对不起,请选择你要编辑的用户。",""
						response.end
					elseif instr(uID,",")>0 then 
						objCMS.OutInfo "对不起,一次只能编辑一个用户。",""
						response.end
					else
						objCMS.EditUser(uID)'获取用户信息
					end if
				end if
				%>	
				<form name="form1" method="post" action="edituser.asp">
				
  <table width="100%" border="1" bordercolor="#999999" cellspacing="0" cellpadding="2" align="center">
    <tr> 
      <td colspan="2" background="../Images/default_nav.gif"> <span onclick="MM_Change(1);" id="a1" class="active">用户信息</span> 
        | <span onclick="MM_Change(2);" id="b1" class="unactive">用户属性</span> </td>
    </tr>
    <tr id="a"> 
      <td width="100" align="right" bgcolor="#EEEEEE">操作模式:</td>
      <td bgcolor="#EEEEEE"> 
        <select name="nT">
		<%if UCase(nT)="EDIT" then%>
          <option value="EDIT">编辑 
		  <%end if%>
          <option value="ADD"	<%if UCase(nT)<>"EDIT" then Response.write " selected"%>>添加 
        </select>
      </td>
    </tr>
    <tr id="a"> 
      <td width="100" align="right">用户帐号:</td>
      <td> 
        <input type="text" name="uUser" maxlength="50" value="<%= objCMS.uUser %>" <%if UCase(nT)="EDIT" then response.write "readonly"%>>
      </td>
    </tr>
    <tr id="a"> 
      <td width="100" align="right" height="25" bgcolor="#EEEEEE">用户密码:</td>
      <td height="25" bgcolor="#EEEEEE"> 
		<%
		if UCase(nT)="EDIT" then
			response.write "<input type=""text"" name=""uPassword"" maxlength=""50"" value=""*****"" disabled>"
			response.write "<input type=""checkbox"" name=""RP"" value=""1"" onclick=""if (this.checked==true){form1.uPassword.value='';form1.uPassword.disabled=false;}else{form1.uPassword.value='*****';form1.uPassword.disabled=true;}"">修改密码"
		else
			response.write "<input type=""text"" name=""uPassword"" maxlength=""50"">"
		end if
		%>
		</td>
    </tr>
    <tr id="a"> 
      <td width="100" align="right" height="12">用户姓名:</td>
      <td height="12"> 
        <input type="text" name="uName" maxlength="50" value="<%= objCMS.uName %>">
      </td>
    </tr>
    <tr id="a"> 
      <td width="100" align="right" height="12" bgcolor="#EEEEEE">性别:</td>
      <td height="12" bgcolor="#EEEEEE"> 
        <input type="radio" name="uSex" value="男"<%if objCMS.uSex<>"女" then response.write " checked"%>>
        <input type="radio" name="uSex" value="女"<%if objCMS.uSex="女" then response.write " checked"%>>
        女 </td>
    </tr>
    <tr id="a"> 
      <td width="100" align="right" height="12">Email:</td>
      <td height="12"> 
        <input type="text" name="uEmail" maxlength="50" value="<%= objCMS.uEmail %>">
      </td>
    </tr>
    <tr id="a"> 
      <td width="100" align="right" height="12" bgcolor="#EEEEEE">OICQ:</td>
      <td height="12" bgcolor="#EEEEEE"> 
        <input type="text" name="uOicq" maxlength="50" value="<%= objCMS.uOicq %>">
      </td>
    </tr>
    <tr id="a"> 
      <td width="100" align="right" height="12">主页:</td>
      <td height="12"> 
        <input type="text" name="uHome" maxlength="50" value="<%= objCMS.uHome %>">
      </td>
    </tr>
    <tr id="a"> 
      <td width="100" align="right" height="12" bgcolor="#EEEEEE">电话:</td>
      <td height="12" bgcolor="#EEEEEE"> 
        <input type="text" name="uTel" maxlength="50" value="<%= objCMS.uTel %>">
      </td>
    </tr>
    <tr id="a"> 
      <td width="100" align="right" height="12">备注:</td>
      <td height="12"> 
        <textarea name="uComment" cols="40" rows="3"><%= objCMS.uComment %></textarea>
      </td>
    </tr>
    <tr id="a"> 
      <td width="100" align="right" height="12" bgcolor="#EEEEEE">级别:</td>
      <td height="12" bgcolor="#EEEEEE"> 
        <select name="uLevel">
          <option value="0">普通用户</option>
          <option value="1"<%if objCMS.uLevel="1" then response.write " selected"%>>管理员</option>
        </select>
      </td>
    </tr>
    <tr id="c2" class="hidden"> 
      <td colspan="2"> 
        <table width="100%" border="0" cellspacing="0" cellpadding="2">
          <tr bgcolor="#EEEEEE"> 
            <td width="50%">系统权限</td>
            <td width="50%" colspan=2>&nbsp;</td>
          </tr>
          <%
		  objCMS.SystemPower()
		  %>
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="2">
          <tr> 
            <td colspan="6">信息权限</td>
          </tr>
          <tr> 
            <td width="33%" bgcolor="#EEEEEE">信息类别</td>
            <td width="15%" bgcolor="#EEEEEE">添加权</td>
            <td width="13%" bgcolor="#EEEEEE">编辑权</td>
            <td width="14%" bgcolor="#EEEEEE">删除权</td>
            <td width="9%" bgcolor="#EEEEEE">审核权</td>
            <td width="16%" bgcolor="#EEEEEE">评论管理权</td>
          </tr>
          <%objCMS.InfoPower'显示该用户信息权限 %>
          <tr> 
            <td width="33%" bgcolor="#EEEEEE">&nbsp;</td>
            <td colspan="5" bgcolor="#EEEEEE">说明: 
              <input type="checkbox">
              框表示该栏目&amp;类别本身管理 
              <input type="checkbox" class="e">
              框表示具体信息的管理 </td>
          </tr>
        </table>
      </td>
    </tr>
	<tr id="c2" class="hidden" colspan="2"> 
	</tr>
    <tr> 
      <td align="center" colspan="2" bgcolor="#CCCCCC"> 
        <input type="hidden" name="uID" value="<%= uID %>">
        <input type="hidden" name="P" value="<%= P %>">
        <input type="submit" name="S1" value=" 提交 ">
        <input type="button" name="S2" value=" 取消 " onclick="history.back();">
      </td>
    </tr>
  </table>
</form>
<%
		end if
	end if
	
	objCMS.CloseDB	
else
	objCMS.OutInfo "对不起,您还没有登录,请先登录","Login"
end if
set objCMS=nothing
%>
</body>
</html>

⌨️ 快捷键说明

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