留言板

DIsable multiple logins with same user

vijay sharma,修改在10 年前。

DIsable multiple logins with same user

New Member 帖子: 15 加入日期: 13-5-15 最近的帖子
Hi
I am using liferay-portal-5.2.3 .I want DIsable multiple logins with same user .
I checked in foram and found that use in portal-ext.properties file and change

auth.simultaneous.logins=false

but still is not working.If you know about this please help.
thumbnail
Raja Seth,修改在10 年前。

RE: DIsable multiple logins with same user

Regular Member 帖子: 233 加入日期: 11-8-18 最近的帖子
Hi Vijay,

I haven't tried but refer to portal-impl\src\portal.properties where auth.simultaneous.logins=true. The comment says "This property is not used unless the property live.users.enabled is set to true" and by default live.users.enabled=false.

Make the following changes and see if it solves your problem.

Regards,
Raja
thumbnail
Pranoti Nandurkar,修改在10 年前。

RE: DIsable multiple logins with same user

Junior Member 帖子: 48 加入日期: 12-2-3 最近的帖子
Did you restart the server after change in portal-ext.properties file?
vijay sharma,修改在10 年前。

RE: DIsable multiple logins with same user

New Member 帖子: 15 加入日期: 13-5-15 最近的帖子
Yes I restart the server after change in portal-ext.properties file but still have same problem.
vijay sharma,修改在10 年前。

RE: DIsable multiple logins with same user

New Member 帖子: 15 加入日期: 13-5-15 最近的帖子
Hi
I have changed also in property files but still is not working.
do u have any idea that is this type features have in this version of liferay-portal-5.2.3.beacues I am trying to find but didn't get?
thumbnail
Tejas Kanani,修改在10 年前。

RE: DIsable multiple logins with same user

Liferay Master 帖子: 654 加入日期: 09-1-6 最近的帖子
Hi Vijay,

AFAIK, Preventing user to login simultaneously is not available in Liferay 5.2.3. As neither portal.properties has "auth.simultaneous.logins=false" property nor LoginUtil.java has any code which prevent simultaneous login for Liferay 5.2.3

So if you need that in Liferay 5.2.3, you'll have to add it somehow by overriding existing code.

Thanks,
Tejas
vijay sharma,修改在10 年前。

RE: DIsable multiple logins with same user

New Member 帖子: 15 加入日期: 13-5-15 最近的帖子
Hi Tejas,

Thanks for your revert.

Appreciate if you can share any sample code which helps address this issue.
thumbnail
Tejas Kanani,修改在10 年前。

RE: DIsable multiple logins with same user

Liferay Master 帖子: 654 加入日期: 09-1-6 最近的帖子
This is the code which exist in Liferay 6.1 -- LoginUtil.java -> login method, check it out it might help you.



		if (!PropsValues.AUTH_SIMULTANEOUS_LOGINS) {
			Map<string, usertracker> sessionUsers = LiveUsers.getSessionUsers(
				company.getCompanyId());

			List<usertracker> userTrackers = new ArrayList<usertracker>(
				sessionUsers.values());

			for (UserTracker userTracker : userTrackers) {
				if (userId != userTracker.getUserId()) {
					continue;
				}

				JSONObject jsonObject = JSONFactoryUtil.createJSONObject();

				ClusterNode clusterNode =
					ClusterExecutorUtil.getLocalClusterNode();

				if (clusterNode != null) {
					jsonObject.put(
						"clusterNodeId", clusterNode.getClusterNodeId());
				}

				jsonObject.put("command", "signOut");

				long companyId = CompanyLocalServiceUtil.getCompanyIdByUserId(
					userId);

				jsonObject.put("companyId", companyId);
				jsonObject.put("sessionId", userTracker.getSessionId());
				jsonObject.put("userId", userId);

				MessageBusUtil.sendMessage(
					DestinationNames.LIVE_USERS, jsonObject.toString());
			}
		}

		if (PropsValues.SESSION_ENABLE_PHISHING_PROTECTION) {
....
....
</usertracker></usertracker></string,>
vijay sharma,修改在10 年前。

RE: DIsable multiple logins with same user

New Member 帖子: 15 加入日期: 13-5-15 最近的帖子
Hi Tejas,

Thanks for your revert.

I checked as given your code but still have same issue.May be I am doing any mistake.
Would you please suggest more for same.
thumbnail
Tejas Kanani,修改在10 年前。

RE: DIsable multiple logins with same user

Liferay Master 帖子: 654 加入日期: 09-1-6 最近的帖子
What changes you have made ? And in which file ?
Can you please share your modified code ?
vijay sharma,修改在10 年前。

RE: DIsable multiple logins with same user

New Member 帖子: 15 加入日期: 13-5-15 最近的帖子
HI Tejas,

we have done some changes in portal-impl.jar file in loginutil.java and PropsValues.java class.

As given your code we put inside loginutil.java and also complied but it's not working.
thumbnail
Tejas Kanani,修改在10 年前。

RE: DIsable multiple logins with same user

Liferay Master 帖子: 654 加入日期: 09-1-6 最近的帖子
Any errors in backhand ? And even I've not tried it personally just share the code which exist in current version.
Tried by debugging the code and check whether its executing properly.