<!--#include file="HoWaveConfig.asp"-->
<%
'==恒浪IMS配置文件,请不要随便更改==
Dim HLIntegration,HLAdminIntegration,HLCode,HLVer,HLIsSQL,HL_Url,SecurityKey,AdminSecurityKey,RegPageSet,Domainname
Dim HLSQLUser,HLSQLPass,HLSQLDb,HLSQLSource,HLManageCode
Dim RegFileName,LoginFileName,LogoutFileName,ChangePasswordFileName,ChangeEmailFileName,ChangeQuestionAnswerFileName,LostPasswordFileName,Admin_Url,AdminLogoutFileName,Manage_Url,GoUrl
Dim ActiveBlog
ActiveBlog=False            '是否启用博客激活-手动修改

GoUrl=Request.ServerVariables("HTTP_REFERER")                 

If HLIsSQL="1" then SetSecurityKey()

IF HLVer="1" Then
   Manage_Url="Passport/"                                   '恒浪IMS存放的路径,V5.X的情况-手动修改"
   RegFileName="UserReg.aspx"
   LoginFileName="Login.aspx"
   LogoutFileName="Logout.aspx"
   ChangePasswordFileName="PasswordManager.aspx"
   ChangeQuestionAnswerFileName="PasswordManager.aspx?Action=edit"
   ChangeEmailFileName="confirm_email.aspx"
   LostPasswordFileName="forget_password.aspx"
   Admin_Url="HL_Admin/"                                     '恒浪IMS存放的路径,V5.X的情况-手动修改"                               
   AdminLogoutFileName="Admin_Logout.aspx"
Else 
   if HLVer="0" Then
      Manage_Url="HLManage/"                                 '恒浪IMS存放的路径,V4.X的情况-手动修改"
      RegFileName="User_RegPost.asp"
      LoginFileName="User_ChkLogin.asp"
      LogoutFileName="User_Logout.asp"
      ChangePasswordFileName="User_ModifyPWD.asp"
      ChangeQuestionAnswerFileName="User_Passport.asp"
      ChangeEmailFileName="User_Passport.asp"
      LostPasswordFileName="User_GetPassword.asp"
	  Admin_Url="HLManage/"                                  '恒浪IMS存放的路径,V4.X的情况-手动修改"
	  AdminLogoutFileName="Admin_Logout.asp"
   End If	 
End If  

'连接恒浪IMS数据库获取资料
Function SetSecurityKey()
    Dim HLInfor_ConnStr,HLInfor_SqlUsername,HLInfor_SqlPassword,HLInfor_SqlDatabaseName,HLInfor_SqlHostIP,HLInfor_Conn,HLInfor_Res
	
	HLInfor_SqlUsername      = HLSQLUser             '恒浪V5.0数据库登录帐号
	HLInfor_SqlPassword      = HLSQLPass         '恒浪V5.0数据库登录密码
	HLInfor_SqlDatabaseName  = HLSQLDb  '恒浪V5.0数据库名
	HLInfor_SqlHostIP        = HLSQLSource        '恒浪V5.0数据库服务器
	
    HLInfor_ConnStr = "Provider = Sqloledb; User ID = " & HLInfor_SqlUsername & "; Password = " & HLInfor_SqlPassword & "; Initial Catalog = " & HLInfor_SqlDatabaseName & "; Data Source = " & HLInfor_SqlHostIP & ";"

    Set HLInfor_Conn = Server.CreateObject("ADODB.Connection")
    HLInfor_Conn.open HLInfor_ConnStr
	Set HLInfor_Res=HLInfor_Conn.Execute("Select SiteUrl,SecurityKey,AdminSecurityKey,RegPageSet,DomainName From HL_Setup")
	HL_Url=HLInfor_Res("SiteUrl")
	SecurityKey = HLInfor_Res("SecurityKey")
	AdminSecurityKey = HLInfor_Res("AdminSecurityKey")
	Domainname=HLInfor_Res("DomainName")
	Set HLInfor_Res = Nothing
	Set HLInfor_Conn = Nothing
End Function

'检测注册入口
Function Howave_CheckIsReg()
Dim HowaveRegSeturl
IF HLIntegration=True Then
   HowaveRegSeturl="http://"&request.ServerVariables("Server_NAME")&request.ServerVariables("SCRIPT_NAME") 
   IF(len(trim(request.ServerVariables("QUERY_STRING")))>0) then 
      HowaveRegSeturl=HowaveRegSeturl& "?" & request.ServerVariables("QUERY_STRING") 
   End if
   IF RegPageSet<>"" And Lcase(RegPageSet)<>Lcase(HowaveRegSeturl) Then     
      Response.Redirect RegPageSet&"?ComeUrl="&GoUrl
      Response.End()
   End IF
End IF  
End Function 

'注册
function Howave_Reg(UserName,UserPassword,Email,UserQuestion,UserAnswer,Sex,ComeUrl)
if HLIntegration=True Then
	Dim Sign,RegUserName,RegQuestion,RegPassword
	RegUserName=Lcase(Server.URLEncode(UserName))
	RegQuestion=Lcase(Server.URLEncode(UserQuestion))
	Sign=MD5(RegUserName&UserPassword&SecurityKey)          '//MD5加密位数，与被整合系统的一致  -手动修改         
	
	Response.Write"<body onload='document.HowaveRegForm.submit();'>"& vbCrLf
	Response.Write "<form action='"& HL_Url &Manage_Url&RegFileName&"' method='post' name=HowaveRegForm id=HowaveRegForm >"& vbCrLf
	Response.Write "    <input name='UserName' type='hidden' id='UserName' value="&RegUserName&">"& vbCrLf
	Response.Write "    <input name='Password' type='hidden' value="&UserPassword&">"& vbCrLf
	Response.Write "    <input name='Email' type='hidden' value="&Email&">"& vbCrLf
	Response.Write "    <input name='Question' type='hidden' value="&RegQuestion&">"& vbCrLf
	Response.Write "    <input name='Answer' type='hidden' value="&UserAnswer&">"& vbCrLf
	Response.Write "    <input name='Sex' type='hidden' value="&Sex&">"& vbCrLf
	Response.Write "    <input name='Sign' type='hidden' value="&Sign&">"& vbCrLf
	Response.Write "    <input name='Code' type='hidden' value='"&HLCode&"'>"& vbCrLf
	Response.Write "    <input name='ComeUrl' type='hidden' id='ComeUrl' value="&ComeUrl&">"& vbCrLf
	Response.Write "</form>"& vbCrLf
	'Response.Write "    <script language='javascript'>document.HowaveRegForm.submit();</script" & vbCrlf
	Response.Write "</body>"
	Response.End()
End If
End Function


'登录
Function Howave_Login(UserName,UserPassword,CookieTime,ComeUrl)
Dim HLUserName
HLUserName=Lcase(Server.URLEncode(UserName))
if HLIntegration=True Then
	Response.Write"<body onload='document.HowaveLoginform.submit();'>"& vbCrLf
	Response.Write "<form name='HowaveLoginform' id='HowaveLoginform' action='"&HL_Url&Manage_Url&LoginFileName&"' method='post'>" & vbCrLf
	Response.Write "	<input type='hidden' name='UserName' value='"&HLUserName&"'>" & vbCrLf
	Response.Write "	<input type='hidden' name='UserPassword' value='"&UserPassword&"'>" & vbCrLf
	Response.Write "	<input type='hidden' name='CookieDate' value='"&CookieTime&"'>" & vbCrLf
	Response.Write "	<input type='hidden' name='ComeUrl' value='"&ComeUrl&"'>" & vbCrLf
	Response.Write "	<input name='Code' type='hidden' value='"&HLCode&"'>" & vbCrLf 
	Response.Write "</form>" & vbCrLf
	'Response.Write "    <script language='javascript'>document.HowaveLoginform.submit();</script" & vbCrlf
    Response.Write "</body>"
    Response.End()
End If
End Function

'注销
Function Howave_Logout()
IF HLIntegration = True Then 
   IF GoUrl="" Then
      GoUrl="http://"&Request.ServerVariables("SERVER_NAME")      
   End If
   Response.Redirect (HL_Url&Manage_Url&LogoutFileName&"?ComeUrl="&GoUrl)	  
End If
End Function

'找回密码
Function Howave_LostPassword()
IF HLIntegration = True Then 
   Response.Redirect(HL_URl&Manage_Url&LostPasswordFileName&"?ComeUrl="&GoUrl)
End If
End Function

'修改密码
Function Howave_ChangePassword()
IF HLIntegration = True Then 
   Response.Redirect(HL_URl&Manage_Url&ChangePasswordFileName&"?ComeUrl="&GoUrl)
End If
End Function

'修改密码URL
Dim HowaveChangePasswordUrl
HowaveChangePasswordUrl=HL_Url&Manage_Url&ChangePasswordFileName&"?ComeUrl="&GoUrl

'修改Email
Dim HowaveChangeEmailUrl
HowaveChangeEmailUrl=HL_Url&Manage_Url&ChangeEmailFileName&"?ComeUrl="&GoUrl

'修改问题,答案
Dim HowaveChangeQuestionAnswerUrl
HowaveChangeQuestionAnswerUrl=HL_Url&Manage_Url&ChangeQuestionAnswerFileName&"?ComeUrl="&GoUrl


'===================================================
'				Powered by HoWave.Net
'===================================================
' Mail: websky888@126.com 
' Q  Q: 18469685, 615939753    Tel:020-88386767
' Web : http://www.HoWave.net, http://www.jsp163.com
' Bbs : http://bbs.HoWave.net, http://bbs.jsp163.com
' Copyright (C) 2005 HoWave.net All Rights Reserved.
'===================================================
%>
