ATB Source Codes

Like webmaster forums Show admin_login.asp Source code

Return Download Like webmaster forums: download admin_login.asp Source code - Download Like webmaster forums Source code - Type:.asp
  1. <!--#include file="Conn.asp"-->
  2. <!-- #include file="inc/const.asp" -->
  3. <!-- #include file="inc/md5.asp" -->
  4. <!-- #include file="inc/myadmin.asp" -->
  5. <%
  6. Rem ===============================================================
  7. Rem 开启使用允许IP登陆功能 Chk_IPLogin : 0- 关闭,1=开启
  8. Const Chk_IPLogin = 1
  9. Rem ===============================================================
  10.  
  11. Dim Rs,sql,i
  12. Dvbbs.LoadTemplates("")
  13. Set Rs=Dvbbs.Execute("Select H_Content From Dv_Help Where H_ID=1")
  14. template.value = Rs(0)
  15.  
  16. Dvbbs.Stats="论坛管理登录"
  17.  
  18. Admin_Login()
  19.  
  20. Sub Admin_Login()
  21.         'Response.Write Dvbbs.CacheData(33,0)
  22.         Dvbbs.Head()
  23.  
  24.         If (Dvbbs.GroupSetting(70)="1" and Dvbbs.UserGroupID>1 and Dvbbs.UserID>0) or Dvbbs.Master or Dvbbs.UserID=0  Then
  25.                 Dvbbs.Master = True
  26.         Else
  27.                 Dvbbs.Master = False
  28.         End If
  29.         If Not Dvbbs.Master Then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>您不是系统管理员!"
  30.  
  31.         If Dvbbs.Master And Session("flag")<>"" Then Response.Redirect Dvbbs.CacheData(33,0) & "index.asp"
  32.         If Request.form("reaction")="chklogin" Then
  33.                 ChkLogin()
  34.         Else
  35.                 Admin_Login_Main()
  36.         End If
  37. End Sub
  38.  
  39. Sub Admin_Login_Main()
  40.         Dim version
  41.         If IsSqlDataBase = 1 Then version="SQL 版" Else version="ACCESS 版"
  42.         Response.Write Replace(template.html(1),"{$path}",Dvbbs.CacheData(33,0) & "images/")
  43. %>
  44. <p>&nbsp;</p>
  45. <p>&nbsp;</p>
  46. <form action="admin_login.asp" method="post">
  47. <Input name="reaction" type="hidden" value="chklogin">
  48. <table cellpadding="1" cellspacing="0" border="0" align=center style="border: outset 3px;width:0;">
  49. <tr>
  50.         <td>
  51.         <table style="width:500" border=0 cellspacing=0 cellpadding=3 align=center class=tablefoot>
  52.                 <tr><th valign=middle colspan=2 height=25><%=dvbbs.Forum_info(0)%>管理登录</th></tr>
  53.         </table>
  54.         <table style="width:500" border=0 cellspacing=0 cellpadding=3 align=center class=tablefoot>
  55.         <tr>
  56.         <td valign=middle colspan=2 align=center class=forumRowHighlight style="background-image: url(<%=Dvbbs.CacheData(33,0)%>images/loginbg.jpg);" height="75">
  57.                 <table border="0" width="100%" height="100%">
  58.                 <tr>
  59.                 <td width="61%" height="100%" rowspan="3"></td>
  60.                 <td width="39%" height="0"></td>
  61.                 </tr>
  62.                 <tr>
  63.                 <td height="" valign=top class=tdfoot style=""><BR><a href="index.asp"><b><%=Dvbbs.Forum_info(0)%></b></a><br>版本:Dvbbs v7.1.0 <%If Dvbbs.UserID>0 Then Response.Write Version%></td>
  64.                 </tr>
  65.                 <tr><td height=""></td></tr>
  66.                 </table>
  67.         </td>
  68.         </tr>
  69.         </table>
  70.         <table style="width:500" border=0 cellspacing=0 cellpadding=3 align=center>
  71.         <tr>
  72.         <td valign=middle colspan=2 align=center class=forumRowHighlight height=4></td>
  73.         </tr>
  74.         <%If Dvbbs.UserID=0 Or (Dvbbs.UserGroupID>1 And Dvbbs.GroupSetting(70)="0") Then%>
  75.         <tr>
  76.         <td valign=middle class=forumRow width="30%" align=right><b>前台用户名:</b></td>
  77.         <td valign=middle class=forumRow><Input name=adduser type=text value=""></td></tr>
  78.         <tr>
  79.         <td valign=middle class=forumRow align=right><b>前台密码:</b></font></td>
  80.         <td valign=middle class=forumRow><Input name=password2 type=password></td></tr>
  81.         <%End If%>
  82.         <tr>
  83.         <td valign=middle class=forumRow width="30%" align=right><b>用户名:</b></td>
  84.         <td valign=middle class=forumRow><Input name=username type=text></td></tr>
  85.         <tr>
  86.         <td valign=middle class=forumRow align=right><b>密 码:</b></font></td>
  87.         <td valign=middle class=forumRow><Input name=password type=password></td></tr>
  88.         <tr>
  89.         <td valign=middle class=forumRow align=right><b>附加码:</b></td>
  90.         <td valign=middle class=forumRow><Input name=verifycode type=text>&nbsp;请在附加码框输入 <img src="Dv_getcode.asp"></td></tr>
  91.         <tr>
  92.         <td valign=middle colspan=2 align=center class=forumRowHighlight><input class=button type=submit name=submit value="登 录"></td>
  93.         </tr>
  94.         </table>
  95.         </td>
  96. </tr>
  97. </table>
  98. </form>
  99.  
  100. </body>
  101. </html>
  102. <%
  103.  
  104. End Sub
  105.  
  106. Sub ChkLogin()
  107.         Dim ip
  108.         Dim UserName
  109.         Dim PassWord
  110.         UserName=Replace(Request("username"),"'","")
  111.         PassWord=md5(request("password"),16)
  112.         If Request("verifycode")="" Then
  113.                 Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>请返回输入确认码。<b>返回后请刷新登录页面后重新输入正确的信息。</b>"
  114.                 Exit Sub
  115.         Elseif Session("getcode")="9999" then
  116.                 Session("getcode")=""
  117.         Elseif Session("getcode")="" then
  118.                 Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>请不要重复提交,如需重新登录请返回登录页面。<b>返回后请刷新登录页面后重新输入正确的信息。</b>"
  119.                 Exit Sub
  120.         ElseIf Cstr(Session("getcode"))<>Cstr(Trim(Request("verifycode"))) Then
  121.                 Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>您输入的确认码和系统产生的不一致,请重新输入。<b>返回后请刷新登录页面后重新输入正确的信息。</b>"
  122.                 Exit Sub
  123.         End If
  124.         Session("getcode")=""
  125.         if UserName="" Or PassWord="" Then
  126.                 Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>请输入您的用户名或密码。<b>返回后请刷新登录页面后重新输入正确的信息。</b>"
  127.                 Exit Sub
  128.         End If
  129.         ip=Dvbbs.UserTrueIP
  130.         Dim MemberName
  131.         If Dvbbs.MemberName=""  Or Request("adduser") <>"" Then
  132.                 MemberName=Dvbbs.Checkstr(Request("adduser"))
  133.         Else
  134.                 MemberName=Dvbbs.MemberName
  135.         End If
  136.         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&"'")
  137.         If Rs.Eof And Rs.Bof Then
  138.                 Rs.Close
  139.                 Set Rs=Nothing
  140.                 Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>您输入的用户名和密码不正确或者您不是系统管理员。请<a href=admin_login.asp>重新输入</a>您的密码。<b>返回后请刷新登录页面后重新输入正确的信息。</b>"
  141.                 Exit Sub
  142.         Else
  143.                 If Rs("AcceptIP")<>"" And Chk_IPLogin=1 Then
  144.                         If ChkLoginIP(Rs("AcceptIP"),ip)=False Then
  145.                                 Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>你不是合法的后台管理员。请<a href=admin_login.asp>重新输入</a>您的密码。"
  146.                                 Exit Sub
  147.                         End If
  148.                 End If
  149.                 If Trim(Rs("password"))<>PassWord then
  150.                         Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>您输入的用户名和密码不正确或者您不是系统管理员。请<a href=admin_login.asp>重新输入</a>您的密码。<b>返回后请刷新登录页面后重新输入正确的信息。</b>"
  151.                         Exit Sub
  152.                 Else
  153.                         If Dvbbs.MemberName=""  Or Request("adduser") <>"" Then
  154.                                 If Trim(Rs("userpassword"))<>md5(Request("password2"),16) Then
  155.                                         Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>您输入的用户名和密码不正确或者您不是系统管理员。请<a href=admin_login.asp>重新输入</a>您的密码。<b>返回后请刷新登录页面后重新输入正确的信息。</b>"          
  156.                                         Exit Sub
  157.                                 End If
  158.                         End If
  159.                         Dim Rs1 '在此验证GroupSetting(70),轻飘飘
  160.                         Set Rs1=Dvbbs.Execute("Select GroupSetting From Dv_UserGroups Where UserGroupID="&Rs("usergroupid"))
  161.                         If Rs1.Eof Or Rs1.Bof Then
  162.                                 Rs.Close
  163.                                 Set Rs=Nothing
  164.                                 Set Rs1=Nothing
  165.                                 Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>您输入的用户名和密码不正确或者您不是系统管理员。请<a href=admin_login.asp>重新输入</a>您的密码。<b>返回后请刷新登录页面后重新输入正确的信息。</b>"
  166.                         Else
  167.                                 If Split(Rs1(0),",")(70)="1" Then
  168.                                         Dvbbs.Execute("Update "&admintable&" Set LastLogin="&SqlNowString&",LastLoginIP='"&ip&"' Where UserName='"&UserName&"'")
  169.                                         Session("flag")=Rs("flag")
  170.                                         Session.Timeout=45
  171.                                         Session("MemberName")=MemberName
  172.                                         Response.Redirect Dvbbs.CacheData(33,0) & "index.asp"
  173.                                 Else
  174.                                         Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>您没有登陆后台管理的权限!"
  175.                                 End If
  176.                         End If         
  177.                         Rs.Close
  178.                         Set Rs=Nothing
  179.                         Set Rs1=Nothing
  180.                 End If
  181.         End If
  182. End Sub
  183.  
  184. Function ChkLoginIP(AcceptIP,ChkIp)
  185.         Dim i,LoginIP,TempIP
  186.         ChkLoginIP = False
  187.         If Instr("|"&AcceptIP&"|","|"&ChkIp&"|") Then ChkLoginIP = True : Exit Function
  188.         LoginIP = Split(ChkIp,".")
  189.         TempIP = LoginIP(0)&"."&LoginIP(1)&"."&LoginIP(2)&".*"
  190.         If Instr("|"&AcceptIP&"|","|"&TempIP&"|") Then ChkLoginIP = True : Exit Function
  191.         TempIP = LoginIP(0)&"."&LoginIP(1)&".*.*"
  192.         If Instr("|"&AcceptIP&"|","|"&TempIP&"|") Then ChkLoginIP = True : Exit Function
  193.         TempIP = LoginIP(0)&".*.*.*"
  194.         If Instr("|"&AcceptIP&"|","|"&TempIP&"|") Then ChkLoginIP = True : Exit Function
  195. End Function
  196.  
  197. %>
downloadadmin_login.asp Source code - Download Like webmaster forums Source code
Related Source Codes/Software:
Quanzhou China networks limited - Admin admin admin 21.45KB
Love agent shop navigation friendship China buffet chain V1.0 - Fully functional, application link, points into on... 4.34KB
Source of party and Government official open source Government TS version v1.0 - I am a Government webmaster, not a computer traini... 10.95KB
Sunzhuang town government - Simple and practical! 5.15KB
160 Shenzhen rental rental information network - Rental information network-a very good site, which... 79.99KB
Journey of legends ASP.NET version system - Abbreviation for Cms is a Content Management Syste... 18.45KB
M media corporate website system v3.5.2 - M media on the powerful systems in addition to foc... 5.69KB
M media enterprise open source Web System v1.0.0 - M media on the powerful systems in addition to foc... 4.9KB
M media management system voted v2.1.0 - As computer and electronic communications technolo... 6.01KB
Chinese women's network the entire station source code - A woman's Web site package download, and a present... 22.95KB
China source download System v1.0 - This 3-to beautify the program downloaded by the i... 5.26KB
Ganzhou Windows network - Cover feature:Windows Home | News vertical and... 34.61KB
Strains of strain of beautiful personal home page Build20061004 - -----------Modified part-------------1: added ... 7.7KB
Southwest agricultural information network - Southwest agricultural information network, an agr... 98.89KB
ZWMOBI 3G mobile station system - Powerful business modules, including mobile B2C mo... 3.89KB
As a campus site system v2.0 - For most school,, to built features powerful of ma... 44.88KB
Evening student seating system 7 - Evening student seating system is facilitated the ... 26.4KB
94KK be reluctant network community beautification bate3 (new year Edition) - Kernel KB 94kkBBS Forum, new landscaping, further ... 24.82KB
QQ Flash Word - 1. powerful DIY feature, which is now immeasurably... 67KB
Zoomla! Eall CMS v2.0 - Waves CMS is committed to providing our webmasters... 11.31KB

 Back to top