From 5e9e6a78d3b7ffd177d91dba6602946dbd9a4c09 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Fri, 31 Jul 2009 12:01:35 +0200 Subject: Fetch hex hashes from dbUserGet() and do comparison in hex For consistency, it's best to do everything related to hashes in hexadecimal notation in Perl. --- lib/VNDB/DB/Users.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/VNDB/DB/Users.pm') diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm index eaed1234..ae46b896 100644 --- a/lib/VNDB/DB/Users.pm +++ b/lib/VNDB/DB/Users.pm @@ -24,8 +24,6 @@ sub dbUserGet { my %where = ( $o{username} ? ( 'username = ?' => $o{username} ) : (), - $o{passwd} ? ( - 'passwd = decode(?, \'hex\')' => $o{passwd} ) : (), $o{firstchar} ? ( 'SUBSTRING(username from 1 for 1) = ?' => $o{firstchar} ) : (), !$o{firstchar} && defined $o{firstchar} ? ( @@ -45,7 +43,8 @@ sub dbUserGet { ); my @select = ( - 'u.*', + qw|id username mail rank salt registered c_votes c_changes show_nsfw show_list skin customcss ip c_tags|, + q|encode(passwd, 'hex') AS passwd|, $o{what} =~ /stats/ ? ( '(SELECT COUNT(*) FROM rlists WHERE uid = u.id) AS releasecount', '(SELECT COUNT(DISTINCT rv.vid) FROM rlists rl JOIN releases r ON rl.rid = r.id JOIN releases_vn rv ON rv.rid = r.latest WHERE uid = u.id) AS vncount', -- cgit v1.2.3