I'm getting the error: "Username or password did not match" [PERL]

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • patelxxx
    New Member
    • May 2007
    • 135

    I'm getting the error: "Username or password did not match" [PERL]

    Hi Guy's,

    I'm getting the error: "Username or password did not match" BEFORE I even enter a username and password, can someone help?

    1) The site I'm accessing is: http://www.valuemapping.co.uk/VMSE/

    2) Then I click/select the following application: "VMSE Reporting" and get the above error.


    The CGI script for this is:

    [CODE=perl]
    #!/usr/bin/perl
    use lib qw(VMSE/cgi-bin);
    use VM::Generic;

    use strict;

    my $session = VM::Generic->new();
    my $input = $session->parse_input;
    my $templateprefix = $input->{'area'} || 'reporting';

    $session->validate_sessi on($input);

    $session->re_login($temp lateprefix, 'Session has expired. Please login again') if ($session->status eq 'expired');
    $session->re_login($temp lateprefix, 'Username or password did not match') if ($session->status eq 'failedlogin');

    if ( $session->status eq 'valid' ) {
    my $params = $session->generic_params ;
    $params->{area} = $templateprefix ;

    if ($templateprefi x eq 'reporting') {
    my $loops = $session->report_loops($ params);
    my %newparams = (%{$params},%{$ loops});
    $params = \%newparams;
    }

    print "Set-Cookie: session_id='".$ session->sessionid."' ; path=/\n";

    print $session->create_output_ html("${templat eprefix}main.ht m", undef, $params);

    } else {
    print $session->create_output_ html("${templat eprefix}login.h tm", '', { 'area' => $templateprefix });
    }
    [/CODE]
    Last edited by miller; Jul 4 '07, 05:25 PM. Reason: Code Tag and ReFormatting
  • miller
    Recognized Expert Top Contributor
    • Oct 2006
    • 1086

    #2
    This is simply a logic error. You're testing for session creation when the form is simply displayed instead of after it is posted. It's up to you to create the logic necessary to differentiate between these two different states.

    - Miller

    Comment

    Working...