View Issue Details

IDProjectCategoryView StatusLast Update
0012909mantisbtfeaturepublic2014-02-02 05:49
Reporterlindalva Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Product Version1.2.4 
Summary0012909: number of logged users
Description

Is there any function where i can know/monitoring exactly how many users are logged in my Mantis application in certain time?

version: 1.2.4
windows

TagsNo tags attached.

Relationships

related to 0004820 acknowledged Would be nice to view who is currently logged in 

Activities

dhx

dhx

2011-04-05 09:16

reporter   ~0028530

This feature does not yet exist because MantisBT doesn't maintain a list of sessions. Instead MantisBT relies upon PHP's built in session management.

You can't officially enumerate PHP sessions unless you start using hacks/workarounds. See http://stackoverflow.com/questions/675913/looping-through-all-a-servers-sessions-in-php for an example which only works in specific circumstances.

For what you're wanting to do it'd be best to create a new database table within MantisBT that tracks the "last access time" for each user so you can determine approximately how many people were connected within a certain time period.

atrol

atrol

2011-04-05 09:48

developer   ~0028534

There is no need for a new database table.
The existing user_table has a column last_visit for this.
There is also a prepared but not used function user_get_logged_in_user_ids in core/user_api.php to get an array of currently estimated logged in users

dhx

dhx

2011-04-05 10:08

reporter   ~0028535

Thanks atrol, good catch:)

lindalva

lindalva

2011-04-06 15:02

reporter   ~0028546

Thank you very much