gmarkwood
Posts: 10
|
| Posted: 10/12/2005, 1:28 PM |
|
Hello,
I am using CodeCharge Studio 2.3.2.24 & vbscript.
I have setup a session variable that will trigger a page redirection if a user has failed to login after 3 tries.
As a whole, the logic works and I can see the session variable increment in the field, login.textbox1.value = Session("CountLock"), which is on my login page for testing.
After 3 failed tries, I am never redirected to my page with the line, Redirect = "LoginError.asp". The session var. Session("CountLock"), gets reset to 0, so the if statement is executed.
Can I use Redirect within the statement "With Login"?
I know that the redirect works, because if I have a successful login, the Function "Page Before_Unload" redirects me to "NumCSI_list.asp".
Can anyone advise me on why my redirect statement, Redirect = "LoginError.asp", is not working?
Thank you for your time and best regards, Mark
CODE:
Function Login_Button_DoLogin_OnClick() 'Login_Button_DoLogin_OnClick @3-ADB4691A
'Login @4-AA430BB1
With Login
If NOT CCLoginUser(.login.Value, .password.Value) Then
.Errors.addError("Login or Password is incorrect.")
Login_Button_DoLogin_OnClick = False
.password.Value = ""
Session("CountLock") = Session("CountLock") + 1
login.textbox1.value = Session("CountLock")
IF Session("CountLock") = 3 THEN
'Redirect to bad logon page
Redirect = "LoginError.asp"
Session("CountLock") = 0
end if
Else
If Not IsEmpty(CCGetParam("ret_link", Empty)) Then _
Redirect = CCGetParam("ret_link", Empty)
Login_Button_DoLogin_OnClick = True
'Session("CountLock") = 0
End If
End With
'End Login
End Function 'Close Login_Button_DoLogin_OnClick @3-54C34B28
Function Page_BeforeUnload() 'Page_BeforeUnload @1-A9F5B785
'Custom Code @10-73254650
' -------------------------
if LCase(Session("UserLogin")) = "wood" then
Redirect = "NumCSI_list.asp"
end if
' -------------------------
'End Custom Code
End Function 'Close Page_BeforeUnload @1-54C34B28
|
 |
 |
DonB
|
| Posted: 10/12/2005, 2:50 PM |
|
The Error.addError suppresses redirection, as the CCS design behavior is to
stay on the form that produced the error (mainly, I guess, so that the error
can be displayed).
--
DonB
http://www.gotodon.com/ccbth
"gmarkwood" <gmarkwood@forum.codecharge> wrote in message
news:6434d71ed749d2@news.codecharge.com...
> Hello,
>
> I am using CodeCharge Studio 2.3.2.24 & vbscript.
>
> I have setup a session variable that will trigger a page redirection if a
user
> has failed to login after 3 tries.
>
> As a whole, the logic works and I can see the session variable increment
in the
> field, login.textbox1.value = Session("CountLock"), which is on my login
page
> for testing.
>
> After 3 failed tries, I am never redirected to my page with the line,
Redirect
> = "LoginError.asp". The session var. Session("CountLock"), gets reset to
0, so
> the if statement is executed.
>
> Can I use Redirect within the statement "With Login"?
>
> I know that the redirect works, because if I have a successful login, the
> Function "Page Before_Unload" redirects me to "NumCSI_list.asp".
>
> Can anyone advise me on why my redirect statement, Redirect =
"LoginError.asp",
> is not working?
>
> Thank you for your time and best regards, Mark
>
> CODE:
>
> Function Login_Button_DoLogin_OnClick() 'Login_Button_DoLogin_OnClick
> @3-ADB4691A
>
> 'Login @4-AA430BB1
> With Login
> If NOT CCLoginUser(.login.Value, .password.Value) Then
> .Errors.addError("Login or Password is incorrect.")
> Login_Button_DoLogin_OnClick = False
> .password.Value = ""
>
> Session("CountLock") = Session("CountLock") + 1
>
> login.textbox1.value = Session("CountLock")
>
> IF Session("CountLock") = 3 THEN
> 'Redirect to bad logon page
> Redirect = "LoginError.asp"
> Session("CountLock") = 0
> end if
> Else
> If Not IsEmpty(CCGetParam("ret_link", Empty)) Then _
> Redirect = CCGetParam("ret_link", Empty)
> Login_Button_DoLogin_OnClick = True
> 'Session("CountLock") = 0
> End If
> End With
>
> 'End Login
>
> End Function 'Close Login_Button_DoLogin_OnClick @3-54C34B28
>
> Function Page_BeforeUnload() 'Page_BeforeUnload @1-A9F5B785
>
> 'Custom Code @10-73254650
> ' -------------------------
> if LCase(Session("UserLogin")) = "wood" then
> Redirect = "NumCSI_list.asp"
> end if
> ' -------------------------
> 'End Custom Code
>
> End Function 'Close Page_BeforeUnload @1-54C34B28
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|