diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 0e802fc4f..6e46aedd5 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -50,6 +50,8 @@ - Added prepared statement handlers to WebGUI::SQL. - Added transaction handlers to WebGUI::SQL. - Added additional debugging to WebGUI::SQL. + - Added a better user search mechanism, which works well even with 100,000 + users. 6.0.3 diff --git a/docs/migration.txt b/docs/migration.txt index dc5b82e93..6766be221 100644 --- a/docs/migration.txt +++ b/docs/migration.txt @@ -140,6 +140,11 @@ gen61i18nfrom60data.pl We also made the International API object oriented. The old procedural version is still intact as well. See WebGUI::International for API changes. +As a developer you can convert your translations (including English) and your +help files using a script we provide. You can find the script here: + +http://www.plainblack.com/translations?wid=1552&func=viewSubmission&sid=1213 + 5.8 WebGUI::Session Changes In 6.1 we changed the session API to remove functions that didn't really diff --git a/lib/WebGUI/Operation/User.pm b/lib/WebGUI/Operation/User.pm index 592f140b5..697866584 100644 --- a/lib/WebGUI/Operation/User.pm +++ b/lib/WebGUI/Operation/User.pm @@ -468,8 +468,8 @@ sub www_listUsers { return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3)); WebGUI::Session::setScratch("userSearchKeyword",$session{form}{keyword}); WebGUI::Session::setScratch("userSearchStatus",$session{form}{status}); - my ($output, $data, $f, $rows, $p, $search, %status, $selectedStatus); - $output = helpIcon(8); + my ($data, $rows, $p, %status, $selectedStatus); + my $output = helpIcon(8); $output .= '
| '.WebGUI::International::get(816).' | @@ -505,16 +523,18 @@ sub www_listUsers { } else { $selectedStatus = "status like '%'"; } - if ($session{scratch}{userSearchKeyword} ne "") { - $search = " and (users.username like ".quote("%".$session{scratch}{userSearchKeyword}."%") - ." or email.fieldData like ".quote("%".$session{scratch}{userSearchKeyword}."%").")"; + my $keyword = $session{scratch}{userSearchKeyword}; + if ($session{form}{modifier} eq "startsWith") { + $keyword .= "%"; + } elsif ($session{form}{modifier} eq "contains") { + $keyword = "%".$keyword."%"; + } else { + $keyword = "%".$keyword; } $p = WebGUI::Paginator->new(WebGUI::URL::page("op=listUsers")); $p->setDataByQuery("select users.userId, users.username, users.status, users.dateCreated, users.lastUpdated, - email.fieldData as email - from users left join userProfileData email on users.userId=email.userId and - email.fieldName='email' - where $selectedStatus $search order by users.username"); + email.fieldData as email from users left join userProfileData email on users.userId=email.userId and email.fieldName='email' + where $selectedStatus and (users.username like ".quote($keyword)." or email.fieldData like ".quote($keyword).") order by users.username"); $rows = $p->getPageData; foreach $data (@$rows) { $output .= '