fixed little glitch

This commit is contained in:
chris 1999-11-13 23:50:23 +00:00
parent 138de6a095
commit 13f6b3d0be

View file

@ -67,27 +67,30 @@ sub Login {
my $valid = "f"; my $valid = "f";
&startint($env,"Logging In"); &startint($env,"Logging In");
until ($valid eq "t") { until ($valid eq "t") {
my ($reason,$username,$password,$branch) = my ($reason,$username,$password,$branch) = logondialog ($env,"Logon to System",\@branches);
logondialog ($env,"Logon to System",\@branches);
$username = uc $username; $username = uc $username;
$password = uc $password; $password = uc $password;
my $query = "select * from users my $query = "select * from users where usercode = '$username' and password ='$password'";
where usercode = '$username' and password ='$password'"; $sth=$dbh->prepare($query);
#sth->prepare($query);
$sth->execute; $sth->execute;
debug_msg("",$query);
if (my $userrec = $sth->fetchrow_hashref) { if (my $userrec = $sth->fetchrow_hashref) {
if ($userrec->{'usercode'} ne ''){
if ($branch ne "") { if ($branch ne "") {
$valid = "t"; $valid = "t";
my @dummy = split ' ', $branch; my @dummy = split ' ', $branch;
$branch = @dummy[0]; $branch = $dummy[0];
$env->{usercode} = $username; $env->{'usercode'} = $username;
$env->{branchcode} = $branch; $env->{'branchcode'} = $branch;
} }
} else { } else {
debug_msg("","not found"); debug_msg("","not found");
} }
}
$sth->finish; $sth->finish;
} }
$dbh->disconnect;
&endint(); &endint();
} }