This topic is locked

Redirecting to Login not allowed page

1/15/2010 18:33:27
PHPRunner General questions
D
Dale author

I cant seem to get this redirect right.
I have a field in the user table for a "Allow Login", and I have it formated for a checkbox.
This way, I can uncheck this box if I dont want a user to login for what ever reason.
So what I have setup, After successfull login I check this value on the user record, if it is 1 then just proceed and I direct them to an appropriate list.

But if the value is 0, I want to redirect them to a page no_allow_login.htm.
I have all in place and it works fine, EXCEPT if the application times out. Next click and I get redirected to the no_allow_login.htm.

How and where exactly would I put some function, to ONLY redirect to no_allow_login.htm if the user switch is off, and all other times, time out, it redirects to the login page.
Is there some way I can verify if it was a timeout, and redirect to Login and if it is because the user allow login switch is not set, redirect to no_allow_login.htm.

Obviously, I have some issue with my code or where I am placeing it. Its annoying to a user to see a Your Not allowed to login, only because they have timed out.
Also I would like to increase the length of time before timeout. A quick suggestion for this would also be appreciated.

J
Jane 1/18/2010

Dale,
you can check username, password and Allow Login fields in the AfterSuccessfulLogin event and redirect to the no_allow_login page only if Allow Login is set up to 0, but username and password are not empty.
Regarding the second question.

Please check this thread:

http://www.asprunner.com/forums/topic/12701-session-timeout/pagehltimeoutfromsearch1

D
Dale author 1/18/2010

Thanks Jane,

That seems to be a bit more complete in what to check for before redirecting.
So far its seems to be working fine. I will be interested on how it handles when the user times out. I will let you know if that becomes an issue.

Thanks for the help.