This topic is locked

Logon

8/27/2009 10:14:42 AM
ASPRunnerPro General questions
N
NigelEtienne author

Hi I have just upgraded to 6.1 (build 2503) from 6.0 and my code in the Before Login event no longer works:
I had:

'Before login

Function BeforeLogin(username, password)

UserName = UCase(UserName)

BeforeLogin = True
End Function ' BeforeLogin
I now have:

' Before login

Function BeforeLogin(username,password,ByRef message)

UserName = UCase(UserName)

BeforeLogin=true
End Function ' BeforeLogin

arrAvailableEvents("BeforeLogin")=true
The user should be able to input there User Name in upper or lower case, then their password, and the system should log them in. After the upgrade it just refreshes the screen changing the user name to upper case and displays the invalid login text.
Any ideas what I need to add?

J
Jane 8/28/2009

Hi,
use BeforeLogin event to check entered password and change SQL query manually.

Here is a sample:

Set rstmp = dal.UsersTable.Query("ucase(UserName)=ucase('" & username & "') and Password='" & password & "'","")

if not rstmp.eof then

strSQL = "select * from [UsersTable] where ucase(UserName)=ucase('" & username & "') and Password='" & password & "'"

end if

rstmp.close

set rstmp=nothing

BeforeLogin=true
N
NigelEtienne author 9/1/2009



Hi,
use BeforeLogin event to check entered password and change SQL query manually.

Here is a sample:

Set rstmp = dal.UsersTable.Query("ucase(UserName)=ucase('" & username & "') and Password='" & password & "'","")

if not rstmp.eof then

strSQL = "select * from [UsersTable] where ucase(UserName)=ucase('" & username & "') and Password='" & password & "'"

end if

rstmp.close

set rstmp=nothing

BeforeLogin=true



Jane

Many thanks for the reply but it still does not work.
User details are held in a tabel called AUD_USERS, within that table the logon name is in a column called USERID and the passord in a column called PASSWORD.

I amended the sample to read
Set rstmp = dal.AUD_USERS.Query("ucase(USERID)=ucase('" & username & "') and Password='" & password & "'","")

if not rstmp.eof then

strSQL = "select * from AUD_USERSwhere ucase(USERID)=ucase('" & username & "') and Password='" & password & "'"

Sergey Kornilov admin 9/1/2009

I recommend to post your application to Demo Account (use 'Demo Account' button on the last screen in program). Then open a ticket at http://support.xlinesoft.com sending your Demo Account URL for investigation.