コード例 #1
0
 @Override
 public void registerUser(User user, String unencryptedPassword) {
   user.setPassword(createHash(unencryptedPassword));
   try {
     user.setId(userManager.addUser(user));
   } catch (Exception e) {
     throw new ManagerDataAccessException("Error while registering user", e);
   }
 }
コード例 #2
0
 @Override
 public void changePassword(User user, String password, String newUnencryptedPassword) {
   if (authenticate(user, password)) {
     user.setPassword(createHash(newUnencryptedPassword));
     try {
       userManager.updateUser(user);
     } catch (Exception e) {
       throw new ManagerDataAccessException("Error while rtrieving users", e);
     }
   }
 }