Add LDAP support.

This commit is contained in:
Paulo Gustavo Veiga
2013-02-17 21:00:08 -03:00
parent 51f531f6b4
commit 3ff67910c9
13 changed files with 203 additions and 21 deletions

View File

@@ -26,7 +26,7 @@ public interface UserService {
public void activateAccount(long code) throws InvalidActivationCodeException;
public User createUser(@NotNull User user, boolean emailConfirmEnabled) throws WiseMappingException;
public User createUser(@NotNull User user, boolean emailConfirmEnabled,boolean welcomeEmail) throws WiseMappingException;
public void changePassword(@NotNull User user);
@@ -41,4 +41,6 @@ public interface UserService {
public void deleteUser(@NotNull User user);
public void auditLogin(@NotNull User user);
public User getCasUserBy(String uid);
}

View File

@@ -107,7 +107,7 @@ public class UserServiceImpl
userManager.auditLogin(accessAuditory);
}
public User createUser(@NotNull User user, boolean emailConfirmEnabled) throws WiseMappingException {
public User createUser(@NotNull User user, boolean emailConfirmEnabled, boolean welcomeEmail) throws WiseMappingException {
final UUID uuid = UUID.randomUUID();
user.setCreationDate(Calendar.getInstance());
user.setActivationCode(uuid.getLeastSignificantBits());
@@ -120,6 +120,7 @@ public class UserServiceImpl
}
Collaborator col = userManager.getCollaboratorBy(user.getEmail());
if (col != null) {
userManager.createUser(user, col);
} else {
@@ -134,7 +135,7 @@ public class UserServiceImpl
// Send registration email.
if (emailConfirmEnabled) {
notificationService.sendRegistrationEmail(user);
} else {
} else if (welcomeEmail) {
// Send a welcome email ..
notificationService.newAccountCreated(user);
}
@@ -205,4 +206,10 @@ public class UserServiceImpl
public void setVelocityEngine(VelocityEngine velocityEngine) {
this.velocityEngine = velocityEngine;
}
@Override
public User getCasUserBy(String uid) {
// TODO Auto-generated method stub
return null;
}
}