From 9d1727c77d4b00d2a861c2c31f93d3aebff2f2d9 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Tue, 19 Jan 2021 13:12:17 +0100 Subject: v2rw: Rewrite done, time to clean up old v2 code Yay! There are no more request handlers in the VNDB::* namespace and no more Javascript in data/js/. This cleans up a lot of old legacy code that wasn't fun to maintain. --- lib/VNDB/DB/Users.pm | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 lib/VNDB/DB/Users.pm (limited to 'lib/VNDB/DB/Users.pm') diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm deleted file mode 100644 index 85654180..00000000 --- a/lib/VNDB/DB/Users.pm +++ /dev/null @@ -1,49 +0,0 @@ - -package VNDB::DB::Users; - -use strict; -use warnings; -use Exporter 'import'; - -our @EXPORT = qw| - dbUserGet -|; - - -# %options->{ uid results page what } -# sort: username registered votes changes tags -sub dbUserGet { - my $s = shift; - my %o = ( - page => 1, - results => 10, - what => '', - @_ - ); - - my %where = ( - $o{uid} && !ref($o{uid}) ? ( - 'id = ?' => $o{uid} ) : (), - $o{uid} && ref($o{uid}) ? ( - 'id IN(!l)' => [ $o{uid} ]) : (), - ); - - my @select = ( - qw|id username c_votes c_changes c_tags|, - VNWeb::DB::sql_user(), # XXX: This duplicates id and username, but updating all the code isn't going to be easy - q|extract('epoch' from registered) as registered|, - ); - - my($r, $np) = $s->dbPage(\%o, q| - SELECT !s - FROM users u - !W - ORDER BY id DESC|, - join(', ', @select), \%where - ); - - return wantarray ? ($r, $np) : $r; -} - -1; - -- cgit v1.2.3