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

📄 manager_mdy.asp

📁 一个很好的asp cms管理系统
💻 ASP
字号:
<%
Option Explicit
'----------------------------------------------------------------------------------
'本页:
'   用户编辑页面
'说明:
'
'----------------------------------------------------------------------------------
%>
<!--#include file="inc/Config.class.asp"-->
<!--#include file="inc/DBControl.class.asp"-->
<!--#include file="inc/FunctionLib.class.asp"-->
<!--#include file="inc/Manager.class.asp"-->
<%
Dim Cfg, Db, FLib, Admin
Set Cfg = New Config
Set Db = New DBControl
Set FLib = New FunctionLib
Set Admin = New Manager

If Not Admin.Logined Then
    FLib.Alert "对不起,你已经超时或未登录","./",1
    Response.End
End If

If Not Admin.CheckPopedom("TSYS_GROUP1_OTHER_RES") AND NOT Admin.CheckPopedom("TSYS_GROUP2_OTHER_RES") Then
    FLib.Alert "权限不足", "BACK", 0
    Response.End
End If

Dim Work
    Work = Request("Work")

Db.Open()
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="inc/style.css" type="text/css">
<SCRIPT LANGUAGE="JavaScript" src="inc/FunctionLib.js"></script>
<SCRIPT LANGUAGE="JavaScript">
<!--
function RoleChange(obj)
{
    if(obj.options[obj.selectedIndex].value == -1)
    {
        if(confirm("是否离开本页?"))
        {
            self.location.href='Manager_List.asp';
            return true;
        }else{
            return false;
        }
    }
}

function chkForm_AddReco(obj)
{
    if(!Check_UserName(obj.title.value))
    {
        alert("[用户名]格式有误");
        obj.title.focus();
        return false;
    }

    if(obj.pwd.value == "")
    {
        alert("请填写[密码]");
        obj.pwd.focus();
        return false;
    }

    return true;
}

function chkForm_MdyReco(obj)
{
    if(!Check_UserName(obj.title.value))
    {
        alert("[用户名]格式有误");
        obj.title.focus();
        return false;
    }

    if(obj.pwd.value == "")
    {
        alert("请填写[密码]");
        obj.pwd.focus();
        return false;
    }

    return true;
}

function chkForm_MdyPwd(obj)
{
    if(obj.pwd.value == "" || obj.pwd1.value == "")
    {
        alert("请完整填写[旧密码]和[新密码]");
        return false;
    }
}
//-->
</SCRIPT>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<%
Select Case Work
    Case "MdyPwd" :
        MdyPwd()
    Case "AddReco" :
        AddReco()
    Case "MdyReco" :
        MdyReco()
End Select

Function AddReco()
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabTitleBar">
  <tr>
    <td>系统管理 &gt; 用户管理 &gt; 增加用户</td>
  </tr>
</table>
<form name="form1" method="post" action="Manager_Process.asp" onsubmit="return chkForm_AddReco(this)">
  <table width="700" border="0" cellspacing="0" cellpadding="3">
    <tr> 
      <td width="25%" align="right">用户名:</td>
      <td width="75%"> <input name="title" type="text" class="input_text" size="40"> <span class="txtNote">必须为[a-z、0-9和下划线]的组合</span></td>
    </tr>
    <tr> 
      <td width="25%" align="right">密码:</td>
      <td width="75%"> <input name="pwd" type="text" class="input_text" size="40"> </td>
    </tr>
    <tr> 
      <td width="25%" align="right">备注:</td>
      <td width="75%"> <input name="remark" type="text" class="input_text" size="40"> </td>
    </tr>
    <tr> 
      <td width="25%" align="right">角色:</td>
      <td width="75%"> <select name="pope_role" class="select_list" onchange="RoleChange(this)">
          <%Role_List -1%>
        </select> </td>
    </tr>
    <tr> 
      <td width="25%" align="right" valign="top">&nbsp;</td>
      <td width="75%">&nbsp;</td>
    </tr>
    <tr> 
      <td width="25%" align="right" valign="top">&nbsp; </td>
      <td width="75%"> <input name="Submit43" type="submit" class="input_button" value="提  交"> <input name="Submit223" type="reset" class="input_button" value="复位"> 
        <input name="Submit323" type="button" class="input_button" onClick="window.history.back()" value="返回"> 
        <input type="hidden" name="Work" value="AddReco"> </td>
    </tr>
  </table>
</form>
<%
End Function

Function MdyReco()

    Dim Sql, Rs, uId
        uId = FLib.SafeSql(Request("uId"))

    Sql = "SELECT TOP 1 * FROM view_manager WHERE id=" & uId
    Set Rs = Db.ExeCute(Sql)

    If Rs.Eof And Rs.Bof Then
        Rs.Close
        Set Rs = Nothing
        FLib.Alert "用户不存在", "BACK", 0
        Response.End
    End If
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabTitleBar">
  <tr>
    <td>系统管理 &gt; 用户管理 &gt; 修改用户</td>
  </tr>
</table>
<form name="form1" method="post" action="Manager_Process.asp" onsubmit="return chkForm_MdyReco(this)">
  <table width="700" border="0" cellspacing="0" cellpadding="3">
    <tr> 
      <td width="25%" align="right">用户名:</td>
      <td width="75%"><b><%=Rs("title")%></b></td>
    </tr>
    <tr> 
      <td width="25%" align="right">密码:</td>
      <td width="75%"> [已加密,<A HREF="?Work=MdyPwd&title=<%=Rs("title")%>">修改密码</A>] 
      </td>
    </tr>
    <tr> 
      <td width="25%" align="right">备注:</td>
      <td width="75%"> <input name="remark" type="text" class="input_text" value="<%=Rs("remark")%>" size="40"> 
      </td>
    </tr>
    <tr> 
      <td width="25%" align="right">角色:</td>
      <td width="75%"> <select name="pope_role" class="select_list" onchange="RoleChange(this)">
          <%Role_List Rs("pope_role")%>
        </select> </td>
    </tr>
    <tr> 
      <td align="right">权限策略:</td>
      <td><a href="Other_PopeTacticsCreator.asp?Work=MdyReco&sKey=<%=Rs("title")%>&PTType=Manager">点这里调整权限策略</a></td>
    </tr>
    <tr> 
      <td width="25%" align="right" valign="top">&nbsp;</td>
      <td width="75%">&nbsp;</td>
    </tr>
    <tr> 
      <td width="25%" align="right" valign="top">&nbsp; </td>
      <td width="75%"> <input name="Submit42" type="submit" class="input_button" value="提  交"> <input name="Submit222" type="reset" class="input_button" value="复位"> 
        <input name="Submit322" type="button" class="input_button" onClick="window.history.back()" value="返回"> 
        <input type="hidden" name="Work" value="MdyReco"> <input name="title" type="hidden" id="title" value="<%=Rs("title")%>"> 
      </td>
    </tr>
  </table>
</form>
<%
    Rs.Close
    Set Rs = Nothing
End Function

Function MdyPwd()
    If Not Admin.CheckPopedom("TSYS_GROUP1_PWD") Then
        FLib.Alert "权限不足", "BACK", 0
        Response.End
    ENd If
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabTitleBar">
  <tr> 
    <td>用户管理 &gt; 修改密码</td>
  </tr>
</table>
<form name="form2" method="post" action="Manager_Process.asp" onsubmit="return chkForm_MdyPwd(this)">
  <table width="700" border="0" cellspacing="0" cellpadding="3">
    <tr> 
      <td width="25%" align="right">用户名:</td>
      <td width="75%"> 
        <input name="title" type="text" class="input_text" value="<%=Request("title")%>" size="40" readonly="true">
      </td>
    </tr>
    <tr> 
      <td width="25%" align="right">旧密码:</td>
      <td width="75%"> 
        <input name="pwd" type="password" class="input_text" size="40">
      </td>
    </tr>
    <tr> 
      <td width="25%" align="right">新密码:</td>
      <td width="75%"> 
        <input name="pwd1" type="text" class="input_text" size="40">
      </td>
    </tr>
    <tr> 
      <td width="25%" align="right">&nbsp;</td>
      <td width="75%">&nbsp;</td>
    </tr>
    <tr>
      <td width="25%" align="right">&nbsp;</td>
      <td width="75%">
        <input type="submit" name="Submit4" value="提  交">
        <input type="reset" name="Submit22" value="复位">
        <input type="button" name="Submit32" value="返回" onclick="window.history.back()">
        <input type="hidden" name="Work" value="MdyPwd">
      </td>
    </tr>
  </table>
</form>
<%
End Function
%>
</body>
</html>
<%
Function Role_List(rId)
    Dim Sql, Rs, strChecked
    Sql = "SELECT id,title,remark FROM popedom_role"
    Set Rs = Db.ExeCute(Sql)

    If (rId = -1) Or (Rs.Eof And Rs.Bof) Then
        Response.Write "<option value="""" selected>    </option>" & vbCrLf
    Else
        Response.Write "<option value="""">    </option>" & vbCrLf
    End If

    While Not Rs.Eof
        If Rs("id") = rId Then
            strChecked = "selected"
        Else
            strChecked = ""
        End If
        Response.Write "<option value=""" & Rs("id") & """ " & strChecked & ">" & Rs("title") & "</option>" & vbCrLf
        Rs.MoveNext
    Wend

    Response.Write "<option value=""-1"" style=""background-color:#FFFFCC"">角色管理...</option>" & vbCrLf

    Rs.Close
    Set Rs = Nothing
End Function
%>

⌨️ 快捷键说明

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