@Override public boolean checkPasswords(MessageManager message, User user, int password) { if (user.getPassword() == password) { return true; } message.addMessage(MSG_PASSWORD); return false; }
@Override public boolean login(MessageManager message, User user) { if (user == null) { LOG.warn("User is null"); return false; } int password = user.getPassword(); try { user = userDao.findByEmail(user.getEmail()); if (user == null || user.getPassword() != password) { message.addMessage(MSG_ICORRECT); return false; } } catch (DatabaseException e) { LOG.error("Login failed", e); message.addMessage(MSG_LOGIN); return false; } return true; }