can I check what are Users online or offline in xpertivy use IUSER ?

asked 27.02.2014 at 06:37

toantp's gravatar image

toantp
(suspended)
accept rate: 0%

if you download this project, a overview of online Users is given. https://guidelines.soreco.ch/attachments/787/AdminAddOns.zip

The user Management of ivy Server (5.08) also shows whether a user is logged on or not.

(27.02.2014 at 09:07) roland roland's gravatar image

The following script only returns all sessions of the current cluster node:

ivy.session.getSecurityContext().getSessions()

To get a list of all users that are online on any cluster node of a Xpert.ivy Enterprise Server use the following code:

import ch.ivyteam.ivy.security.SessionInfo;

List<String> onlineUsers;
for (SessionInfo sessionInfo : ivy.session.getSecurityContext().getClusterSessionsSnapshot().getSessionInfos())
{
    if (!sessionInfo.isSessionUserUnknown())
    {
        if (!onlineUsers.contains(sessionInfo.getSessionUserName()))
        {
            onlineUsers.add(sessionInfo.getSessionUserName());
        }
    }
}
link

answered 04.03.2014 at 17:18

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k202857
accept rate: 74%

I don't think that this will work directly by using Iuser.

I've two possibilities how I would do that.

1) Get all the Sessions that are oppened on the securityContext and read the users which has this sessions created.

List<iuser> userList = new ArrayList<iuser>(); for (ISession s : Ivy.session().getSecurityContext().getSessions()){ userList.add(s.getSessionUser()); }

2) Set a property on the users when they login. Then get all Users from the SecurtiyContext and check the property for each user.

iuser.setProperty("login", "true");

link

answered 27.02.2014 at 09:28

Raphael%20B%C3%BCrgin's gravatar image

Raphael Bürgin
(suspended)
accept rate: 55%

edited 27.02.2014 at 09:30

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×26

Asked: 27.02.2014 at 06:37

Seen: 10,842 times

Last updated: 05.03.2014 at 08:51