+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Listing Logged In Users (like the admin 'all user slots used' screen)

Listing Logged In Users (like the admin 'all user slots used' screen)

6 posts, 0 answered
  1. Richard
    Richard avatar
    103 posts
    Registered:
    04 Apr 2013
    25 Aug 2015
    Link to this post

    I've noticed that admin users can see all the users logged in, and give the admin ability to kick off users. But main issue is if you are not admin, you don't see any list of users. 

    What i want to do is display the users to a regular user whom are logged in. This is to create a process where we're running out of slots and some users don't log out. 

    I would rather upgrade my user slot count at a premium price but I suppose there is no option for that, but rather to spend a significant amount more to upgrade the the next package. We'd rather pay for more slots vs an entire feature set we likely won't use (yet). 

  2. Dave
    Dave avatar
    29 posts
    Registered:
    27 Aug 2010
    25 Aug 2015 in reply to Richard
    Link to this post
    Where in Sitefinity does it display the logged in users? I've wanted this feature for sometime but can not find it.
  3. Dave
    Dave avatar
    29 posts
    Registered:
    27 Aug 2010
    25 Aug 2015
    Link to this post
    I found it,  it's on the main user page in the back end under status.
  4. Richard
    Richard avatar
    103 posts
    Registered:
    04 Apr 2013
    26 Aug 2015 in reply to Dave
    Link to this post

    Hi Dave, 

    So I'm trying to recreate this feature. 

    var userManager = UserManager.GetManager();

    var users = userManager.GetUsers().OrderBy(user => user.UserName).ToList();

    var usersLoggedIn = users.Where(user => user.IsLoggedIn).ToList();

    But I seem to get almost 38 users. Now, I looked at the database, and did a select by

    SELECT * FROM [sf635000_intranet].[dbo].[sf_users] 
    WHERE is_logged_in = 1 ORDER BY last_login_date DESC

    But there I know some users logged out, which would explain why this select statement fails. I could have someone who's listed as the 8th row, but they still show as logged in on the CMS. Isn't there a 'last_logged_out' column I could use?

    What would the proper API method be to get 'the currently logged in users'??

  5. Richard
    Richard avatar
    103 posts
    Registered:
    04 Apr 2013
    28 Aug 2015 in reply to Richard
    Link to this post

    Bump.

     Any ideas?

  6. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    02 Dec 2016
    31 Aug 2015
    Link to this post
    Hi Richard,

    This is a known issue in Sitefinity and we have logged a bug related to it in our feedback portal:

    User.IsLoggedIn does not display the correct status

    The issue is fixed in internal build 8.0.5719.0 and what I can suggest is to upgrade your Sitefinity project to the latest internal build of Sitefinity 8.0 or directly to Sitefinity 8.1 where the fix is also included. Please refer to the following documentation article for more details about the supported upgrade procedure.

    If you decide to upgrade to the internal build, please note that you can download the latest internal build for each Sitefinity version from your Sitefinity.com account in section Products & Subscriptions -> Latest Internal Builds.
     
    Regards,
    Sabrie Nedzhip
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
6 posts, 0 answered