View Issue Details

IDProjectCategoryView StatusLast Update
0037182mantisbtadministrationpublic2026-06-01 05:07
Reporterderick Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status acknowledgedResolutionopen 
Product Version2.28.3 
Summary0037182: A way to see all users without any activity
Description

Hi,

On the Users page (https://bugs.xdebug.org/manage_user_page.php), it is possible to see all users that never logged in (Unused), or are New. I would like there to be a additional tab for users that never had any activity (no bugs, notes, attachments, or monitored issues).

I have created a patch for that, which I have attached. It's my first one, so please be kind. I also don't know if I missed any other possible activities, but these can be easily added.

If this seems suitable, I can also provide some translations.

cheers,
Derick

TagsNo tags attached.
Attached Files
no-activity.diff.txt (2,258 bytes)   
diff --git a/html/lang/strings_english.txt b/html/lang/strings_english.txt
index 587d9c9..e8b62c0 100644
--- a/html/lang/strings_english.txt
+++ b/html/lang/strings_english.txt
@@ -723,6 +723,7 @@ $s_documentation_link = 'Documentation';
 $s_new_accounts_title = 'New Accounts';
 $s_1_week_title = '1 Week';
 $s_never_logged_in_title = 'Never Logged In';
+$s_no_activity_title = 'No User Activity';
 $s_prune_accounts = 'Prune Accounts';
 $s_hide_inactive = 'Hide Inactive';
 $s_show_disabled = 'Show Disabled';
@@ -1806,4 +1807,5 @@ $s_filter_all = 'All';
 $s_filter_new = 'New';
 $s_filter_unused_tags = 'Unused';
 $s_filter_unused = 'Unused';
+$s_filter_no_activity = 'No Activity';
 $s_unknown = 'unknown';
diff --git a/html/manage_user_page.php b/html/manage_user_page.php
index b6f4e37..034694c 100644
--- a/html/manage_user_page.php
+++ b/html/manage_user_page.php
@@ -144,6 +144,7 @@ $t_prefix_array = array_merge (
 		[
 			'UNUSED' => lang_get( 'filter_unused' ),
 			'NEW' => lang_get( 'filter_new' ),
+			'NO_ACTIVITY' => lang_get( 'filter_no_activity' ),
 		]
 	);
 
@@ -163,6 +164,9 @@ foreach ( $t_prefix_array as $t_prefix => $t_caption ) {
 	} else if( $t_prefix === 'NEW' ) {
 		$t_search = '';
 		$t_title = ' title="[' . $t_new_user_count . '] (' . lang_get( '1_week_title' ) . ')"';
+	} else if( $t_prefix === 'NO_ACTIVITY' ) {
+		$t_search = '';
+		$t_title = ' title="' . lang_get( 'no_activity_title' ) . '"';
 	} else {
 		$t_search = $f_search;
 		$t_title = '';
@@ -186,6 +190,14 @@ if( $f_filter === 'ALL' ) {
 	$t_where = '(1 = 1)';
 } else if( $f_filter === 'UNUSED' ) {
 	$t_where = '(login_count = 0) AND ( date_created = last_visit )';
+} else if( $f_filter === 'NO_ACTIVITY' ) {
+	$t_wheres = [
+		'NOT EXISTS (SELECT * from {bug} WHERE {user}.id = {bug}.reporter_id)',
+		'NOT EXISTS (SELECT * from {bugnote} WHERE {user}.id = {bugnote}.reporter_id)',
+		'NOT EXISTS (SELECT * from {bug_file} WHERE {user}.id = {bug_file}.user_id)',
+		'NOT EXISTS (SELECT * from {bug_monitor} WHERE {user}.id = {bug_monitor}.user_id)',
+	];
+	$t_where = implode( ' AND ', $t_wheres );
 } else if( $f_filter === 'NEW' ) {
 	$t_where = db_helper_compare_time( db_param(), '<=', 'date_created', $t_days_old );
 	$t_where_params[] = db_now();
no-activity.diff.txt (2,258 bytes)   

Activities

atrol

atrol

2026-05-28 17:24

developer   ~0071178

Thanks @derick for your contribution.
Attaching a Git patch is good, sending a pull requests on our Github repository would be even better.

If this seems suitable, I can also provide some translations.

Not needed as part of the pull request.
Translations are managed via TranslateWiki. See our own Wiki for the process to submit new translations or revise existing ones.

@dregad it would be better to have filtering and action options similar to the View Issue page.
As hardly anyone has time to implement it, we could go for the proposed change, as it adds value to the admin.
What do you think?

dregad

dregad

2026-05-29 05:38

developer   ~0071180

I agree this would be a useful improvement to user management. Also no need to wait for a hypothetical future refactoring of this page.

Patch seems OK overall, but I did not actually test it yet. Here's a few preliminary comments.

I'm a bit concerned about the performance, due to the addition of several NOT EXISTS subqueries. Could be bad on instances with a large amount of users such as ours.

I think Protected users should never be considered inactive (e.g. anonymous user).

More importantly we need to discuss and agree on the definition of activity, from a functional perspective. For example, am I active If I just browse the site ? What if I change my user preferences or save a filter ?

Looking at Derick's patch, the notion of activity is restricted to actual contribution to Issues, i.e. the user must satisfy at least one of the following criteria:

  • reported an Issue (bug table)
  • added a note (bugnote table)
  • uploaded an attachment to an Issue (bug_file table)
  • is actively monitoring one or more issues (bug_monitor table)

There are are quite a few more relationships to the user table that could also denote functional activity (see MantisBT entity-relationship diagram), for example tags (ownership by creation and links to Issues), filters, as well as user profiles, and even the (unofficially deprecated) sponsorships or the little-used news feature...

Does being assigned to an Issue count (bug.handler_id) as activity ? What about membership in a Project ?

Also, do we need to check historical activity, e.g. I monitored an Issue, then stopped monitoring it later ? With this patch, it would not be considered. Should we look at history table ? Bug/bugnote revisions ?

Do we need to include "technical" activity too ? Think about tokens and config tables, user preferences.

derick

derick

2026-05-29 06:14

reporter   ~0071181

I'm a bit concerned about the performance, due to the addition of several NOT EXISTS subqueries. Could be bad on instances with a large amount of users such as ours.

I don't know how many users you have, but the query (with the four NOT EXISTS) takes 0.01 seconds on my install, with my ~2900 users.

I think Protected users should never be considered inactive (e.g. anonymous user).

That's right. I thought that it already filtered these out, but it seems not.

More importantly we need to discuss and agree on the definition of activity, from a functional perspective. For example, am I active If I just browse the site ? What if I change my user preferences or save a filter ?

I am mainly concerned about casual "reporter" users that have an account, but have not contributed content, and haven't logged in for > 1 year. I basically want to clean up the users that I have in there. Users assigned to issues and project memberships are usually not just "reporter" users.

I think I definitely should make amends for "asssigned to an issue" and "membership in a project", and perhaps having previously contributed to bug notes/revisions, but I wouldn't consider technical activity, such as tokens and config etc.

dregad

dregad

2026-05-29 06:23

developer   ~0071182

I don't know how many users you have

~ 50k

I am mainly concerned about casual "reporter" users that have an account, but have not contributed content, and haven't logged in for > 1 year.

That makes sense, and if you take the last login date and the access level into consideration, then many of the related tables I mentioned in my earlier post are possibly irrelevant.

Bear in mind that manage_users_page.php currently does not allow to selectively act on multiple accounts.

derick

derick

2026-06-01 05:07

reporter   ~0071211

Bear in mind that manage_users_page.php currently does not allow to selectively act on multiple accounts.

I know, and I would like to give that some attention too.