<%@ CodePage = 65001 LCID = 1040 %> <% Response.expires = 0 Response.expiresabsolute = Now() - 1 Response.addHeader "pragma", "no-cache" Response.addHeader "cache-control", "private" Response.addHeader "cache-control", "no-cache" Response.addHeader "cache-control", "no-store" Response.CacheControl = "no-cache" %> <% ' User levels Const ewAllowAdd = 1 Const ewAllowDelete = 2 Const ewAllowEdit = 4 Const ewAllowView = 8 Const ewAllowList = 8 Const ewAllowSearch = 8 Const ewAllowAdmin = 16 If Request.Form("submit") <> "" Then bValidPwd = False ' Setup variables sUserId = Request.Form("userid") sPassWd = Request.Form("passwd") If Not bValidPwd Then Set conn = Server.CreateObject("ADODB.Connection") conn.open xDb_Conn_Str sSql = "SELECT * FROM [utenti]" sSql = sSql & " WHERE [login] = '" & AdjustSql(sUserId) & "'" Set rs = conn.Execute(sSql) If Not rs.Eof Then If UCase(rs("password")) = UCase(sPassWd) Then Session("lapinsitter_status_User") = rs("login") Session("lapinsitter_SysAdmin") = 0 ' non System Administrator Session("lapinsitter_status_UserID") = rs("IDutente") Session("lapinsitter_status_UserLevel") = CInt(rs("livello")) If Session("lapinsitter_status_UserLevel") = -1 Then ' Administrator Session("lapinsitter_status_UserID") = -1 End If Call SetUpUserLevel() bValidPwd = True End If End If rs.Close Set rs = Nothing conn.Close Set conn = Nothing End If If bValidPwd Then Call SetUpUserLevel() ' Write cookies If Request.Form("rememberme") <> "" Then Response.Cookies("lapinsitter")("userid") = sUserId Response.Cookies("lapinsitter").Expires = Date + 365 ' Change the expiry date of the cookies here End If Session("lapinsitter_status") = "login" Response.Redirect "default.asp" Else Session("ewmsg") = "User ID o password errati" End If End If '------------------------------------------------------------------------------- ' Function SetUpUserLevel ' - Set Up User Level Security ' arrSecurity: ' ---------------------------------- ' | | "table1" | "table2" | ... ' ---------------------------------- ' | "level1" | n | n | ' ---------------------------------- ' | "level2" | n | n | ' ---------------------------------- ' ... Sub SetUpUserLevel() ' Declare Security Table - m User Levels x n Tables Dim arrSecurity(1, 3) arrSecurity(0,1) = "cerco" ' Table Name If Session("lapinsitter_status_UserLevel") = -1 Then Session("cerco_menuitem") = True End If arrSecurity(1,0) = "inserzionista" ' User Level Name arrSecurity(1,1) = 15 ' User Level Security If Session("lapinsitter_status_UserLevel") = 1 Then Session("cerco_menuitem") = CBool(15 And ewAllowList) End If arrSecurity(0,2) = "offro" ' Table Name If Session("lapinsitter_status_UserLevel") = -1 Then Session("offro_menuitem") = True End If arrSecurity(1,2) = 15 ' User Level Security If Session("lapinsitter_status_UserLevel") = 1 Then Session("offro_menuitem") = CBool(15 And ewAllowList) End If arrSecurity(0,3) = "utenti" ' Table Name If Session("lapinsitter_status_UserLevel") = -1 Then Session("utenti_menuitem") = True End If arrSecurity(1,3) = 0 ' User Level Security If Session("lapinsitter_status_UserLevel") = 1 Then Session("utenti_menuitem") = CBool(0 And ewAllowList) End If Session("ewSecurity") = arrSecurity ' Save Security Table End Sub %>

Pagina di Login

<% If Session("ewmsg") <> "" Then %>

<%= Session("ewmsg") %>

<% Session("ewmsg") = "" ' Clear message End If %>
Nome Utente ">
Password
  Ricordati di me

REGISTRATI per pubblicare l'annuncio     Dimenticata Password