View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0011682 | mantisbt | other | public | 2010-03-19 05:40 | 2010-09-03 09:38 |
| Reporter | uso | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | confirmed | Resolution | open | ||
| Product Version | 1.2.0 | ||||
| Summary | 0011682: user_get_logged_in_user_ids always returns only one user | ||||
| Description | user_get_logged_in_user_ids always returns only one user. Two errors in one line, error 1 - a typo, error 2 - wrong parameter: should be: | ||||
| Steps To Reproduce | Write something that uses user_get_logged_in_user_ids. Here is a minimalistic plugin of mine: [...]require_once( 'core.php' ); class onlineUsersPlugin extends MantisPlugin
| ||||
| Additional Information | Solution: patch user_api.php (See attached patch file) | ||||
| Tags | No tags attached. | ||||
| Attached Files | user_api.patch (844 bytes)
--- core/user_api.php Fri Mar 19 10:09:34 2010
+++ core/user_api.php Fri Mar 19 10:09:35 2010
@@ -426,18 +426,19 @@
# Generate timestamp
$t_last_timestamp_threshold = mktime( date( 'H' ), date( 'i' ) - 1 * $t_session_duration_in_minutes, date( 's' ), date( 'm' ), date( 'd' ), date( 'Y' ) );
$t_user_table = db_get_table( 'mantis_user_table' );
-
+
# Execute query
$query = 'SELECT id FROM ' . $t_user_table . ' WHERE last_visit > ' . db_param();
- $result = db_query_bound( $query, array( $c_last_timestamp_threshold ), 1 );
-
+ $result = db_query_bound( $query, array( $t_last_timestamp_threshold ) );
+
# Get the list of connected users
$t_users_connected = array();
+
while( $row = db_fetch_array( $result ) ) {
$t_users_connected[] = $row['id'];
}
-
+
return $t_users_connected;
}
| ||||