diff -Naur issues-1.2.9/core/print_api.php issues/core/print_api.php --- issues-1.2.9/core/print_api.php 2012-05-04 13:58:01.970330248 +0100 +++ issues/core/print_api.php 2012-05-04 14:43:52.904124744 +0100 @@ -1229,7 +1229,7 @@ } } -function print_manage_user_sort_link( $p_page, $p_string, $p_field, $p_dir, $p_sort_by, $p_hide = 0, $p_filter = ALL ) { +function print_manage_user_sort_link( $p_page, $p_string, $p_field, $p_dir, $p_sort_by, $p_hide = 0, $p_filter = ALL, $p_showdisabled = 0 ) { if( $p_sort_by == $p_field ) { # If this is the selected field flip the order @@ -1244,7 +1244,7 @@ } $t_field = rawurlencode( $p_field ); - print_link( "$p_page?sort=$t_field&dir=$t_dir&save=1&hide=$p_hide&filter=$p_filter", $p_string ); + print_link( "$p_page?sort=$t_field&dir=$t_dir&save=1&hide=$p_hide&filter=$p_filter&showdisabled=$p_showdisabled", $p_string ); } function print_manage_project_sort_link( $p_page, $p_string, $p_field, $p_dir, $p_sort_by ) { diff -Naur issues-1.2.9/lang/strings_english.txt issues/lang/strings_english.txt --- issues-1.2.9/lang/strings_english.txt 2012-05-04 13:58:03.857043424 +0100 +++ issues/lang/strings_english.txt 2012-05-04 14:29:38.211057840 +0100 @@ -765,6 +765,7 @@ $s_never_logged_in_title = 'Never Logged In'; $s_prune_accounts = 'Prune Accounts'; $s_hide_inactive = 'Hide Inactive'; +$s_show_disabled = 'Show Disabled'; $s_manage_accounts_title = 'Manage Accounts'; $s_p = 'p'; $s_date_created = 'Date Created'; diff -Naur issues-1.2.9/manage_user_page.php issues/manage_user_page.php --- issues-1.2.9/manage_user_page.php 2012-05-04 13:58:03.343121552 +0100 +++ issues/manage_user_page.php 2012-05-04 14:45:36.839324192 +0100 @@ -34,6 +34,7 @@ $f_sort = gpc_get_string( 'sort', 'username' ); $f_dir = gpc_get_string( 'dir', 'ASC' ); $f_hide = gpc_get_bool( 'hide' ); + $f_showdisabled = gpc_get_bool( 'showdisabled' ); $f_save = gpc_get_bool( 'save' ); $f_filter = utf8_strtoupper( gpc_get_string( 'filter', config_get( 'default_manage_user_prefix' ) ) ); $f_page_number = gpc_get_int( 'page_number', 1 ); @@ -63,9 +64,16 @@ } $t_hide_filter = '&hide=' . $c_hide; + if ($f_showdisabled == 0) { # a 0 will turn it off + $c_showdisabled = 0; + } else { # anything else (including 'on') will turn it on + $c_showdisabled = 1; + } + $t_showdisabled_filter = '&showdisabled=' . $c_showdisabled; + # set cookie values for hide, sort by, and dir if ( $f_save ) { - $t_manage_string = $c_hide.':'.$c_sort.':'.$c_dir; + $t_manage_string = $c_hide.':'.$c_sort.':'.$c_dir.':'.$c_showdisabled; gpc_set_cookie( $t_cookie_name, $t_manage_string, true ); } else if ( !is_blank( gpc_get_cookie( $t_cookie_name, '' ) ) ) { $t_manage_arr = explode( ':', gpc_get_cookie( $t_cookie_name ) ); @@ -82,6 +90,11 @@ } else { $f_dir = 'DESC'; } + if ( isset( $t_manage_arr[3] ) ) { + $f_showdisabled = $t_manage_arr[3]; + } else { + $f_showdisabled = $c_showdisabled; + } } html_page_top( lang_get( 'manage_users_link' ) ); @@ -132,7 +145,7 @@ $c_filter = $f_filter; echo "$t_caption"; } else { - print_link( "manage_user_page.php?sort=$c_sort&dir=$c_dir&save=1$t_hide_filter&filter=$t_prefix", $t_caption ); + print_link( "manage_user_page.php?sort=$c_sort&dir=$c_dir&save=1$t_hide_filter&filter=$t_prefix&showdisabled=$c_showdisabled", $t_caption ); } if ( $t_prefix === 'UNUSED' ) { @@ -164,17 +177,22 @@ # Get the user data in $c_sort order $result = ''; + + $t_showdisabled_cond = ( 1 == $c_showdisabled ? '' : ' AND enabled = 1' ); + if ( 0 == $c_hide ) { $query = "SELECT count(*) as usercnt FROM $t_user_table - WHERE $t_where"; + WHERE $t_where + $t_showdisabled_cond"; $result = db_query_bound($query, $t_where_params); $row = db_fetch_array( $result ); $total_user_count = $row['usercnt']; } else { $query = "SELECT count(*) as usercnt FROM $t_user_table - WHERE $t_where AND " . db_helper_compare_days("" . db_now() . "","last_visit","< $days_old"); + WHERE $t_where AND " . db_helper_compare_days("" . db_now() . "","last_visit","< $days_old") + . $t_showdisabled_cond; $result = db_query_bound($query, $t_where_params); $row = db_fetch_array( $result ); $total_user_count = $row['usercnt']; @@ -200,6 +218,7 @@ $query = "SELECT * FROM $t_user_table WHERE $t_where + $t_showdisabled_cond ORDER BY $c_sort $c_dir"; $result = db_query_bound($query, $t_where_params, $p_per_page, $t_offset); } else { @@ -207,6 +226,7 @@ $query = "SELECT * FROM $t_user_table WHERE $t_where AND " . db_helper_compare_days( "" . db_now() . "", "last_visit", "< $days_old" ) . " + $t_showdisabled_cond ORDER BY $c_sort $c_dir"; $result = db_query_bound($query, $t_where_params, $p_per_page, $t_offset ); } @@ -229,6 +249,7 @@ /> + /> @@ -236,49 +257,49 @@