Alfred
Posts: 4
|
Posted: 01/28/2005, 12:10 AM |
|
Hello,
I'm working on a project based on different application and I receive from other web program a form containing two parameters: userid & password.
How can I take them and make control on my login table?
I'm using CCS 2.3 (Java) on Tomcat 4.x server and MySQL database .
Thank you in advance
Alfred
|
|
|
mrachow
Posts: 509
|
Posted: 01/28/2005, 1:58 AM |
|
What I would try ...
Add the action Login on an usual event on your page.
If you store the values you get into hidden fields for example you can use this action as is, e.g. select the both fields for the properties.
If you handle your userid and password in a different way you can take this code (copy it away), remove the saction and insert the copied code into a custom event and adopt it to your needs.
_________________
Best regards,
Michael |
|
|
Alfred
Posts: 4
|
Posted: 01/29/2005, 1:48 AM |
|
Thanks for your suggestion Michael,
unfortunatly I can't get your code as in your message, can you please resend it?
Regards,
Alfred
|
|
|
mrachow
Posts: 509
|
Posted: 01/29/2005, 1:13 PM |
|
So sorry Alfred,
I was talking about the code which is generated by selection the action Login (this was this ).
For me it is like follows (login and password are the names of the textboxes)
com.codecharge.util.Authenticator auth = com.codecharge.util.AuthenticatorFactory.getAuthenticator( e.getPage().getRequest() );
auth.setRequest( e.getPage().getRequest() );
auth.setResponse( e.getPage().getResponse() );
auth.invalidate();
if ( auth.authenticate( e.getComponent().getControl("login").getFormattedValue(), e.getComponent().getControl("password").getFormattedValue() ) ) {
String retLink = e.getPage().getHttpGetParams().getParameter("ret_link");
if (retLink != null) e.getPage().setRedirectString( retLink );
} else {
e.getParent().addError("Name oder Passwort falsch.");
e.getPage().setRedirectString( null );
e.getComponent().getControl("password").setFormattedValue("");
}
_________________
Best regards,
Michael |
|
|
|