hi,
bellow is part of the org.jahia.engines.login.Login_Engine class that let a user logging in Jahia.
// Check if the user has site access ( even though it is not a user of this site )
theUser = ServicesRegistry.getInstance ()
.getJahiaSiteUserManagerService ()
.getMember (jParams.getSiteID (), username);
if (theUser != null) {
if (theUser.verifyPassword (password)) {
ok = true;
} else {
JahiaException je = new JahiaException ("Login error",
"User " + username + " entered bad password",
JahiaException.SECURITY_ERROR,
JahiaException.WARNING_SEVERITY);
logger.error (
"Couldn't validate password for user " +
theUser.getUserKey () +
"!",
je);
}
}
Regards, Khue Nguyen
----- Original Message ----- From: "eric" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 26, 2004 4:45 PM
Subject: login method
I got a problem with the login() method !!! I try to utilize the four existing
methods contained in
JahiaUserManagerRoutingService,JahiaUserManagerService,JahiaUserManagerDBProvid
er,JahiaUserManagerProvider. Each of these method returns false !!! The user,
I want to log is the root.
I made this template inside my site to log users!
Maybe I forgot something !
Here is my code :
boolean log,log2,log3,log4,log5;
log=JahiaUserManagerDBProvider.getInstance().login("root","azertyu"); out.print("<br>UserManagerDBProvider<br>"+log+"<br>");
out.print("<br>TEST_LOG2 USER er<br>"); log2= JahiaUserManagerDBProvider.getInstance().login("er","qsdfghj"); out.print(log2);
log3= JahiaUserManagerRoutingService.getInstance().login("root","azertyu");
out.print("<br>UserManagerRoutingService: <br>"+log3);
out.print("<br>JahiaUserManagerProvider : <br>"); JahiaUserManagerProvider jahiausermanagerprovider = JahiaUserManagerDBProvider.getInstance(); log4 = jahiausermanagerprovider.login("root","azertyu"); out.print(log4);
out.print("<br>JahiaUserManagerService : <br>"); JahiaUserManagerService jahiausermanagerservice = JahiaUserManagerRoutingService.getInstance(); log5=jahiausermanagerservice.login("root","azertyu"); out.print(log5);
