<%@ Language=VBScript %> <% ' /////////////////////////////////////////////////////// ' // Dimac CMS ' // Copyright 2004-2008 Dimac Development AB, Sweden ' // www.Dimac.net ' // ' // NOTE: ' // You are not allowed to remove this ' // Copyright information without written ' // permission from Dimac Development. ' /////////////////////////////////////////////////////// ' ------------------------------------------------------- ' -- Global variables ' ------------------------------------------------------- Dim Conn, Rs, SQL , ResultText vEmail = FF(Request.Form("Email").item) vPassword = FF(Request.Form("Password").item) ' /////////////////////////////////////////////////////// Sub UpdateUserStatus(vUserID) Set Conn2 = Server.CreateObject("ADODB.Connection") Set Rs2 = Server.CreateObject("ADODB.Recordset") Conn2.Open GetConStr ("..\..\SiteResources\Data\") SQL2 = "SELECT LoginCount From Members WHERE ID= " & vUserID set Rs2 = Conn2.Execute(SQL2) SQL2 = " UPDATE Members SET " SQL2 = SQL2 & " LastLoggin = '" & Year(Now) & "-" & FixNumber(Month(Now)) & "-" & FixNumber(Day(Now)) & " " & FormatDateTime(Now, vbShortTime) & "'," SQL2 = SQL2 & " LoginCount = " & Cint(Rs2("LoginCount").value) + 1 SQL2 = SQL2 & " WHERE ID = " & vUserID Set Rs2 = Conn2.Execute(SQL2) Set Rs2 = Nothing Set Conn2 = Nothing End Sub ' /////////////////////////////////////////////////////// Set Conn = Server.CreateObject("ADODB.Connection") Set Rs = Server.CreateObject("ADODB.Recordset") Conn.Open GetConStr ("..\..\SiteResources\Data\") SQL = "SELECT * From Members " SQL = SQL & "WHERE Email = '" & vEmail & "' " SQL = SQL & "AND MemberPassword = '" & vPassword & "'" set Rs = Conn.Execute(SQL) IF RS.eof THEN Session("Member_Valid") = "FALSE" ResultText = "

" ResultText = ResultText & "
Email or password is incorrect !!

" Else If Rs("Status").value = "2" Then ' // User account is active Call UpdateUserStatus(Rs("ID").value) Session("Member_Valid") = "TRUE" Session("Member_Name") = Rs("FirstName").value & " " & Rs("LastName").value Session("Member_ID") = Rs("ID").value Session("Member_Level") = Rs("MemberLevel").Value ResultText = "

You have logged in sucessfully.
" ResultText = ResultText & "
Please click the following link to
active your login settings.

" ResultText = ResultText & "Click here to activate.

" 'ResultText = ResultText & "Click here to activate.

" Else ' // User account is not active Session("Member_Valid") = "FALSE" ResultText = "

" ResultText = ResultText & "
Your account is not active or pending !! !!
" End If End if ' /////////////////////////////////////////////////////// ' /////////////////////////////////////////////////////// %> <%= ResultText %>