From 37c71fd18ca665f0740973c9f1b8869bd2fe4669 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 13 Oct 2011 19:21:25 +0000 Subject: [PATCH] - web: fix bug in user search when enter empty name prefix svn path=/trunk/boinc/; revision=24392 --- checkin_notes | 6 ++++++ html/user/user_search.php | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/checkin_notes b/checkin_notes index 761b7ec95a..4a812779a0 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7196,3 +7196,9 @@ David 13 Oct 2011 cs_files.cpp sched/ file_upload_handler.cpp + +David 13 Oct 2011 + - web: fix bug in user search when enter empty name prefix + + html/user/ + user_search.php diff --git a/html/user/user_search.php b/html/user/user_search.php index 45c4bba1e7..fc32fed570 100644 --- a/html/user/user_search.php +++ b/html/user/user_search.php @@ -63,7 +63,7 @@ function filter_user($user, $filter) { function show_user($user) { echo " - ", $user->id, user_links($user), " + ", user_links($user), " (ID $user->id) "; if ($user->teamid) { $team = BoincTeam::lookup_id($user->teamid); @@ -100,12 +100,14 @@ function do_search($order, $filter) { } } } + page_head(tra("User search results")); start_table(); table_header(tra("Name"), tra("Team"), tra("Average credit"), tra("Total credit"), tra("Country"), tra("Joined")); foreach ($filtered_list as $user) { show_user($user); } end_table(); + page_tail(); } function search_form() { @@ -147,6 +149,7 @@ function name_search($filter) { if (strlen($search_string)<3) { error_page(tra("search string must be at least 3 characters")); } + page_head(tra("User search results")); $s = BoincDb::escape_string($search_string); $s = escape_pattern($s); $fields = "id, create_time, name, country, total_credit, expavg_credit, teamid, url, has_profile, donated"; @@ -167,6 +170,7 @@ function name_search($filter) { if (!$n) { echo tra("No users match your search criteria."); } + page_tail(); } function main() { @@ -223,13 +227,11 @@ function main() { $filter->do_team = false; break; } - page_head(tra("User search results")); if ($search_type == 'name_prefix') { name_search($filter); } else { do_search($order, $filter); } - page_tail(); } else { search_form(); }