www.gusucode.com > 共享世纪内容管理系统 2.1 build 080704 全站开源版 > admin/websyslogin.asp

    <%@language=vbscript codepage=936 %>
<!--#include file="mdb_path_user.asp"-->
<!--#include file="config.asp"-->
<!--#include file="MD5.asp"-->
<%
'-----------------彩色验证码---------------------
'If request("GetCode")="" or isnull(request("GetCode")) then
'	LoginMgs="请输入您的验证码。"
'else
'	if int(request("GetCode"))<>int(Session("GetCode")) then LoginMgs="您的验证码不正确。"
'end if
'------------------------------------------------
Logintype="用户登陆"
if request("Type")="logout" then
Logintype="退出登陆"
LoginMgs="成功:退出登陆成功!"
if Session("xoYuStudioAdminName")<>"" then
Session("xoYuStudioAdminName")  =""
Session("xoYuStudioAdminDj")=""
response.cookies("xoYuStudioUserSoftUrl")=""
end if
if request.cookies("xoYuStudioUserName")<>"" then
response.cookies("xoYuStudioUserName")  =""
response.cookies("xoYuStudioUserDj")=""
end if
elseif request("Type")="login" then
server_vv=len(Request.ServerVariables("SERVER_NAME"))
server_v1=left(Cstr(Request.ServerVariables("HTTP_REFERER")),server_vv)
server_v2=left(Cstr("http://"&Request.ServerVariables("SERVER_NAME")),server_vv)
if server_v1<>server_v2 or server_v1="" or server_v1="" then
response.write("<script>alert('错误:禁止从站点外部提交数据!.')</script>")
response.end
end if
  if request.form("user")<>"" and request.form("pwd")<>"" and request.form("getcode")<>"" then
  user=replace(request("user")," ","+++ close")
  pwd=md5(replace(request("pwd")," ","+++ close"))
  set rs=server.createobject("adodb.recordset")
  rs.open "select * from UserInfo where user='"&user&"' and pwd='"&pwd&"'",conn,1,1
  thesoft=Request.ServerVariables("HTTP_USER_AGENT")
  
  if instr(thesoft,"Windows NT 5.0") then
	vOS="Win 2000"
elseif instr(thesoft,"Windows NT 5.1") then
	vOs="Win XP"
elseif instr(thesoft,"Windows NT") then
	vOs="Win NT"
elseif instr(thesoft,"Windows 9") then
	vOs="Win 9x"
elseif instr(thesoft,"unix") or instr(thesoft,"linux") or instr(thesoft,"SunOS") or instr(thesoft,"BSD") then
	vOs="类Unix"
elseif instr(thesoft,"Mac") then
	vOs="Mac"
else
	vOs="Other"
end if

  if not rs.eof then
    if pwd=rs("pwd") and user=rs("user") and int(request("GetCode"))=int(Session("GetCode")) then
      xoYuStudioDj=rs("dj")
      if xoYuStudioDj=0 or xoYuStudioDj=1 or xoYuStudioDj=2 or xoYuStudioDj=3 or xoYuStudioDj=4 then
        if rs("lock")=1 then
          LoginMgs="错误:帐号 "&user&" 已被锁定,你不能登陆!请联系站长。"
        else
          LoginMgs="成功:帐号 "&user&" <br>登 录 成 功!"
		  '设置登陆时间,单位是秒
		  'Server.ScriptTimeout = 1800
          if xoYuStudioDj=0 then SF="普通会员"
          if xoYuStudioDj=1 then SF="认证会员"
          if xoYuStudioDj=2 then SF="栏目管理员"
          if xoYuStudioDj=3 then SF="系统管理员"
          if xoYuStudioDj=4 then SF="超级管理员"
          response.cookies("xoYuStudioUserName")=rs("user")
          response.cookies("xoYuStudioUserDj")=rs("dj")
          if xoYuStudioDj=2 or xoYuStudioDj=3 or xoYuStudioDj=4 then
                      if rs("softurl")<>"" then
            response.cookies("xoYuStudioUserSoftUrl")=rs("softurl")
            end if
            Session("xoYuStudioAdminName")=rs("user")
            Session("xoYuStudioAdminDj")=rs("dj")
            Session("xoYuStudioAdminAdmin")=rs("admin")
            Session("xoYuType")=rs("type")
            UserId = rs("id")
  set rs1=Server.Createobject("adodb.recordset")
   sql1="Select * from Log"
   rs1.open sql1,conn,3,3
   rs1.addnew
   rs1("User")=rs("user")
   rs1("LoginIP")=request.ServerVariables("Remote_Addr")
   rs1("OS")=vOS
   rs1.update
   rs1.close
          end if
        end if
      else
        LoginMgs="错误:你的用户等级错误,不能登陆,请与站长联系!"
   set rs1=Server.Createobject("adodb.recordset")
   sql1="Select * from Log"
   rs1.open sql1,conn,3,3
   rs1.addnew
   rs1("User")=Request.Form("User")
   rs1("LoginIP")=request.ServerVariables("Remote_Addr")
   rs1("OS")=vOS
   rs1("ErrorPas")=Request.Form("pwd")
   rs1("Result")="Error"
   rs1.update
   rs1.close
      end if
    else
      LoginMgs="错误:用户名|密码|验证码错误!"
   set rs1=Server.Createobject("adodb.recordset")
   sql1="Select * from Log"
   rs1.open sql1,conn,3,3
   rs1.addnew
   rs1("User")=Request.Form("User")
   rs1("LoginIP")=request.ServerVariables("Remote_Addr")
   rs1("OS")=vOS
   rs1("ErrorPas")=Request.Form("pwd")
   rs1("Result")="Error"
   rs1.update
   rs1.close
    end if
  else
    LoginMgs="错误:用户名|密码|验证码错误!"
   set rs1=Server.Createobject("adodb.recordset")
   sql1="Select * from Log"
   rs1.open sql1,conn,3,3
   rs1.addnew
   rs1("User")=Request.Form("User")
   rs1("LoginIP")=request.ServerVariables("Remote_Addr")
   rs1("OS")=vOS
   rs1("ErrorPas")=Request.Form("pwd")
   rs1("Result")="Error"
   rs1.update
   rs1.close
  end if
  rs.close
  set rs=nothing
  conn.close
  set conn=nothing
  else
    LoginMgs="错误:用户名|密码|验证码都不能为空!"
  end if
end if

%>
<html>

<head>
<title><%=Logintype%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="admin.css" type="text/css">
</head>
<body topmargin="10" leftmargin="0" bgcolor="#FFFFFF" text="#000000">
<form method="post" action="websyslogin.asp?Type=login" target="_top">
<div align="center">
<center>
<table border="0" class="tableBorder" cellpadding="2" cellspacing="1" width="300" align="center">
  <tr>
    <th class="tableHeaderText" colspan=2 height=25 width="592">共享世纪后台管理登陆</th>

  </tr>
  
<%if LoginMgs<>"" then%>
  <tr>
    <td width="120" bgcolor="#FFFFFF">
    <p align="center"><img src="images/admin.jpg" border="0"></td>
    <td width="467" bgcolor="#FFFFFF">
    <font color="#FF0000">·</font><%=LoginMgs%>
    <%if SF<>"" then%><br><font color="#FF0000">·</font>身份:<font color="#008080"><%=SF%></font><%
    if xoYuStudioDj="2" or xoYuStudioDj="3" or xoYuStudioDj="4"then%>
    <br><font color="#FF0000">·</font><a href="websysindex.asp">进入系统管理中心</a><%else
    %><br><font color="#FF0000">·</font><a href="../">返回首页</a><%end if%>
    <br><font color="#FF0000">·</font><%if webuseredit="1" then%><a href="edit.asp"><%end if%>修改个人资料</a>
    <br><font color="#FF0000">·</font><a href="websyslogin.asp?Type=logout">退出登陆</a>
    <br><font color="#FF0000">·</font><a href="websyslogin.asp">重新登陆</a><%end if%></td>
  </tr>
<%else%>
  <tr>
    <td width="592" bgcolor="#FFFFFF" colspan="2">
    <table width="100%" height="68" border="0" align="center" cellpadding="2" cellspacing="0" class="forumRow" style="border-collapse: collapse">
      <tr>
        <td width="50%" align="center" height="20">
        <p align="right">用户名<font color="#000000">(<span class="big">U</span>)</font>:<input name="user" maxlength="20" size="15"></td>
        <td width="50%" align="center" height="20"> </td>
      </tr>
      <tr>
        <td width="50%" align="center" height="20">
        <p align="right">密&nbsp;&nbsp;码<font color="#000000">(<span class="big">P</span>)</font>:<input type="password" name="pwd" maxlength="20" size="15"></td>
        <td width="50%" align="center" height="20"> </td>
      </tr>
      <tr>
        <td width="64%" align="center" height="16">
        <p align="right">验证码<font color="#000000">(<span class="big">Y</span>)</font>:<input name="GetCode" maxlength="20" size="15"></td>
        <td width="36%" align="center" height="16">
        <img src="code.asp" width="38" height="10" align="left"></td>
      </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td width="592" colspan="2">
    <p align="center">
              <input type="submit" name="Submit" value="管 理 登 陆">
              &nbsp;
              <input type="button" name="Submit1" <%if webreg="1" then%>onclick="javascript:location.href='../reg.asp'"<%else%>disabled<%end if%> value="用 户 注 册">
          </td>
  </tr>
<%end if%>
<tr>
          <td width="592" colspan="2"> <p align="right">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;·系统版本:<%=version%>&nbsp;<%=edition%>              &nbsp;</td>
  </tr>
</table>
</center>
</div>
</form>
</body>
</html>