Message Boards
How to obtain the user id of visited user profile ?
Amar Daulatkar, modified 12 Years ago.
How to obtain the user id of visited user profile ?
New Member Posts: 8 Join Date: 3/30/12 Recent Posts
Hello
I am using Liferay portal 6.0.1. Tell me how to find/get the user id of Richard Editor after going to his public page if i login as Bruno Admin.
I am using Liferay portal 6.0.1. Tell me how to find/get the user id of Richard Editor after going to his public page if i login as Bruno Admin.
Sandeep Nair, modified 12 Years ago.
RE: How to obtain the user id of visited user profile ?
Liferay Legend Posts: 1744 Join Date: 11/6/08 Recent Posts
you can try
Group group = themeDisplay.getLayout().getGroup();
long userId = 0;
if(group.isUser()){
userId = group.getClassPK();
}
Amar Daulatkar, modified 12 Years ago.
RE: How to obtain the user id of visited user profile ?
New Member Posts: 8 Join Date: 3/30/12 Recent Posts
Thanks. It's working.
Dhrutika Parekh, modified 12 Years ago.
RE: How to obtain the user id of visited user profile ?
Expert Posts: 435 Join Date: 2/9/09 Recent Posts
Hi ,
You can get it by using below method:
<%
User user2 = null;
if (group.isUser()) {
user2 = UserLocalServiceUtil.getUserById(group.getClassPK());
}
%>
user1:::<%= themeDisplay.getUser().getFullName()%>
user2::<%= user2.getFullName() %>
Here user2 will return you username of Richard Editor.
Regards,
Dhrutika
You can get it by using below method:
<%
User user2 = null;
if (group.isUser()) {
user2 = UserLocalServiceUtil.getUserById(group.getClassPK());
}
%>
user1:::<%= themeDisplay.getUser().getFullName()%>
user2::<%= user2.getFullName() %>
Here user2 will return you username of Richard Editor.
Regards,
Dhrutika
chirag @ India, modified 11 Years ago.
RE: How to obtain the user id of visited user profile ?
Regular Member Posts: 129 Join Date: 12/21/11 Recent Posts
Hello Dhrutika
How to obtain the user id of visited user profile in velocity template ?
Help me
How to obtain the user id of visited user profile in velocity template ?
Help me
chirag @ India, modified 11 Years ago.
RE: How to obtain the user id of visited user profile ?
Regular Member Posts: 129 Join Date: 12/21/11 Recent Postschirag @ India:
Hello Dhrutika
How to obtain the user id of visited user profile in velocity template ?
Help me
I got Solution and look at this link post.