Gossamer Forum
Home : Products : Gossamer Links : Discussions :

User error message problem

Quote Reply
User error message problem
I think (not sure) it used to display correctly, however after upgrading to latest LSQL when a user not yet validated go to login they get USER_BADLOGIN when they should get USER_NOTVAL error.
Any suggestions? Status variable is correctly 'Not Validated'

Last edited by:

Taki-x: Feb 2, 2005, 11:42 AM
Quote Reply
Re: [Taki-x] User error message problem In reply to
I reply to my own post. Please correct me if I am wrong (i am not familiar with perl), but this if statement in sub init_user in Links.pm shows that the user does not exist if he is not validated. So in /Links/User/Login.pm the second check presents the error when the user is not validated.

Code:

# We have a valid_user, now let's get the user from Links SQL, if he's not there
# then we auto-create him.
$USER = Links::Authenticate::auth('get_user', { Username => $valid_user, Password => $password, auto_create => 1 });
if ($USER) {
if ($USER->{Status} eq 'Not Validated') {
return;
}
}
return $USER;
Quote Reply
Re: [Taki-x] User error message problem In reply to
Looks like it was broken in 2.2.0. Here's a patch to fix that:
Code:
--- Login.pm 24 Sep 2004 02:54:50 -0000 1.9
+++ Login.pm 2 Feb 2005 21:46:16 -0000
@@ -79,12 +79,13 @@
my $user = Links::init_user($username, $password);
if (!$user) {
print $IN->header();
- print Links::SiteHTML::display('login', { error => Links::language('USER_BADLOGIN')});
- return;
- }
- if ($user->{'Status'} eq 'Not Validated') {
- print $IN->header();
- print Links::SiteHTML::display('login', { error => Links::language('USER_NOTVAL', $user->{Email}), Username => $user->{Username} });
+ require Links::Authenticate;
+ if (Links::Authenticate::auth_valid_user({ Username => $username, Password => $password })) {
+ print Links::SiteHTML::display('login', { error => Links::language('USER_NOTVAL', $user->{Email}), Username => $user->{Username} });
+ }
+ else {
+ print Links::SiteHTML::display('login', { error => Links::language('USER_BADLOGIN')});
+ }
return;
}

Adrian
Quote Reply
Re: [brewt] User error message problem In reply to
Thank you. It works