<% Rem =============================================================== Rem 开启使用允许IP登陆功能 Chk_IPLogin : 0- 关闭,1=开启 Const Chk_IPLogin = 1 Rem =============================================================== Rem =============================================================== Rem CHECK_CODE 设置为1 开通登录验证码,设置为0关闭登录验证码,以方便视障人士如盲人等朋友使用。 Const CHECK_CODE=1 Rem =============================================================== Dim Rs,sql,i Dvbbs.LoadTemplates("Admin") template.ChildFolder="Admin" 'Set Rs=Dvbbs.Execute("Select H_Content From Dv_Help Where H_ID=1") 'Response.Write Rs(0) 'template.value = Rs(0) 'Response.End Dvbbs.Stats="论坛管理登录" Admin_Login() Dvbbs.PageEnd() Sub Admin_Login() 'Response.Write Dvbbs.CacheData(33,0) Dvbbs.Head() If (Dvbbs.GroupSetting(70)="1" and Dvbbs.UserGroupID>1 and Dvbbs.UserID>0) or Dvbbs.Master or Dvbbs.UserID=0 Then Dvbbs.Master = True Else Dvbbs.Master = False End If If Not Dvbbs.Master Then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=
  • 您不是系统管理员!" If Dvbbs.Master And Session("flag")<>"" Then Response.Redirect Dvbbs.CacheData(33,0) & "index.asp" If Request.form("reaction")="chklogin" Then ChkLogin() Else Admin_Login_Main() End If End Sub Sub Admin_Login_Main() Dim version If IsSqlDataBase = 1 Then version="SQL 版"&fversion Else version="ACCESS 版"&fversion 'Response.Write Replace(template.html(1),"{$path}",Dvbbs.CacheData(33,0) & "images/") Response.Write Replace(template.html(1),"{$path}","") %>
    <%=dvbbs.Forum_info(0)%> -- 管理登录
    <%If Dvbbs.UserID=0 Or (Dvbbs.UserGroupID>1 And Dvbbs.GroupSetting(70)="0") Then%> <%End If%> <%If CHECK_CODE=1 Then%> <%End If%>
    前台用户名:
    前台密码:
    用户名:
    密 码:
    附加码: <%=Dvbbs.GetCode%>
    <%=Dvbbs.Forum_info(0)%> <%If Dvbbs.UserID>0 Then Response.Write Version%>
    <% End Sub Sub ChkLogin() Dim ip Dim UserName Dim PassWord UserName=Replace(Request("username"),"'","") PassWord=md5(request("password"),16) If CHECK_CODE=1 Then If Request("codestr")="" Then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=
  • 请返回输入确认码。返回后请刷新登录页面后重新输入正确的信息。" Exit Sub Elseif Session("getcode")="9999" then Session("getcode")="" Elseif Session("getcode")="" then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=
  • 请不要重复提交,如需重新登录请返回登录页面。返回后请刷新登录页面后重新输入正确的信息。" Exit Sub ElseIf Cstr(Session("getcode"))<>Lcase(Cstr(Trim(Request("codestr")))) Then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=
  • 您输入的确认码和系统产生的不一致,请重新输入。返回后请刷新登录页面后重新输入正确的信息。" Exit Sub End If Session("getcode")="" End If if UserName="" Or PassWord="" Then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=
  • 请输入您的用户名或密码。返回后请刷新登录页面后重新输入正确的信息。" Exit Sub End If ip=Dvbbs.UserTrueIP Dim MemberName If Dvbbs.MemberName="" Or Request("adduser") <>"" Then MemberName=Dvbbs.Checkstr(Request("adduser")) Else MemberName=Dvbbs.MemberName End If Set Rs=Dvbbs.Execute("Select a.*,u.userpassword,u.usergroupid From "&admintable&" a Inner Join Dv_user u On a.adduser=u.userName Where a.UserName='"&username&"' And AddUser='"&MemberName&"'") If Rs.Eof And Rs.Bof Then Rs.Close Set Rs=Nothing Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=
  • 您输入的用户名和密码不正确或者您不是系统管理员。请重新输入您的密码。返回后请刷新登录页面后重新输入正确的信息。" Exit Sub Else If Rs("AcceptIP")<>"" And Chk_IPLogin=1 Then If ChkLoginIP(Rs("AcceptIP"),ip)=False Then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=
  • 你不是合法的后台管理员。请重新输入您的密码。" Exit Sub End If End If If Trim(Rs("password"))<>PassWord then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=
  • 您输入的用户名和密码不正确或者您不是系统管理员。请重新输入您的密码。返回后请刷新登录页面后重新输入正确的信息。" Exit Sub Else If Dvbbs.MemberName="" Or Request("adduser") <>"" Then If Trim(Rs("userpassword"))<>md5(Request("password2"),16) Then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=
  • 您输入的用户名和密码不正确或者您不是系统管理员。请重新输入您的密码。返回后请刷新登录页面后重新输入正确的信息。" Exit Sub End If End If Dim Rs1 '在此验证GroupSetting(70),轻飘飘 Set Rs1=Dvbbs.Execute("Select GroupSetting From Dv_UserGroups Where UserGroupID="&Rs("usergroupid")) If Rs1.Eof Or Rs1.Bof Then Rs.Close Set Rs=Nothing Set Rs1=Nothing Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=
  • 您输入的用户名和密码不正确或者您不是系统管理员。请重新输入您的密码。返回后请刷新登录页面后重新输入正确的信息。" Else If Split(Rs1(0),",")(70)="1" Then Dvbbs.Execute("Update "&admintable&" Set LastLogin="&SqlNowString&",LastLoginIP='"&ip&"' Where UserName='"&UserName&"'") Session("flag")=Rs("flag") Session.Timeout=45 Session("MemberName")=MemberName Response.Redirect Dvbbs.CacheData(33,0) & "index.asp" Else Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=
  • 您没有登陆后台管理的权限!" End If End If Rs.Close Set Rs=Nothing Set Rs1=Nothing End If End If End Sub Function ChkLoginIP(AcceptIP,ChkIp) Dim i,LoginIP,TempIP ChkLoginIP = False If Instr("|"&AcceptIP&"|","|"&ChkIp&"|") Then ChkLoginIP = True : Exit Function LoginIP = Split(ChkIp,".") TempIP = LoginIP(0)&"."&LoginIP(1)&"."&LoginIP(2)&".*" If Instr("|"&AcceptIP&"|","|"&TempIP&"|") Then ChkLoginIP = True : Exit Function TempIP = LoginIP(0)&"."&LoginIP(1)&".*.*" If Instr("|"&AcceptIP&"|","|"&TempIP&"|") Then ChkLoginIP = True : Exit Function TempIP = LoginIP(0)&".*.*.*" If Instr("|"&AcceptIP&"|","|"&TempIP&"|") Then ChkLoginIP = True : Exit Function End Function %>