Created
October 5, 2012 16:42
-
-
Save nshaw/3840907 to your computer and use it in GitHub Desktop.
Find User By Email
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.liferay.portal.service.UserLocalServiceUtil | |
| import com.liferay.portal.util.PortalUtil | |
| import com.liferay.portal.model.User | |
| try { | |
| long companyId = PortalUtil.getDefaultCompanyId() | |
| String email = "nathan.shaw@liferay.com" | |
| User user = UserLocalServiceUtil.getUserByEmailAddress(companyId, email) | |
| println user | |
| } | |
| catch (Exception e) { | |
| println ("Script failed" + e) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rolf-schramek@t-online.de