ho fatto alcune modifiche ma sono sempre al punto di partenza..
...quando tolgo il commento alle righe che chiudono i recordset mi da il se guente errore:
Tipo di errore:
ADODB.Recordset (0x800A0E78)
L'operazione non è consentita se l'oggetto è chiuso.
/restricted_area/frmLogin.asp, line 158
codice:
If Request.QueryString("step") = "2" THEN
authorized = False
username = Trim(Request.Form("username"))
password = Trim(Request.Form("password"))
If Len(username) = 0 Or Len(password) = 0 Then
Response.Write "Please insert usename and password"
Else
username = Replace(username,"'","''")
password = Replace(password,"'","''")
sql = "SELECT username, password FROM user " &_
"WHERE username = '" & username & "' " &_
"AND password = '" & password & "'"
Set Rs = Conn.Execute(sql)
If Rs.EOF Then
Response.Write "Incorrect Login!"
Else
'Utente admin ha una vsession aggiuntiva
Session.TimeOut = 15
authorized = True
Session("authorized") = authorized
set tbuser=Conn.execute("select * from user WHERE username = '" & username & "'")
struserautority = tbuser("autority")
strname = tbuser("name")
struser = tbuser("username")
strtime = Time()
strdate = Date()
strip = Request.ServerVariables("REMOTE_ADDR")
strhost = Request.ServerVariables("REMOTE_HOST")
tbuser.Close
set tbuser=Nothing
Set rs1 = Server.CreateObject("ADODB.Recordset")
sql1 = "INSERT INTO log ([autority], [name], [username], [timein], [datein], [ip], [host]) VALUES('"&struserautority&"', '"&strname&"', '"&struser&"', '"&strtime&"', '"&strdate&"', '"&strip&"', '"&strhost&"')"
rs1.open sql1,conn
' rs1.Close
' set rs1=Nothing
conn.Close
set conn=Nothing
If struserautority = "admin" or struserautority = "mod" then 'Utente admin ha una vsession aggiuntiva ed assieme al mod un log aggiuntivo nel db users
If struserautority = "admin" then
Session.TimeOut = 15
loginadmin = True
Session ("loginadmin") = loginadmin
End If
Set rs_login = Server.CreateObject ("ADODB.RecordSet")
strSQL = "SELECT * FROM tbl_authors WHERE authority='" & struserautority & "' "
rs_login.open strSQL,adoCon
Response.Cookies("Login")("userCode") = rs_login("code")
struserautority = rs_login("authority")
strname = rs_login("fullname")
struser = rs_login("name")
stremail = rs_login("email")
strtime = Time()
strdate = Date()
strip = Request.ServerVariables("REMOTE_ADDR")
strhost = Request.ServerVariables("REMOTE_HOST")
rs_login.Close
set rs_login=Nothing
Set rs3 = Server.CreateObject("ADODB.Recordset")
sql3 = "INSERT INTO log ([autority], [fullname], [username], [email], [timein], [datein], [ip], [host]) VALUES('"&struserautority&"', '"&strname&"', '"&struser&"', '"&stremail&"', '"&strtime&"', '"&strdate&"', '"&strip&"', '"&strhost&"')"
rs3.open sql3,adoCon
'rs3.Close
' set rs3=Nothing
adoCon.Close
set adoCon=Nothing
End If
End If
End If
If authorized Then
Response.Redirect "restricted_area.asp"
End If
End If