summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Users.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2016-01-19 20:29:40 +0100
committerYorhel <git@yorhel.nl>2016-01-20 21:16:55 +0100
commita6836df277867d73a71c55797984c947449772cc (patch)
treec72a326dd844c3c23a932dc76dc159200c1dfcdb /lib/VNDB/Handler/Users.pm
parent0caed2e7674e8ee7419365e76f86d06c33b8c8aa (diff)
L10N: Intern all VNDB::Util::* stuff
With some related edits in other parts of the code, mostly due to interface changes to htmlRevision() and htmlFormError(). Trivial replacements were automated by a super awesome script.
Diffstat (limited to 'lib/VNDB/Handler/Users.pm')
-rw-r--r--lib/VNDB/Handler/Users.pm22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm
index 8c72ba82..989b5286 100644
--- a/lib/VNDB/Handler/Users.pm
+++ b/lib/VNDB/Handler/Users.pm
@@ -168,7 +168,7 @@ sub login {
if(!$frm->{_err}) {
$frm->{usrname} = lc $frm->{usrname};
return if $self->authLogin($frm->{usrname}, $frm->{usrpass}, $ref);
- $frm->{_err} = [ 'login_failed' ];
+ $frm->{_err} = [ 'Invalid username or password' ];
$self->dbThrottleSet(norm_ip($self->reqIP), $tm+$self->{login_throttle}[0]);
}
}
@@ -204,7 +204,7 @@ sub newpass {
$frm = $self->formValidate({ post => 'mail', template => 'email' });
if(!$frm->{_err}) {
$u = $self->dbUserGet(mail => $frm->{mail})->[0];
- $frm->{_err} = [ 'nomail' ] if !$u || !$u->{id};
+ $frm->{_err} = [ 'No user found with that email address' ] if !$u || !$u->{id};
}
if(!$frm->{_err}) {
my %o;
@@ -264,7 +264,7 @@ sub setpass {
{ post => 'usrpass', minlength => 4, maxlength => 64, template => 'ascii' },
{ post => 'usrpass2', minlength => 4, maxlength => 64, template => 'ascii' },
);
- push @{$frm->{_err}}, 'passmatch' if $frm->{usrpass} ne $frm->{usrpass2};
+ push @{$frm->{_err}}, 'Passwords do not match' if $frm->{usrpass} ne $frm->{usrpass2};
if(!$frm->{_err}) {
my %o = (email_confirmed => 1);
@@ -298,14 +298,18 @@ sub register {
{ post => 'answer', template => 'uint' },
);
my $num = $self->{stats}{[qw|vn releases producers|]->[ $frm->{type} - 1 ]};
- push @{$frm->{_err}}, 'notanswer' if !$frm->{_err} && ($frm->{answer} > $num || $frm->{answer} < $num*0.995);
- push @{$frm->{_err}}, 'usrexists' if $frm->{usrname} eq 'anonymous' || !$frm->{_err} && $self->dbUserGet(username => $frm->{usrname})->[0]{id};
- push @{$frm->{_err}}, 'mailexists' if !$frm->{_err} && $self->dbUserGet(mail => $frm->{mail})->[0]{id};
+ push @{$frm->{_err}}, 'Question was not correctly answered. Are you sure you are a human?'
+ if !$frm->{_err} && ($frm->{answer} > $num || $frm->{answer} < $num*0.995);
+ push @{$frm->{_err}}, 'Someone already has this username, please choose another name'
+ if $frm->{usrname} eq 'anonymous' || !$frm->{_err} && $self->dbUserGet(username => $frm->{usrname})->[0]{id};
+ push @{$frm->{_err}}, 'Someone already registered with that email address'
+ if !$frm->{_err} && $self->dbUserGet(mail => $frm->{mail})->[0]{id};
# Use /32 match for IPv4 and /48 for IPv6. The /48 is fairly broad, so some
# users may have to wait a bit before they can register...
my $ip = $self->reqIP;
- push @{$frm->{_err}}, 'oneaday' if !$frm->{_err} && $self->dbUserGet(ip => $ip =~ /:/ ? "$ip/48" : $ip, registered => time-24*3600)->[0]{id};
+ push @{$frm->{_err}}, 'You can only register one account from the same IP within 24 hours'
+ if !$frm->{_err} && $self->dbUserGet(ip => $ip =~ /:/ ? "$ip/48" : $ip, registered => time-24*3600)->[0]{id};
if(!$frm->{_err}) {
my($token, $pass) = $self->authPrepareReset();
@@ -382,9 +386,9 @@ sub edit {
{ post => 'skin', required => 0, default => $self->{skin_default}, enum => [ keys %{$self->{skins}} ] },
{ post => 'customcss', required => 0, maxlength => 2000, default => '' },
);
- push @{$frm->{_err}}, 'passmatch'
+ push @{$frm->{_err}}, 'Passwords do not match'
if ($frm->{usrpass} || $frm->{usrpass2}) && (!$frm->{usrpass} || !$frm->{usrpass2} || $frm->{usrpass} ne $frm->{usrpass2});
- push @{$frm->{_err}}, 'invalidpass'
+ push @{$frm->{_err}}, 'Invalid password'
if !($self->authInfo->{id} != $u->{id} && $self->authCan('usermod'))
&& ($frm->{usrpass} || $frm->{usrpass2}) && !$self->authCheck($u->{username}, $frm->{curpass});