summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2008-12-21 09:23:44 +0100
committerYorhel <git@yorhel.nl>2008-12-21 09:23:44 +0100
commit18210a1438a171b48d4fe3046d84e66e17aec523 (patch)
treead65ac5691d1ffcf6bcdbbfa3f8305b92465fa4a /lib
parent6863aba11efcf9c2111a7c8a46e0d5798b9b06e9 (diff)
Fixed password recovery feature
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/Handler/Users.pm29
1 files changed, 14 insertions, 15 deletions
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm
index 79712b3d..404a20b0 100644
--- a/lib/VNDB/Handler/Users.pm
+++ b/lib/VNDB/Handler/Users.pm
@@ -167,8 +167,21 @@ sub newpass {
my @chars = ( 'A'..'Z', 'a'..'z', 0..9 );
my $pass = join '', map $chars[int rand $#chars+1], 0..8;
$self->dbUserEdit($u->{id}, passwd => md5_hex($pass));
+ my $body = <<'__';
+Hello %s,
+
+Your password has been reset, you can now login at http://vndb.org/ with the
+following information:
+
+Username: %1$s
+Password: %s
+
+Now don't forget your password again! :-)
+
+vndb.org
+__
$self->mail(
- sprintf(join('', <DATA>), $u->{username}, $pass),
+ sprintf($body, $u->{username}, $pass),
To => $u->{mail},
From => 'VNDB <noreply@vndb.org>',
Subject => 'New password for '.$u->{username}
@@ -451,17 +464,3 @@ sub list {
1;
-
-# Contents of the password-reset email
-__DATA__
-Hello %s,
-
-Your password has been reset, you can now login at http://vndb.org/ with the
-following information:
-
-Username: %1$s
-Password: %s
-
-Now don't forget your password again! :-)
-
-vndb.org