%
if session("autorizzato") = 1 then response.redirect("/html/documenti.asp")
invio = request("invio")
if (invio = "invio") then
userid = request("userid")
passwd = request("passwd")
percorsopasx = Server.MapPath("/html/pasx.txt")
Set oggettoFileSystem = Server.CreateObject("Scripting.FileSystemObject")
Set oggettoFile = oggettoFileSystem.OpenTextFile(percorsopasx, 1)
trovato = false
do while not(oggettoFile.AtEndOfStream) and not(trovato)
linea = oggettoFile.ReadLine
if (InStr(linea, userid) > 0) then trovato = true end if
loop
oggettoFile.close
Set oggettoFileSystem = nothing
Set oggettoFile = nothing
userdata = split(linea, "~:~", -1, 1)
password = trim(userdata(1))
if ((trovato) and (passwd = password) ) then
session("autorizzato") = 1
response.redirect("/html/documenti.asp")
else
response.redirect("/html/registrazione.html")
end if
else
' HTML %>
Operatori
<% 'fine HTML
End if
%>