Login.asp
资源名称:haohj.rar [点击查看]
上传用户:angela
上传日期:2022-05-11
资源大小:853k
文件大小:13k
源码类别:
外挂编程
开发平台:
ASP/ASPX
- <!--#include file="setup.asp"-->
- <!--#include file="Inc/Md5.asp"-->
- <%
- '=====================================================================
- ' 作者声明:转载请保留版权信息,鄙视不要脸的人
- '=====================================================================
- ' 程序名称:蓝宇网络发布系统
- ' 程序作者:蓝宇 QQ:18159079 ╲、随心゛ QQ:6821845
- ' 文件名称:Login.asp
- ' 更新日期:2007-6-5
- '=====================================================================
- ' 联系方式:Tel:13203117383,QQ:18159079,hi.baidu.com/hezeyu
- ' 程序开发:蓝宇,╲、随心゛
- ' 官方网站:蓝宇网络(http://hi.baidu.com/hezeyu)
- '=====================================================================
- ' Copyright 2004-2007 蓝宇 - All Rights Reserved.
- '=====================================================================
- Response.CacheControl = "no-cache"
- Dim loginok, RefreshTime, GetCode
- FoundErr = False
- loginok = 0 '是否开启登陆提示,1=开启,0=关闭
- RefreshTime = 3 '设置防刷新时间
- If DateDiff("s", Session("UserTime"), Now()) < RefreshTime Then
- Response.Write "<META http-equiv=Content-Type content=text/html; chaRset=gb2312><meta HTTP-EQUIV=REFRESH CONTENT="&RefreshTime&"><br>本页面起用了防刷新机制,请不要在"&RefreshTime&"秒内连续刷新本页面<BR>正在打开页面,请稍后……"
- Response.End
- End If
- FoundErr = False
- Select Case tee5.CheckStr(Request("action"))
- Case "logout" '退出系统
- Call logout()
- Case "login" '登陆系统
- Call chklogin()
- Case Else
- Call main()
- End Select
- If Founderr = True Then
- Session("UserTime") = Now()
- Response.Redirect("showerr.asp?action=error&message=" & Server.URLEncode(ErrMsg) & "")
- End If
- CloseConn
- Sub main()
- If Session("LoginName") = "" Then
- Response.Write "<html>"
- Response.Write "<head>"
- Response.Write "<meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312"">"
- Response.Write "<title>管理员登陆 - " & tee5.WebName & " - 诛仙私服</title>"
- Response.Write "<LINK href=""Images/Style.css"" type=text/css rel=stylesheet>"
- Response.Write "</head>"
- Response.Write "<script language=""javascript"">" & vbCrLf
- Response.Write "<!--//" & vbCrLf
- Response.Write "function SetFocus()" & vbCrLf
- Response.Write "{" & vbCrLf
- Response.Write "if (document.myform.LoginName.value=="""")" & vbCrLf
- Response.Write "document.myform.LoginName.focus();" & vbCrLf
- Response.Write "else" & vbCrLf
- Response.Write "document.myform.LoginName.select();" & vbCrLf
- Response.Write "}" & vbCrLf
- Response.Write "function CheckForm()" & vbCrLf
- Response.Write "{" & vbCrLf
- Response.Write "if(document.myform.LoginName.value=="""")" & vbCrLf
- Response.Write "{" & vbCrLf
- Response.Write "alert(""请输入您的用户名!"");" & vbCrLf
- Response.Write "document.myform.LoginName.focus();" & vbCrLf
- Response.Write "return false;" & vbCrLf
- Response.Write "}" & vbCrLf
- Response.Write "if(document.myform.password.value == """")" & vbCrLf
- Response.Write "{" & vbCrLf
- Response.Write "alert(""请输入您的密码!"");" & vbCrLf
- Response.Write "document.myform.password.focus();" & vbCrLf
- Response.Write "return false;" & vbCrLf
- Response.Write "}" & vbCrLf
- If IsAdminValidate Then
- Response.Write "if(document.myform.validate.value == """")" & vbCrLf
- Response.Write "{" & vbCrLf
- Response.Write "alert(""请输入您的认证码!"");" & vbCrLf
- Response.Write "document.myform.validate.focus();" & vbCrLf
- Response.Write "return false;" & vbCrLf
- Response.Write "}" & vbCrLf
- End If
- Response.Write "if (document.myform.verifycode.value==""""){" & vbCrLf
- Response.Write "alert (""请输入您的验证码!"");" & vbCrLf
- Response.Write "document.myform.verifycode.focus();" & vbCrLf
- Response.Write "return(false);" & vbCrLf
- Response.Write "}" & vbCrLf
- Response.Write "}" & vbCrLf
- Response.Write "function CheckBrowser()" & vbCrLf
- Response.Write "{" & vbCrLf
- Response.Write "var app=navigator.appName;" & vbCrLf
- Response.Write "var verStr=navigator.appVersion;" & vbCrLf
- Response.Write "if (app.indexOf('Netscape') != -1) {" & vbCrLf
- Response.Write "alert(""126诛仙私服友情提示:n 你使用的是Netscape浏览器,可能会导致无法使用后台的部分功能。建议您使用 IE6.0 或以上版本。"");" & vbCrLf
- Response.Write "}" & vbCrLf
- Response.Write "else if (app.indexOf('Microsoft') != -1) {" & vbCrLf
- Response.Write "if (verStr.indexOf(""MSIE 3.0"")!=-1 || verStr.indexOf(""MSIE 4.0"") != -1 || verStr.indexOf(""MSIE 5.0"") != -1 || verStr.indexOf(""MSIE 5.1"") != -1)" & vbCrLf
- Response.Write "alert(""126诛仙私服友情提示:n 您的浏览器版本太低,可能会导致无法使用后台的部分功能。建议您使用 IE6.0 或以上版本。"");" & vbCrLf
- Response.Write "}" & vbCrLf
- Response.Write "}" & vbCrLf
- Response.Write "//-->" & vbCrLf
- Response.Write "</script>"
- Response.Write "<body topmargin=""0"" leftmargin=""0"" rightmargin=""0"">"
- Response.Write "<p> </p>"
- Response.Write "<p> </p>"
- Response.Write "<table border=""0"" align=center cellpadding=""1"" cellspacing=""0"" bgcolor=""#FFFFFF"" style=""border: outset 3px;width:0;"">"
- Response.Write "<form name=myform method=""post"" action=""?action=login"" target=""_top"" onSubmit=""return CheckForm();"">"
- Response.Write "<tr>"
- Response.Write "<td><table width=""605"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"">"
- Response.Write "<tr>"
- Response.Write "<td colspan=""3"" height=""17"" background=""images/admin_login_r1_c1.jpg""></td>"
- Response.Write "</tr>"
- Response.Write "<tr>"
- Response.Write "<td width=""24"" valign=""top""><img src=""images/admin_login_r2_c1.jpg"" width=""23"" height=""212""></td>"
- Response.Write "<td width=""494"" align=""center"" valign=""top"" bgcolor=""#FFFFFF"">"
- Response.Write "<table width=""100%"" height=""100"" border=""0"" cellpadding=""0"" cellspacing=""0"">"
- Response.Write "<tr>"
- Response.Write "<td align=""right"" valign=""bottom"" background=""images/admin_login_r2_c2.jpg"" height=""100""></td>"
- Response.Write "</tr>"
- Response.Write "</table>"
- If IsAdminValidate Then
- Response.Write "<table width=""100%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""1"">"
- else
- Response.Write "<table width=""100%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""6"">"
- End If
- Response.Write "<tr>"
- Response.Write "<td width=""78%"" align=""left"">用户名: <input name=""LoginName"" type=""text"" size=""25"" style=""background-color: #F8F8F8;""></td>"
- Response.Write "</tr>"
- Response.Write "<tr>"
- Response.Write "<td align=""left"">密 码: <input name=""password"" type=""password"" size=""25"" style=""background-color: #F8F8F8;""></td>"
- Response.Write "</tr>"
- If IsAdminValidate Then
- Response.Write "<tr>"
- Response.Write "<td align=""left"">认证码: <input name=""validate"" type=""password"" size=""25"" style=""background-color: #F8F8F8;""></td>"
- Response.Write "</tr>"
- End If
- Response.Write "<tr>"
- Response.Write "<td align=""left"">附加码: <input name=""verifycode"" type=""text"" size=""8"" maxlength=""4"" value="""
- If GetCode=9999 Then Response.Write "9999"
- Response.Write """ style=""background-color: #F8F8F8;""> "
- Response.Write " 请在附加码框输入 <img src=""inc/Gqcode.asp"" alt=""验证码,看不清楚?请点击刷新验证码"" height=""10"" style=""cursor : pointer;"" onclick=""this.src='inc/Gqcode.asp'"" /></td>"
- Response.Write "</tr>"
- Response.Write "<tr>"
- Response.Write "<td align=""left"">"
- Response.Write "<input type='hidden' name='Action' value='Login'>"
- Response.Write "<input type=""submit"" name=""Submit"" value=""登陆系统"" class=button> "
- Response.Write "<input onclick=window.location.reload() type=button value=刷新本页 name=refresh class=button> "
- Response.Write "<input type=""button"" name=""Submit1"" onclick=""javascript:location.href='../'"" value=""返回首页"" class=button>"
- Response.Write "</td>"
- Response.Write "</tr>"
- Response.Write "</table></td>"
- Response.Write "<td width=""88"" valign=""top""><img src=""images/admin_login_r2_c3.jpg"" width=""88"" height=""212""></td>"
- Response.Write "</tr>"
- Response.Write "<tr>"
- Response.Write "<td colspan=""3"" align=""center"" height=""21"" background=""images/admin_login_r4_c1.jpg""></td>"
- Response.Write "</tr>"
- Response.Write "</table></td>"
- Response.Write "</tr>"
- Response.Write "</form>"
- Response.Write "</table>"
- Response.Write "<script language=""JavaScript"">" & vbCrLf
- Response.Write "<!--" & vbCrLf
- Response.Write "CheckBrowser();" & vbCrLf
- Response.Write "SetFocus();" & vbCrLf
- Response.Write "-->" & vbCrLf
- Response.Write "</script>"
- Response.Write "<p align=center></p>"
- Response.Write "</body>"
- Response.Write "</html>"
- Else
- Response.Redirect "admin_index.asp"
- End If
- End Sub
- Sub logout()
- '清除COOKIES中管理员身份的验证信息.
- 'Session.Abandon
- Session("LoginName") = ""
- Session("AdminPass") = ""
- Session("AdminGrade") = ""
- Session("AdminFlag") = ""
- Session("AdminStatus") = ""
- Session("AdminID") = ""
- Session("validate") = ""
- Session("AdminRandomCode") = ""
- Response.Cookies(Admin_Cookies_Name) = ""
- Response.Redirect ("../")
- End Sub
- Sub chklogin()
- Dim LoginName, password, RandomCode
- LoginName = tee5.CheckBadstr(Request("LoginName"))
- password = md5(Trim(Replace(Request("password"), "'", "")))
- RandomCode = tee5.CheckBadstr(Request("RandomCode"))
- If tee5.CheckPost = False Then
- ErrMsg = ErrMsg + "您提交的数据不合法,请不要从外部提交登陆!!!"
- Founderr = True
- End If
- If IsValidStr(Request("LoginName")) = False Then
- ErrMsg = ErrMsg + "<li>用户名中含有非法字符!</li>"
- Founderr = True
- End If
- If IsValidPassword(Request("password")) = False Then
- ErrMsg = ErrMsg + "<li>密码中含有非法字符!</li>"
- Founderr = True
- End If
- If IsAdminValidate Then
- If Trim(Request.Form("validate")) <> AdminValidateCode Or Trim(Request.Form("validate")) = "" Then
- ErrMsg = ErrMsg+"<li>您输入的认证码不正确,请重新输入!</li>"
- Founderr = true
- Exit Sub
- End if
- End If
- If Request("verifycode") = "" Then
- ErrMsg = ErrMsg + "<br>" + "<li>请返回输入确认码!</li>"
- Founderr = True
- ElseIf Session("getcode") = "9999" Then
- Session("getcode") = ""
- ErrMsg = ErrMsg + "<br>" + "<li>请不要重复提交,如需重新登陆请返回登陆页面!</li>"
- Founderr = True
- ElseIf CStr(Session("getcode"))<>CStr(Trim(Request("verifycode"))) Then
- ErrMsg = ErrMsg + "<br>" + "<li>您输入的验证码与系统产生的不一致,请重新输入!</li>"
- Founderr = True
- End If
- Session("getcode") = ""
- If LoginName = "" Or password = "" Then
- Founderr = True
- ErrMsg = ErrMsg + "<br>" + "<li>请输入您的用户名或密码。</li>"
- Exit Sub
- End If
- If Founderr = True Then Exit Sub
- If Not IsObject(Conn) Then ConnectionDatabase
- Set Rs = Server.CreateObject("ADODB.Recordset")
- SQL = "SELECT * FROM Gq_Admin WHERE AdminName='" & LoginName & "'"
- Rs.Open SQL, Conn, 1, 3
- If Rs.BOF And Rs.EOF Then
- FoundErr = True
- ErrMsg = ErrMsg + "<li>您输入的用户名不正确!</li>"
- Exit Sub
- Else
- If password <> Rs("password") Then
- FoundErr = True
- ErrMsg = ErrMsg + "<br><li>您输入的密码不正确!</li>"
- Exit Sub
- End If
- If Rs("isLock") <> 0 Or Rs("isLock") = "" Then
- Founderr = True
- ErrMsg = "<li><font color=red>抱歉,您的帐号已被锁定!如要开通,请联系高级管理员!</font></li>"
- Exit Sub
- End If
- End If
- RandomCode = tee5.GetRandomCode
- Rs("LoginTime") = Now()
- Rs("Loginip") = tee5.GetUserip
- Rs("RandomCode") = RandomCode
- Rs.Update
- If FoundErr = False Then
- Session("LoginName") = Rs("AdminName")
- Session("AdminPass") = Rs("password")
- Session("AdminGrade") = Rs("AdminGrade")
- Session("AdminFlag") = Rs("Authority")
- Session("AdminStatus") = Rs("Status")
- Session("AdminRandomCode") = RandomCode
- Session("AdminID") = Rs("id")
- If IsAdminValidate Then
- Session("validate") = Trim(Request.Form("validate"))
- End If
- If UseAdminCookies Then
- Response.Cookies(Admin_Cookies_Name)("LoginName") = Rs("AdminName")
- Response.Cookies(Admin_Cookies_Name)("AdminPass") = Rs("password")
- Response.Cookies(Admin_Cookies_Name)("AdminGrade") = Rs("AdminGrade")
- Response.Cookies(Admin_Cookies_Name)("AdminFlag") = Rs("Authority")
- Response.Cookies(Admin_Cookies_Name)("AdminStatus") = Rs("Status")
- Response.Cookies(Admin_Cookies_Name)("RandomCode") = RandomCode
- Response.Cookies(Admin_Cookies_Name)("AdminID") = Rs("ID")
- If IsAdminValidate Then
- Response.Cookies(Admin_Cookies_Name)("validate") = Trim(Request.Form("validate"))
- End If
- End If
- End If
- Rs.Close
- Set Rs = Nothing
- Response.Redirect ("admin_Index.asp")
- End Sub
- %>