on 03-22-2018 2:40 PM
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
}
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.
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,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.