留言板

Unable to get the location of the logged in user

thumbnail
Madhura Shetty,修改在8 年前。

Unable to get the location of the logged in user

Junior Member 帖子: 80 加入日期: 13-11-7 最近的帖子
Please let me know how to get the location of the logged in user in liferay . I am using LDAP settings for authentication.
I am able to get the loggedin user email address but the Location.

ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
String loggedinemailID = themeDisplay.getUser().getDisplayEmailAddress();


But i dont know what to use for Location.

Please help
thumbnail
Meera Prince,修改在8 年前。

RE: Unable to get the location of the logged in user

Liferay Legend 帖子: 1111 加入日期: 11-2-8 最近的帖子
thumbnail
David H Nebinger,修改在8 年前。

RE: Unable to get the location of the logged in user

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
Geez, Meera, I know you're in a posting mood lately, but you could try actually reading the post before spewing incorrect/irrelevant information as a response.

The Location organization type is just a relationship for the user. You find the "org" they belong to and that, if it is a Location org type, will be their location.

The hard part of course is if they belong to multiple locations, you can't really distinguish which Location they happen to be at.
thumbnail
Meera Prince,修改在8 年前。

RE: Unable to get the location of the logged in user

Liferay Legend 帖子: 1111 加入日期: 11-2-8 最近的帖子
Hi
I follow your suggestion and thank you very much..David from the question I thought of finding user location from where he/she login. However I agree with you..


Regards,
Meera Prince
thumbnail
Jack Bakker,修改在8 年前。

RE: Unable to get the location of the logged in user

Liferay Master 帖子: 978 加入日期: 10-1-3 最近的帖子
Madhura Shetty:
Please let me know how to get the location of the logged in user in liferay . I am using LDAP settings for authentication.
I am able to get the loggedin user email address but the Location.

ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
String loggedinemailID = themeDisplay.getUser().getDisplayEmailAddress();


But i dont know what to use for Location.

Please help


Madhura, what do you mean exactly by 'location' ?

address info ? longitude/latitude ? association with a location organization ?
thumbnail
Madhura Shetty,修改在8 年前。

RE: Unable to get the location of the logged in user

Junior Member 帖子: 80 加入日期: 13-11-7 最近的帖子
Under Active Directory we have saved the users Office details so, I want to know to which office the users belongs through liferay.
thumbnail
Meera Prince,修改在8 年前。

RE: Unable to get the location of the logged in user

Liferay Legend 帖子: 1111 加入日期: 11-2-8 最近的帖子
HI
Generally in LDAP integration with Liferay in the portal configuration we need to map LDAP user attributes with Liferay user attributes so that data will be stored in the liferay related user tables.So you need find required ldap attribute and map with liferay user attribute so that data will be available in the liferay tables with respect to user.Go to liferay portal configuration and look at LDAP authentication part and you can understand more.
'Try below link it may help you something..

http://www.liferaysavvy.com/2013/10/liferay-ldap-integration_8.html


Regards,
Meera Prince
thumbnail
David H Nebinger,修改在8 年前。

RE: Unable to get the location of the logged in user

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
Groups can be pulled in by the LDAP importer, but I don't think organization is.

The good news is that it is "easy" to extend the Liferay LDAP importer to manage your own attribute importing. You may find that you need to do the organization assignment yourself.
thumbnail
Meera Prince,修改在8 年前。

RE: Unable to get the location of the logged in user

Liferay Legend 帖子: 1111 加入日期: 11-2-8 最近的帖子
Hi
We might create expando column for user/ custom user filed and we can map ldap attribute to user custom attributes. this is also one of the way to keep.location. hope it will help.


Regards,
Meera Prince
thumbnail
David H Nebinger,修改在8 年前。

RE: Unable to get the location of the logged in user

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
Rarely is it a good idea to create a custom field to hold a value for which Liferay has existing columns/entities to hold the data already. Liferay knows how to join on columns that it's aware of; custom fields do not play any role in normal Liferay operation.