Skip to content

Commit

Permalink
Obsolete option default_manage_user_prefix
Browse files Browse the repository at this point in the history
The option has been introduced in 2003 to solve performance issues on
installations with thousands of users.

The option was not documented in Admin Guide.

Paging (hardcoded 50 records) has been implemented in 2008.
After this, there is no longer the need for the option.
The performance is fine, even with more than 35k users.

Issue #24689
  • Loading branch information
atrol committed Aug 30, 2018
1 parent 5fa99c0 commit 6ed35e4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
10 changes: 0 additions & 10 deletions config_defaults_inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -3126,15 +3126,6 @@
*/
$g_user_login_valid_regex = '/^([a-z\d\-.+_ ]+(@[a-z\d\-.]+\.[a-z]{2,4})?)$/i';

/**
* Default user name prefix used to filter the list of users in
* manage_user_page.php. Change this to 'A' (or any other
* letter) if you have a lot of users in the system and loading
* the manage users page takes a long time.
* @global string $g_default_manage_user_prefix
*/
$g_default_manage_user_prefix = 'ALL';

/**
* Default tag prefix used to filter the list of tags in
* manage_tags_page.php. Change this to 'A' (or any other
Expand Down Expand Up @@ -4481,7 +4472,6 @@
'default_language',
'default_limit_view',
'default_manage_tag_prefix',
'default_manage_user_prefix',
'default_new_account_access_level',
'default_notify_flags',
'default_project_view_status',
Expand Down
5 changes: 4 additions & 1 deletion core/obsolete.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,7 @@
config_obsolete( 'differentiate_duplicates' );

# changes in 2.12.0
config_obsolete( 'session_handler' );
config_obsolete( 'session_handler' );

# changes in 2.17.0
config_obsolete( 'default_manage_user_prefix' );
17 changes: 10 additions & 7 deletions manage_user_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
$t_lock_image = '<i class="fa fa-lock fa-lg" title="' . lang_get( 'protected' ) . '" />';

$f_save = gpc_get_bool( 'save' );
$f_filter = gpc_get_string( 'filter', config_get( 'default_manage_user_prefix' ) );
$f_filter = gpc_get_string( 'filter', 'ALL' );
$f_search = gpc_get_string( 'search', '');
$f_page_number = gpc_get_int( 'page_number', 1 );

Expand Down Expand Up @@ -165,17 +165,20 @@
echo ' <div class="btn-group" >';
foreach ( $t_prefix_array as $t_prefix => $t_caption ) {
if( $t_prefix === 'UNUSED' ) {
$t_search = '';
$t_title = ' title="[' . $t_unused_user_count . '] (' . lang_get( 'never_logged_in_title' ) . ')"';
} else if( $t_prefix === 'NEW' ) {
$t_search = '';
$t_title = ' title="[' . $t_new_user_count . '] (' . lang_get( '1_week_title' ) . ')"';
} else {
$t_search = $f_search;
$t_title = '';
}
$t_active = (string)$t_prefix === $f_filter ? 'active' : '';
print_manage_user_sort_link( 'manage_user_page.php',
$t_caption,
$c_sort,
$c_dir, null, $c_hide_inactive, $t_prefix, $f_search, $c_show_disabled,
$c_dir, null, $c_hide_inactive, $t_prefix, $t_search, $c_show_disabled,
'btn btn-xs btn-white btn-primary ' . $t_active );
}
echo '</div>';
Expand All @@ -187,13 +190,13 @@
if( $f_filter === 'ALL' ) {
$t_where = '(1 = 1)';
} else if( $f_filter === 'UNUSED' ) {
$t_where = '(login_count = 0) AND ( date_created = last_visit )';
$t_where = '(login_count = 0) AND ( date_created = last_visit )';
} else if( $f_filter === 'NEW' ) {
$t_where = db_helper_compare_time( db_param(), '<=', 'date_created', $t_days_old );
$t_where_params[] = db_now();
$t_where = db_helper_compare_time( db_param(), '<=', 'date_created', $t_days_old );
$t_where_params[] = db_now();
} else {
$t_where_params[] = $f_filter . '%';
$t_where = db_helper_like( 'username' );
$t_where_params[] = $f_filter . '%';
$t_where = db_helper_like( 'username' );
}

if( $f_search !== '' ) {
Expand Down

0 comments on commit 6ed35e4

Please sign in to comment.