<% option explicit Dim struserName,struserpass,struserStatus,struserId dim objconn, rslogin,userrs dim SQLLOGIN,SQLLOG,SQLUSER dim strmydsn2'dsn de la db dim strredirect,strredirectADMIN'lien de redirection si login valide dim temp '*************************************************************************************** 'Variable a configurer strmydsn2 = "blog" strredirect = "blog.asp" strredirectADMIN = "protected/admin/adminuser/dspusersadmin.asp" '*************************************************************************************** struserName = Request.Form("usr") struserPass = Request.Form("pass") if request("Try") = 1 and struserName <> "" and struserPass <> "" then set objConn = server.createobject("ADODB.Connection") objConn.mode = 3 objConn.open strmydsn2 SQLLOGIN="SELECT * FROM users WHERE ucase(userName)='" & ucase(struserName) & "' and ucase(userpass) ='"&ucase(struserpass)&"'" set rslogin = objConn.execute(SQLLOGIN) if rslogin.eof then Session("authorized") = False Session("message") = "Nom d'usager ou Mot de passe invalide!" struserStatus ="Erreur" else Session("authorized") = True Session("SecureLevel") = rslogin("userLevel") struserId = rslogin("userId") SQLUSER="SELECT * FROM users" set userRS = server.createobject("adodb.recordset") userRS.CursorLocation=3 userRS.CursorType=1 userRS.LockType = 2 userRS.open SQLUSER,objConn userRS.Filter = "[userId] =" & struserId userRS("userCount") = userRS("userCount") +1 userRS.Update userrs.close set userRS = nothing struserStatus = "Ok" end if '******************************************************** 'Inscription dans les log if struserId = "" then struserId = 0 SQLLOG = "INSERT INTO Log (userId,LogName, LogPass, LogStatus, LogIp, LogDate ) "&_ "Values("&struserId&",'"&struserName&"','"&struserPass&"','"&struserStatus&"','"&Request.ServerVariables("REMOTE_ADDR")&"','"&Now()&"')" 'Response.Write SQLLOG objconn.Execute SQLLOG '******************************************************** objConn.close Set rslogin = Nothing Set objConn = Nothing if struserStatus = "Ok" then IF Session("SecureLevel") = 5 THEN Response.Redirect strredirectADMIN ELSE Response.Redirect strredirect END IF end if elseif request("Try") = 1 and (struserName = "" or struserPass = "") then Session("message") = "Nom d'usager ou Mot de passe invalide!" end if %> Identification
MERCI ! - THANK YOU !
POUR FAIRE UN DON À ACADIEN.ORG
TO MAKE A DONATION TO ACADIEN.ORG

INSCRIPTION
JOIGNEZ-VOUS À NOUS!
JOIN US NOW!
INFO:
418-529-4489
514-631-4496



DON PAR COURRIER (Cliquez ici) - DONATION BY MAIL (Click here)