summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB/Users.pm
diff options
context:
space:
mode:
author3dB <3db@3decibels.net>2009-07-28 17:38:26 -0400
committer3dB <3db@3decibels.net>2009-07-28 17:38:26 -0400
commitbe8f1cee4965d7e7c21e1252c5bc0fded56bc3e9 (patch)
tree34e066fbf771408495093b72c617f2c93672f9b8 /lib/VNDB/DB/Users.pm
parent3d066164e1e0440469cef65946f18605bd50a3c8 (diff)
Modified DB libraries and user handlers dealing with passwords to work with new auth system.
-- Modified all database insertion and edit subroutines to be able to work with the new 'salt' column. -- Modified all subroutines dealing with password manipulation to use authPreparePass to encrypt passwords and generate salts.
Diffstat (limited to 'lib/VNDB/DB/Users.pm')
-rw-r--r--lib/VNDB/DB/Users.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm
index 1ea8daf5..a28a88cc 100644
--- a/lib/VNDB/DB/Users.pm
+++ b/lib/VNDB/DB/Users.pm
@@ -75,7 +75,7 @@ sub dbUserEdit {
my %h;
defined $o{$_} && ($h{$_.' = ?'} = $o{$_})
- for (qw| username mail rank show_nsfw show_list skin customcss |);
+ for (qw| username mail rank show_nsfw show_list skin customcss salt |);
$h{'passwd = decode(?, \'hex\')'} = $o{passwd}
if defined $o{passwd};
@@ -88,11 +88,11 @@ sub dbUserEdit {
}
-# username, md5(pass), mail, [ip]
+# username, pass(ecrypted), salt, mail, [ip]
sub dbUserAdd {
my($s, @o) = @_;
- $s->dbExec(q|INSERT INTO users (username, passwd, mail, ip, registered) VALUES(?, decode(?, 'hex'), ?, ?, ?)|,
- @o[0..2], $o[3]||$s->reqIP, time);
+ $s->dbExec(q|INSERT INTO users (username, passwd, salt, mail, ip, registered) VALUES(?, decode(?, 'hex'), ?, ?, ?, ?)|,
+ @o[0..3], $o[4]||$s->reqIP, time);
}