diff options
author | Yorhel <git@yorhel.nl> | 2009-07-03 18:35:36 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-07-03 18:35:36 +0200 |
commit | 83d006a8b947b9246305aef76a51f98459d8e993 (patch) | |
tree | 03323802f8913545310cb441fc588599d372455e /lib/VNDB/DB/Users.pm | |
parent | e53a1fb11c96bf18084cf98d0dd53872783badb6 (diff) |
Search box on user list
Diffstat (limited to 'lib/VNDB/DB/Users.pm')
-rw-r--r-- | lib/VNDB/DB/Users.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm index 3a93a9c5..49b56823 100644 --- a/lib/VNDB/DB/Users.pm +++ b/lib/VNDB/DB/Users.pm @@ -8,7 +8,7 @@ use Exporter 'import'; our @EXPORT = qw|dbUserGet dbUserEdit dbUserAdd dbUserDel|; -# %options->{ username passwd mail order uid ip registered results page what } +# %options->{ username passwd mail order uid ip registered search results page what } # what: stats sub dbUserGet { my $s = shift; @@ -20,6 +20,7 @@ sub dbUserGet { @_ ); + $o{search} =~ s/%// if $o{search}; my %where = ( $o{username} ? ( 'username = ?' => $o{username} ) : (), @@ -39,6 +40,8 @@ sub dbUserGet { 'ip = ?' => $o{ip} ) : (), $o{registered} ? ( 'registered > ?' => $o{registered} ) : (), + $o{search} ? ( + 'username ILIKE ?' => "%$o{search}%") : (), ); my @select = ( |