View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004820 | mantisbt | feature | public | 2004-11-06 11:36 | 2012-03-22 04:55 |
Reporter | MindRiot | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | acknowledged | Resolution | open | ||
Summary | 0004820: Would be nice to view who is currently logged in | ||||
Description | I cant seem to find a way to display currently logged in users. | ||||
Additional Information | In addition, some extra user tracking features might be nice, like last login, IPs used, etc | ||||
Tags | No tags attached. | ||||
Attached Files | show_who_is_connected.patch.txt (2,257 bytes)
Index: config_defaults_inc.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/config_defaults_inc.php,v retrieving revision 1.237 diff -u -r1.237 config_defaults_inc.php --- config_defaults_inc.php 23 Dec 2004 14:43:15 -0000 1.237 +++ config_defaults_inc.php 11 Jan 2005 23:04:51 -0000 @@ -1502,4 +1502,8 @@ # NOTE: These are meaningless under Windows! Just ignore them! $g_dot_tool = '/usr/bin/dot'; $g_neato_tool = '/usr/bin/neato'; + + + # Shows the list of all connected users in the footer of each pages (guideweb) + $g_show_who_is_connected= ON; ?> Index: core/html_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/html_api.php,v retrieving revision 1.145 diff -u -r1.145 html_api.php --- core/html_api.php 22 Dec 2004 20:25:55 -0000 1.145 +++ core/html_api.php 11 Jan 2005 23:06:37 -0000 @@ -391,6 +391,41 @@ } echo "\t", '<tr><td></td><td>', $t_total, '</td><td></td></tr>', "\n"; echo "\t", '</table>', "\n"; + + + } + } + + + # This allow users or anonymous to see who are connected + # It simply chech who has updated a page in the last 5 minutes (guideweb) + if( ON == config_get( 'show_who_is_connected' ) ) { + + + + # Generate timestamp + $t_last_5min_timestamp = mktime(date("H"), date("i") -5, date("s"), date("m"), date("d"), date("Y")); + $t_date_last_5min_date = date("Y-m-d H:i:s" , $t_last_5min_timestamp); + + + # Execute query + $t_user_table = config_get( 'mantis_user_table' ); + $query = "SELECT username + FROM $t_user_table + WHERE last_visit > '$t_date_last_5min_date'"; + $result = db_query( $query ); + + # Get the list of connected users + while ( $row = db_fetch_array( $result ) ) { + $t_users_connected[] = $row['username']; + } + + # This message is displayed on the login page, so we need to say if no user are currently connected + if (count($t_users_connected) == 0 ) { + echo 'No user connected.'; + } + else { + echo 'Users connected : ' . implode(', ',$t_users_connected) . '.'; } } } | ||||
related to | 0012909 | new | number of logged users |
This allow users or anonymous to see who are connected See .patch.txt for more details |
|
Thanks for contributing such feature. I think it will be a nice addition to Mantis. We just need to think where it should be shown and in what format. My comment on the concept is that I would rather have a configurable access level threshold that determines who can see the online users (for example, DEVELOPER) rather than just an ON / OFF. I will review the code and put more comments later. |
|
Are you going to add thease features ? if you dont i can. |
|
I implemented the following in user_api.php, based on your patch. I still have to add the GUI for it. I think we should also have the config as a threshold which specifies the minimum threshold that is needed to see the config, or NOBODY to disable the feature.
|
|
I noticed once that code and wondered where/when it was supposed to be included in the GUI... any plans for it? |
|
Hi guys, I'm also interested in this feature? Thanks, |
|
@stefang. AFAICT, right now it's more a matter of "where" we put that info in the current pages. any idea? |
|
I think a good place would be below the menu. (just an idea) |
|
Hmmmm, should just be visible for Administrator though, shouldn't it? |
|
Imho that seems to be no big difference to the last visit column you already have on the manage page, (which I'd like to have visible for project managers too (not only admins)). For the "logged in" users I'd vote to have it "more visible" (instead of a submenu). |
|
@ stefang. I'm sure visibility will be controlled by YACP (Yet Another Configuration Parameter) Of course, I am open for suggestions about the default value |
|
I think we should get some ideas from the forums (see http://www.mantisbt.org/forums) powered by phpBB3. It shows on the index page a list of all active users anonymous and registered. Then on the forum threads it shows an online icon next to users who are online. Following is a sample of the users only section on the index page:Who is online In total there are 6 users online :: 3 registered, 0 hidden and 3 guests (based on users active over the past 5 minutes) Registered users: Google [Bot], vboctor, Yahoo [Bot] |
|
Now that we support plugins, I believe this functionality should be implemented as a plugin, rather than be part of the core. What do you think? |
|
It's fine as a plug-in. Is there a list with all the available plug-ins? I expected a link in the Download page or somewhere, but I couldn't find one (sorry if it's a stupid question, I'm new to Mantis, and to bugtrackers in general). |
|
@Zamolxis: http://www.mantisforge.org/dev/manual/master/en/developers.html#DEV.PLUGINS and the source |
|
Is this a plugin already? Would very much like to use it ! :) |
|