%@ LANGUAGE=VBScript%><%
Response.Expires = 0
Response.Buffer = true
strRelac = Request("rel")
'--- pega os dados do cookie temporário
If ( Request.Cookies("sitetmp")("email") <> "" ) Then
strId = Request.Cookies("sitetmp")("id")
strNome = Request.Cookies("sitetmp")("nome")
strEmail = Request.Cookies("sitetmp")("email")
else
strMsg = Request.Cookies("sitetmp")("msg")
Response.Cookies("sitetmp")("msg") = ""
End If
'--- se não existe cookie, redireciona o internauta para o manifesto.asp
If ( strId = "" Or strEmail = "" Or strNome = "" ) Then
If Request("acao") = "log" then
strNome = Request("nome")
strEmail = Request("email")
strSenha = Request("senha")
'--- retorna mensagem de falta de dados
If ( strEmail = "" And strSenha = "" ) Then
Response.Cookies("sitetmp")("msg") = "email e senha não foram informados!"
Response.Clear
Response.Redirect "manifesto.asp?rel=" & strRelac
Response.End
End If
on Error resume next
'Abre conexao com banco de dados
set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.Open application("CnxStrMDBSite")
if err <> 0 then
Set dbConn = nothing
'
Response.Cookies("sitetmp")("msg") = "erro no sistema de login!"
Response.Clear
Response.Redirect "manifesto.asp?rel=" & strRelac
Response.End
end if
'--- retorna mensagem de falta de dados
If ( strEmail <> "" And strNome <> "" And strSenha = "" ) Then
pseudoSenha = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzklmnopqrstuvwxyzabcdefghijk"
pseudoSenha2 = "0123456789012345678901234567890123456789"
strSenha = mid(pseudoSenha, Minute(now()), 1) + mid(pseudoSenha, Day(now()), 1) + mid(pseudoSenha, Second(now()), 1) + mid(pseudoSenha2, Weekday(now()), 1) + mid(pseudoSenha2, Weekday(now()+2), 1) + mid(pseudoSenha2, Hour(now()+1), 1)
'
strIP = Request.ServerVariables("REMOTE_HOST")
strProvedor = ""
Set oDNS = Server.Createobject("Dynu.DNS")
if err = 0 then
strProvedor = oDNS.ReverseLookup(strIP)
end if
Set oDNS = nothing
strGeoIP = Request("geoip")
strCountry = Request("country")
strCity = Request("city")
existe = 0
SQLQuery = "SELECT count(1) as tt FROM manifestantes WHERE email='" & strEmail & "'"
Set rsUsuario = dbConn.Execute(SQLQuery)
If Not rsUsuario.EOF then
existe = rsUsuario("tt")
end if
rsUsuario.Close
if existe <> 0 then
dbConn.Close
Set dbConn = nothing
'
Response.Cookies("sitetmp")("msg") = "este email já está cadastrado!"
Response.Clear
Response.Redirect "manifesto.asp?rel=" & strRelac
Response.End
end if
dbConn.Execute( "Insert Into manifestantes ( nome, email, senha, geoip, ip, provedor, country, city) values('" & replace(strNome,"'", "''") & "', '" & replace(strEmail,"'", "''") & "', '" & replace(strSenha,"'", "''") & "', '" & replace(strGeoIP,"'", "''") & "', '" & replace(strIP,"'", "''") & "', '" & replace(strProvedor,"'", "''") & "', '" & replace(strCountry,"'", "''") & "', '" & replace(strCity,"'", "''") & "')" )
'
if err <> 0 then
dbConn.Close
Set dbConn = nothing
'
Response.Cookies("sitetmp")("msg") = "erro no sistema de login*!"
Response.Clear
Response.Redirect "manifesto.asp?rel=" & strRelac
Response.End
else
'--- prepara o conteúdo do email
'--- e o envia utilizando o AspMail
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
if err = 0 then
Mailer.Priority = 1
Mailer.CharSet = 2
Mailer.FromName = "proj.MANIFESTE-SE"
Mailer.FromAddress= application("CnxStrSMTPAccount")
Mailer.RemoteHost = application("CnxStrSMTP")
Mailer.AddRecipient strNome, strEmail
Mailer.Subject = "senha MANIFESTE-SE ONLINE"
wagora = Now()
'--- prepara TEXTO
wBody = "Seja bem vindo(a) " & strNome & vbCrLf
wBody = wBody & "(login-email: " & strEmail & ")" & vbCrLf & vbCrLf
wBody = wBody & """MANIFESTE-SE ONLINE"" encontra-se em fase de" & vbCrLf
wBody = wBody & "testes-instalação-aperfeiçoamento e portanto agradecemos imensamente" & vbCrLf
wBody = wBody & "pela sua participação, caso tenha qq problema com suas entradas no site," & vbCrLf
wBody = wBody & "por favor nos comunique aqui via email e deixe as suas contribuições" & vbCrLf
wBody = wBody & "para que melhor possamos elaborar a acessibilidade à todos da" & vbCrLf
wBody = wBody & "ferramenta e visualidade etc deste projeto." & vbCrLf & vbCrLf
wBody = wBody & "sua senha de acesso é: " & strSenha & vbCrLf & vbCrLf
wBody = wBody & "lembrando que esta semana - última de abril - teremos novas saidas às" & vbCrLf
wBody = wBody & "ruas de SP, participe >> www.manifesto21.com.br" & vbCrLf & vbCrLf
wBody = wBody & "[]s e boas manifestações!," & vbCrLf
wBody = wBody & "equipe MANIFESTE-SE [todo mundo artista]" & vbCrLf & vbCrLf
wBody = wBody & "obs1 >> para participar do live-streaming, entre em contato conosco nos" & vbCrLf
wBody = wBody & "dias de transmissão ao vivo via msn: manifestese@hotmail.com" & vbCrLf & vbCrLf
wBody = wBody & "obs2 >> para participar do ""MANIFESTE-SE ONLINE"" é necessário uma" & vbCrLf
wBody = wBody & "entrada mic e/ou webcam acoplados em seu computador" & vbCrLf
Mailer.BodyText = wBody
If Mailer.SendMail Then
bok = true
Else
bok = false
End If
Set Mailer = Nothing
end if
end if
'
dbConn.Close
Set dbConn = nothing
'
Response.Cookies("sitetmp")("msg") = "usuário criado com sucesso! aguarde envio de sua senha."
Response.Clear
Response.Redirect "manifesto.asp?rel=" & strRelac
Response.End
End If
'--- testa usuario e senha
SQLQuery = "SELECT id, email, nome FROM manifestantes WHERE email='" & strEmail & "' AND senha='" & strSenha & "'"
Set rsUsuario = dbConn.Execute(SQLQuery)
If Not rsUsuario.EOF then
strId = rsUsuario("id")
strNome = rsUsuario("nome")
strEmail = rsUsuario("email")
else
strId = ""
strNome = ""
strEmail = ""
end if
rsUsuario.Close
dbConn.Close
Set dbConn = nothing
If ( strNome = "" ) Then
'--- retorna mensagem de usuario/senha inválidos
Response.Cookies("sitetmp")("msg") = "usuário e/ou senha inválidos!"
Response.Clear
Response.Redirect "manifesto.asp?rel=" & strRelac
Response.End
End If
Response.Cookies("sitetmp")("id") = strId
Response.Cookies("sitetmp")("nome") = strNome
Response.Cookies("sitetmp")("email") = strEmail
Response.Cookies("sitetmp")("msg") = ""
Response.Clear
Response.Redirect "manifesto.asp?rel=" & strRelac
Response.End
End if
%>