use of com.liferay.portal.model.User in project liferay-ide by liferay.
the class UserLocalServiceImpl method updatePasswordReset.
/**
* Updates whether the user should be asked to reset their password the next
* time they login.
*
* @param userId the primary key of the user
* @param passwordReset whether the user should be asked to reset their
* password the next time they login
* @return the user
* @throws PortalException if a user with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public User updatePasswordReset(long userId, boolean passwordReset) throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId);
user.setPasswordReset(passwordReset);
userPersistence.update(user);
return user;
}
use of com.liferay.portal.model.User in project liferay-ide by liferay.
the class UserLocalServiceImpl method getUserIdByEmailAddress.
/**
* Returns the primary key of the user with the email address.
*
* @param companyId the primary key of the user's company
* @param emailAddress the user's email address
* @return the primary key of the user with the email address
* @throws PortalException if a user with the email address could not be
* found
* @throws SystemException if a system exception occurred
*/
@Override
public long getUserIdByEmailAddress(long companyId, String emailAddress) throws PortalException, SystemException {
emailAddress = StringUtil.toLowerCase(emailAddress.trim());
User user = userPersistence.findByC_EA(companyId, emailAddress);
return user.getUserId();
}
use of com.liferay.portal.model.User in project liferay-ide by liferay.
the class UserLocalServiceImpl method updateFacebookId.
/**
* Updates the user's Facebook ID.
*
* @param userId the primary key of the user
* @param facebookId the user's new Facebook ID
* @return the user
* @throws PortalException if a user with the primary key could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public User updateFacebookId(long userId, long facebookId) throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId);
user.setFacebookId(facebookId);
userPersistence.update(user);
return user;
}
use of com.liferay.portal.model.User in project liferay-ide by liferay.
the class UserLocalServiceImpl method getUserIdByScreenName.
/**
* Returns the primary key of the user with the screen name.
*
* @param companyId the primary key of the user's company
* @param screenName the user's screen name
* @return the primary key of the user with the screen name
* @throws PortalException if a user with the screen name could not be found
* @throws SystemException if a system exception occurred
*/
@Override
public long getUserIdByScreenName(long companyId, String screenName) throws PortalException, SystemException {
screenName = getLogin(screenName);
User user = userPersistence.findByC_SN(companyId, screenName);
return user.getUserId();
}
use of com.liferay.portal.model.User in project liferay-ide by liferay.
the class UserLocalServiceImpl method getDefaultUser.
/**
* Returns the default user for the company.
*
* @param companyId the primary key of the company
* @return the default user for the company
* @throws PortalException if a default user for the company could not be
* found
* @throws SystemException if a system exception occurred
*/
@Override
@Skip
public User getDefaultUser(long companyId) throws PortalException, SystemException {
User userModel = _defaultUsers.get(companyId);
if (userModel == null) {
userModel = userLocalService.loadGetDefaultUser(companyId);
_defaultUsers.put(companyId, userModel);
}
return userModel;
}
Aggregations