Search in sources :

Example 16 with User

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;
}
Also used : User(com.liferay.portal.model.User)

Example 17 with 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();
}
Also used : User(com.liferay.portal.model.User)

Example 18 with User

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;
}
Also used : User(com.liferay.portal.model.User)

Example 19 with 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();
}
Also used : User(com.liferay.portal.model.User)

Example 20 with User

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;
}
Also used : User(com.liferay.portal.model.User) Skip(com.liferay.portal.kernel.spring.aop.Skip)

Aggregations

User (com.liferay.portal.model.User)97 Date (java.util.Date)22 SystemException (com.liferay.portal.kernel.exception.SystemException)17 Group (com.liferay.portal.model.Group)15 PortalException (com.liferay.portal.kernel.exception.PortalException)13 Company (com.liferay.portal.model.Company)11 ServiceContext (com.liferay.portal.service.ServiceContext)11 Indexable (com.liferay.portal.kernel.search.Indexable)10 UserGroup (com.liferay.portal.model.UserGroup)10 IOException (java.io.IOException)9 DuplicateUserEmailAddressException (com.liferay.portal.DuplicateUserEmailAddressException)8 EncryptorException (com.liferay.util.EncryptorException)7 Song (org.liferay.jukebox.model.Song)7 Contact (com.liferay.portal.model.Contact)6 PrincipalException (com.liferay.portal.security.auth.PrincipalException)6 Album (org.liferay.jukebox.model.Album)6 DuplicateUserScreenNameException (com.liferay.portal.DuplicateUserScreenNameException)5 GroupFriendlyURLException (com.liferay.portal.GroupFriendlyURLException)5 NoSuchImageException (com.liferay.portal.NoSuchImageException)5 NoSuchOrganizationException (com.liferay.portal.NoSuchOrganizationException)5