Skip to Content
0

Error while trying to load the list of users connected in Portal 7.5

Mar 22 at 02:40 PM

58

avatar image
Former Member

Hi all,

There is a need to control the sessions opened by users, where each user can only have 1 session open.

If the user already has an open session and tries to open a new session in another browser it should be blocked.

Before the upgrade, still in version 7.0nw, for access control we used the WDClientUser API, method getClientUsers ().

The getClientUsers () method. returned a list of logged-in users, but after the upgrade this method stopped working, and we did not find any solution or other method that would get the active users of the Portal

follows our solution method that works in version 7.0 and does not work in version 7.5

  public boolean verificaMultiploLogon( )  {
    //@@begin verificaMultiploLogon()
	 
	SessionID session = new SessionID();
	IWDClientUser userlist[] = WDClientUser.getClientUsers();
	
	int loginCount = 0;
	
	for (int index=0;index < userlist.length;index++)
	{
		if (userlist[index].getSAPUser() != null)
		{
			if (userlist[index].getSAPUser().getUniqueName().equals(session.getLogonId()))
			{
				loginCount++;
			}
		}
	}
	
	if (loginCount > 1 && !session.getLogonId().toUpperCase().equals("MFARIAS") && !session.getLogonId().toUpperCase().equals("LBATISTA") && !session.getLogonId().toUpperCase().equals("LPRATES") && !session.getLogonId().toUpperCase().equals("CASILVA03"))
	{
		String message = wdComponentAPI.getTextAccessor().getText(IMessageAutoWMFabNewComponent.E03, new String[]{session.getLogonId().toUpperCase()});
		this.messageManager.reportException(message, false);
		return false;
	}
	else
	{
		return true;
	}    
    //@@end
  }
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Milen Dontcheff
Apr 17 at 09:25 AM
0

Hello Claudio,

the getClientUsers method is depricated and since NetWeaver 7.10; no replacement available! Starting with NetWeaver 7.10, the method will return an array containing only one element, that is the IWDClientUser of the current user session.

https://help.sap.com/doc/javadocs_nwce_current/7.2.1/en-US/wdr/com.sap.wdr/com/sap/tc/webdynpro/services/sal/um/api/WDClientUser.html

Have you tried to use method forceLoggedInClientUser() instead? If the user is logged in then they have session already, don't they?

And if this is true then you might forbid to open a new session.

Regards,

Share
10 |10000 characters needed characters left characters exceeded