<!DOCTYPE html>
<!-- 
'========================================================================================
' 文 件 名: admin_recover.asp
' 版    本: 岭峰网行业专用留言系统3.10.0 (LFMessS 2020 - 3.10.0.F Build 200604)
' 说    明: 系统恢复登陆页面 | 请小心修改为自己的风格
' 文件日期: 2020-06-04
' 设 计 者: 疾风之狼
'========================================================================================
' 郑州文达岭峰网络科技有限公司.
'========================================================================================
' Copyright (C) 2001-2020 岭峰网. All rights reserved.
' 网    站: http://www.lfmesss.com
' 电子邮件: support@lfmesss.com
' 联系ＱＱ: 85112407
'========================================================================================
-->
<%@ language="vbscript" codepage="936" %>
<%flg = "manok"%>
<!-- #include file="../common/sub_inc_recover.asp" -->
<!-- #include file="../config/recover/recover.asp" -->
<!-- #include file="../common/commfun.asp" -->
<!-- #include file="../common/ip_purview.asp" -->
<!-- #include file="../common/checkru.asp" -->
<!--#include file="../common/md5_32.asp"-->
<%
IF Request("set") = "ok" Then
	adminname = Trim(Request.Form("LingFengNet_MS_adminname"))
	adminpass = Trim(Request.Form("LingFengNet_MS_adminpass"))
	recover_flg = Fix(Trim(Request.Form("recover_flg")))
	IF Len(adminpass) <> 32 Then
		adminpass = LFW_md5_32_pass(adminpass)
	End IF
	reg = Fix(Trim(Request.Form("reg")))
	
	IF adminname = "" or adminpass = "" Then
		Response.Write "<meta http-equiv=Content-Type content=text/html;charset="& LingFengNet_MS_language_meta_mes_1 &"><script>" 
		Response.Write "alert('"& LingFengNet_MS_language_Warning_login_1 &"');" 
		Response.Write "history.go(-1);" 
		Response.Write "</script>" 
		Response.End
	End IF
	
	IF Not IsNumeric(reg) Then
		Response.Write "<meta http-equiv=Content-Type content=text/html;charset="& LingFengNet_MS_language_meta_mes_1 &"><script>" 
		Response.Write "alert('"& LingFengNet_MS_language_Warning_login_2 &"');" 
		Response.Write "history.go(-1);" 
		Response.Write "</script>" 
		Response.End
	End IF
	
	IF CLng(reg) <> Clng(Session("LFW_Safecode")) Then
		Response.Write "<meta http-equiv=Content-Type content=text/html;charset="& LingFengNet_MS_language_meta_mes_1 &"><script>" 
		Response.Write "alert('"& LingFengNet_MS_language_Warning_login_2 &"');" 
		Response.Write "history.go(-1);" 
		Response.Write "</script>" 
		Response.End
	End IF
	
	IF Instr(LingFengNet_MS_adminname,adminname) = 0 or Instr(LingFengNet_MS_adminpass,adminpass) = 0 Then
		Response.Write "<meta http-equiv=Content-Type content=text/html;charset="& LingFengNet_MS_language_meta_mes_1 &"><script>" 
		Response.Write "alert('"& LingFengNet_MS_language_Warning_login_2 &"');" 
		Response.Write "history.go(-1);" 
		Response.Write "</script>" 
		Response.End
	End IF
	
	IF Instr(LingFengNet_MS_adminname, "|") = 0 or Instr(LingFengNet_MS_adminpass, "|") = 0 Then
		IF LingFengNet_MS_adminname = adminname and LingFengNet_MS_adminpass = adminpass Then
			Session("LingFengNet_MS_admin") = "ok"
			Session("LingFengNet_MS_admin_flg") = LingFengNet_MS_adminflg
			recoverok(recover_flg)
		End IF	
	Else	
		nameReturn = Split(LingFengNet_MS_adminname, "|")
		passReturn = Split(LingFengNet_MS_adminpass, "|")
		flgReturn = Split(LingFengNet_MS_adminflg, "|")

		For i = LBound(nameReturn) To UBound(nameReturn)
			IF Trim(nameReturn(i)) = adminname and Trim(passReturn(i)) = adminpass Then 
				Session("LingFengNet_MS_admin") = "ok"
				Session("LingFengNet_MS_admin_flg") = flgReturn(i)
				Exit For
			End IF
		Next 
		recoverok(recover_flg)
	End IF
End IF
%>
<head>
<title><%= LingFengNet_MS_language_messdef_recover_title %></title>
<%  
  Call htmlmeta() 
%> 
<link rel="stylesheet" href="../style/css/<%= LingFengNet_MS_web_css %>.css" type="text/css">
<link rel="shortcut icon" href="../pic/favicon.ico" type="image/x-icon">
<link rel="bookmark" href="../pic/favicon.ico" type="image/x-icon">
</head>
<body>
<%
Call htmltop()
Call htmlbr()
%>
  <table width="<%= LingFengNet_MS_web_w %>" border="0" cellspacing="0" cellpadding="0" align="center">
  <form name="myform" method="post" action="admin_recover<%= Get_Suffix() %>" onSubmit="return checklogin()">
    <tr> 
      <td class="bgc2"> <table width="100%" border="0" cellspacing="1" cellpadding="3">
          <tr class="bgc"> 
            <td height=40 width=25% class="bgc"> <div align="left">&ensp;<%= LingFengNet_MS_language_messdef_login_name %></div></td>
            <td height="40" width="75%" class="bgc"> <div align="left"> 
                <input type="text" name="LingFengNet_MS_adminname" size="25" maxlength="25">
              </div></td>
          </tr>
          <tr class="bgc"> 
            <td height=40 width=25% class="bgc"> <div align="left">&ensp;<%= LingFengNet_MS_language_messdef_login_pass %></div></td>
            <td height="40" width="75%" class="bgc"> <div align="left"> 
                <input type="password" name="LingFengNet_MS_adminpass" size="25" maxlength="25">
              </div></td>
          </tr>
          <tr class="bgc"> 
            <td height=40 width=25% class="bgc"> <div align="left">&ensp;<%= LingFengNet_MS_language_messdef_recover_flg %></div></td>
            <td height="40" width="75%" class="bgc"> <div align="left">
                  <label><input type="radio" name="recover_flg" value="1" checked><%= LingFengNet_MS_language_messdef_recover_flg_1 %></label>&ensp;&ensp;
                  <label><input type="radio" name="recover_flg" value="2"><%= LingFengNet_MS_language_messdef_recover_flg_2 %></label>
              </div></td>
          </tr>
          <tr class="bgc"> 
            <td height=40 width=25% class="bgc">&ensp;<%= LingFengNet_MS_language_messdef_login_Att %></td>
            <td height="40" width="75%" class="bgc"> <input type="text" name="reg" size="8" maxlength="10" class="input"> 
              <%= LingFengNet_MS_language_messdef_login_left %>&ensp;
              <img src="showcode_math.asp" width="88" height="14" id="verifypic" onClick="newverifypic()" border="1" align="absmiddle">
            <%= LingFengNet_MS_language_messdef_login_right %><input name=set type=hidden id="set" value="ok"> </td>
          </tr>
          <tr class="bgc"> 
            <td height=40 colspan="2" class="bgc"> <div align="center"> 
                <input type="submit" name="Submit" value="<%= LingFengNet_MS_language_messdef_login_submit %>" class="buttonface">
                &ensp;&ensp; 
                <input type="reset" name="reset" value="<%= LingFengNet_MS_language_messdef_login_reset %>" class="buttonface">
              </div></td>
          </tr>
          <tr class="bgc">
            <td height=40 colspan="2" class="bgc" style="padding:24px;"><div align="left"><%= LingFengNet_MS_language_messdef_recover_info %></div></td>
          </tr>
      </table></td>
    </tr>
	</form>
  </table>
<%
Call htmlbr()
Call htmlend()
%>
</body>
<script src="../common/md532.js"></script>
<script>
function checklogin() {
	if(document.myform.LingFengNet_MS_adminname.value == ""){
		alert("<%= LingFengNet_MS_language_Warning_login_1 %>");
		myform.LingFengNet_MS_adminname.focus();
		return false;
	}
	if(document.myform.LingFengNet_MS_adminpass.value == ""){
		alert("<%= LingFengNet_MS_language_Warning_login_1 %>");
		myform.LingFengNet_MS_adminpass.focus();
		return false;
	}
	if(document.myform.reg.value == ""){
		alert("<%= LingFengNet_MS_language_Warning_login_1 %>");
		myform.reg.focus();
		return false;
	}
	document.getElementById("LingFengNet_MS_adminpass").value = md5(document.getElementById("LingFengNet_MS_adminpass").value);
	return true;
}

function newverifypic(){
	var timenow = new Date().getTime();
	url = "showcode_math<%= Get_Suffix() %>";
	id = url.indexOf('?');
	if(id >= 0){
		if(id == (url.length-1))
			url = url + "t=" + timenow;
		else 
			url = url + "&t=" + timenow;
	} else {
		url = url + "?t=" + timenow;
	}
	document.getElementById("verifypic").src = url;
}	
</script>
</html>
<%
Sub recoverok(recover_flg)
	On Error Resume Next
	IF recover_flg = 1 Then
		dbpath = "bak_"& LingFengNet_MS_language_meta_mes_1 &"_setup.asp"
	ElseIF recover_flg = 2 Then
		dbpath = LingFengNet_MS_language_meta_mes_1 &"_setup_sys_1.asp"
	End IF
	IF IsObjInstalled("Scripting.FileSystemObject") Then
		Set fso = Server.Createobject("Scripting.FileSystemObject")
		Dbpath = "../config/" & dbpath 
		fso1 = Server.Mappath(dbpath)
		fso2 = Server.Mappath("../config/"& LingFengNet_MS_language_meta_mes_1 &"_setup.asp")  
		fso.copyfile fso1, fso2, True
		Set fso = Nothing
		Response.Write "<script>alert('"& LingFengNet_MS_language_Warning_mansuper_1 &"')</script><html><head><meta http-equiv='refresh' content='0;url=admin_mansys"& Get_Suffix() &"'><meta http-equiv=Content-Type content=text/html;charset="& LingFengNet_MS_language_meta_mes_1 &"></head><body>"
		Response.End
	Else
		Response.Write "<script>alert('"& LingFengNet_MS_language_Warning_mansuper_2 & dbpath & LingFengNet_MS_language_Warning_mansuper_3 &"');window.close();</script>"
		Response.End
	End IF
End Sub
%>