X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=fs_selfservice%2FFS-SelfService%2Fcgi%2Fselfservice.cgi;h=4e21ad8df944e7ce4cabac8110943cb949c4866b;hb=3146245f510ef873c4176bc06dc891f990db8f1e;hp=84998bb73c617c26cda1c9add646bb7ffbf39b10;hpb=8d51b40b5bf90351bd013ad3daa9569b2f399a3d;p=freeside.git diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi index 84998bb73..4e21ad8df 100755 --- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi +++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi @@ -101,8 +101,6 @@ if ( $cgi->param('action') =~ /^(\w+)$/ ) { } } -warn $action; - unless ( $nologin_actions{$action} ) { my %cookies = CGI::Cookie->fetch; @@ -126,7 +124,15 @@ unless ( $nologin_actions{$action} ) { 'email' => $email, 'password' => $password ); - $session_id = $login_rv->{'session_id'}; + + if ( $login_rv->{'error'} ) { + my $ip = $cgi->remote_addr(); + warn("login failure [email $email] [ip $ip] [error $login_rv->{error}]"); + } else { + #successful login + } + + $session_id = $login_rv->{'session_id'}; } else { @@ -183,9 +189,6 @@ unless ( $nologin_actions{$action} ) { } # else there is no session cookie if ( !$session_id ) { - # XXX why are we getting agentnum from a CGI param? surely it should - # be some kind of configuration option. - # # show the login page $session_id = 'login'; # set state my $login_info = login_info( 'agentnum' => scalar($cgi->param('agentnum')) ); @@ -210,7 +213,7 @@ if ( $result->{error} && ( $result->{error} eq "Can't resume session" || $result->{error} eq "Expired session") ) { #ick $session_id = 'login'; - my $login_info = login_info(); + my $login_info = login_info( 'agentnum' => scalar($cgi->param('agentnum')) ); do_template('login', $login_info); exit; } @@ -311,6 +314,7 @@ sub process_change_pay { 'error' => 'Postal or email required.', }; } + _process_change_info( 'change_pay', @list ); } @@ -632,7 +636,10 @@ sub payment_results { my $auto = 0; $auto = 1 if $cgi->param('auto'); - $cgi->param('paybatch') =~ /^([\w\-\.]+)$/ or die "illegal paybatch"; + $cgi->param('payunique') =~ /^([\w\-\.]*)$/ or die "illegal payunique"; + my $payunique = $1; + + $cgi->param('paybatch') =~ /^([\w\-\.]*)$/ or die "illegal paybatch"; my $paybatch = $1; $cgi->param('discount_term') =~ /^(\d*)$/ or die "illegal discount_term"; @@ -656,6 +663,7 @@ sub payment_results { 'country' => $country, 'save' => $save, 'auto' => $auto, + 'payunique' => $payunique, 'paybatch' => $paybatch, 'discount_term' => $discount_term, ); @@ -1061,7 +1069,7 @@ sub do_template { $fill_in->{$_} = $access_info->{$_} foreach keys %$access_info; # update the user's authentication - my $timeout = $access_info->{'timeout'} || '60'; + my $timeout = $access_info->{'timeout'} || '3600'; my $cookie = CGI::Cookie->new('-name' => 'session', '-value' => $session_id, '-expires' => '+'.$timeout.'s',