Guest User

Untitled

a guest
Jun 18th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. /**
  2. * Changes the session user without any login processing. Further the session cart is assigned to the new user.
  3. *
  4. * @param u
  5. * the new user
  6. */
  7. public void setUser(final User u)
  8. {
  9. if (u == null)
  10. {
  11. throw new JaloInvalidParameterException("session user cannot be null", 0);
  12. }
  13. if (!u.equals(getUser()))
  14. {
  15. final User previous = u;
  16. //
  17. getSessionContext().setUser(u);
  18. if (hasCart())
  19. {
  20. getCart().setUser(u);
  21. }
  22. notifyExtensionsAfterUserChange(previous);
  23. }
  24. }
Add Comment
Please, Sign In to add comment