in reply to Switch.pm Failure ( CGI::Switch? )

Is that code from manageusers.pm ?. If so, what are the line numbers.

poj

Replies are listed 'Best First'.
Re^2: Re: Switch.pm Failure ( CGI::Switch? )
by tultalk (Monk) on Feb 27, 2017 at 23:53 UTC
    Hi Again. When I open jala-mi.org and it calls a login form inside an iFrame (the first item in the old switch tree and the new tree w/out switch, the form comes up fine and the activity (warn) is posted to the server error log. When I submit the form to log in, no response and nothing in server log. This serves the login form per request:
    Main(); sub Main { my $action = $query->param('action'); { warn("manage_users.cgi line 63: '$action'"); warn("Request from User for Login Form"); ($action eq "GetLoginForm") && do { manageusers::OpenConnection(); warn("process login request - create session"); my ($result,$message0,$message1,$message2) = ProcessLoginReque +st($query); if(!$result){ warn("Tell client that login failed"); manageusers::CloseConnection(); LoginUserFailedForm("The Login Request failed. Please try a +gain or contact the office."); return; #exit; } elsif ($result == 1) { #Client already logged in so tell them manageusers::CloseConnection(); CreateAlreadyLoggedinForm($message0); return; } elsif ($result == 2){ warn("Not logged in so send client login form"); manageusers::CloseConnection(); CreateLoginForm($message0, $message1, $message2); return; #exit; } };
    Below follow on submittal request does not elicit a response the the as shown in the server log.Nothing at all.
    #Login User ($action eq "LoginUser") && do { #Attempt the login manageusers::OpenConnection(); warn("Opening The Login Usr Query: $query"); my ($result, $login_timeout) = LoginUser($query); if ($result == 0){ manageusers::CloseConnection(); warn("Login failed. Creating response."); CreateLoginUserFailedForm("The Login User Name or Password +is invalid. Please try again or contact the office."); return; #exit; } elsif ($result == 1){ #Client already logged in so tell them manageusers::CloseConnection(); warn("Alrrady logged in."); CreateAlreadyLoggedinForm("You are already logged in."); return; #exit; } elsif ($result == 2){ manageusers::CloseConnection(); warn("Login failed. Membership expired."); CreateLoginUserFailedForm("Your Membership Has Expired. To r +enew membership, use the form on this site or contact the office."); return; #exit; } elsif ($result == 3) { manageusers::CloseConnection(); warn("Login succeeded. Creating response."); CreateUserLoginSucceededForm("Login succeeded."); return; #exit; } elsif ($result == 4){ manageusers::CloseConnection(); warn("Login failed.Max attemps response."); CreateLoginUserMaxAttemptsFailedForm("Maximum allowed number + of login attempts exceeded for session. Please contact the office.") +; return; #exit; } elsif ($result == 5){ manageusers::CloseConnection(); warn("Login failed. Timeout."); CreateLoginUserFailedForm("The '$login_timeout' second Login + window has expired. Please try again or contact the office"); return; #exit; } else { manageusers::CloseConnection(); warn("Login failed. Unknown reason."); CreateLoginUserFailedForm("Login failed for unknown reasons. + Please contact the office."); return; #exit; } return; #exit; };
    You can see the request form in the iFrame source. Back to the if else tree??

      In the source at at https://www.jala-mi.org/httpsdocs/cgi-bin/manage_users.cgi?action=GetLoginForm there is a line:

      <input type="button" value="Login" id="submit" style="background-color +:#0D4A80; color:#fff"; onclick="validate()"/>
      but i cannot find a validate subroutine and my firefox console shows "ReferenceError: validate is not defined". This is not an error in the perl, but of the html/javascript. When you press the login button the browser does does not send anything back to the server to process but instead raises the error condition in the console.

      After you click the login button you dont see the result of warn("manage_users.cgi line 63: '$action'"); in the log?

        No. There is no indication of any warns at all being posted in the error log. They were all there for the request for the log in form.