%
LanguageParser.IncludeSection "requestpassword"
If Request.QueryString("action") <> "newpwd" and Request.QueryString("action") <> "activate" then %>
<% elseif Request.QueryString("action") = "newpwd" then
'Check if email exists
dim strMail
strMail = request.form("mail")
if cint(objDAL.GetValue("SELECT count(mid) as IntResult FROM aspbb_members WHERE mmail={0}", array(strMail))) <> 0 then
dim newpass, strCode
newpass = GenerateNewPassword(10)
strCode = GenerateNewPassword(10)
strSQL = "UPDATE aspbb_members SET mtmppass={0}, mactivatecode={1} WHERE mmail={2}"
objDAL.Execute strSQL, array(sha256(newpass), strCode,strMail)
dim arrUser
strSQL = "SELECT mmail, mname, mid, muser FROM aspbb_members WHERE mmail={0}"
objDAL.GetRows arrUser,1, strSQL,array(strMail)
If aspbbEmail(strReplyAdress, strSenderName, arrUser(0,0), arrUser(1,0), langRegistrationHeader, langRegistrationBody & vbcrlf & langUserName & ": " & arrUser(3,0) & vbcrlf & langPWD & ": " & newpass & vbcrlf & langActivateAccount & " " & strForumAddress &"/request_password.asp?action=activate&ac=" & strCode & "&uid=" & arrUser(2,0)) = true then
response.write langMailRegSent
else
response.write "ERROR"
End if
else
Response.Write LanguageParser.GetKey("errors", "ErrorGeneral") & "
"
Response.Write LanguageParser.GetKey("errors", "NoMatchingUser") & "
"
Response.Write LanguageParser.GetKey("errors", "ErrorGeneralLong") & "
"
end if
elseif Request.QueryString("action") = "activate" then
strSQL = "SELECT mid, mactivatecode FROM aspbb_members WHERE mid={0}"
objDAL.GetRows arrUser,1, strSQL, array(Request.QueryString("uid"))
If not EOF(arrUser) then
If arrUser(1,0) = Request.QueryString("ac") then
objDal.Execute "UPDATE aspbb_members SET mpass=mtmppass WHERE mid={0}", array(arrUser(0,0))
Response.Write langAccountActivated
else
Response.Write LanguageParser.GetKey("errors", "ErrorGeneral") & "
" & LanguageParser.GetKey("errors", "ErrorGeneralLong")
end if
end if
End if%>