gina
|
| Posted: 09/30/2002, 9:32 AM |
|
In code charge studio (PHP4), I have the typical login page. When you enter a wrong password or user name, the error message "Login or Password is incorrect" will appear right above the login field. Instead, if a user enters the wrong user name or password, I would like them to be redirected to a different login page that will ask the user to re-enter their user name and password. Is there any way to redirect the user to a different page if they enter incorrect login information? Thanks
|
|
|
 |
Mehmet Ozdemir
|
| Posted: 09/30/2002, 3:18 PM |
|
While I'm using ASP (Templates) the same theory should apply to you.
The Login calls the following code snippet:
If NOT CCLoginUser(.login.Value, .password.Value) Then
.Errors.addError("Login or Password is incorrect.")
Login_DoLogin_OnClick = False
.password.Value = ""
Else
If Not IsEmpty(CCGetParam("ret_link", Empty)) Then _
Redirect = CCGetParam("ret_link", Empty)
Login_DoLogin_OnClick = True
End If
Now instead of:
.Errors.addError("Login or Password is incorrect.")
replace that with:
Redirect = the page you want to redirect to.
HTH
Mehmet Ozdemir
|
|
|
 |
Nicole
|
| Posted: 10/03/2002, 1:12 AM |
|
Gina,
here is PHP version.
Open file with the events for Login page, find
function Login_DoLogin_OnClick()
and modify the following part of code:
global $Login;
if(!CCLoginUser($Login->login->Value, $Login->password->Value))
{
$Login->password->SetValue("");
header("Location: AnyPage.php");
return false;
}
else
ot get something like:
global $Login;
if(!CCLoginUser($Login->login->Value, $Login->password->Value))
{
$Login->Errors->addError("Login or Password is incorrect.");
$Login->password->SetValue("");
return false;
}
else
|
|
|
 |
WillJ
|
| Posted: 10/03/2002, 10:32 AM |
|
Maybe I am thinking to simplistic but why don't you just change the generated HTML message to say "Login or Password is incorrect please try again", and turn off the generate html capability the codecharge environment.
|
|
|
 |
|