Error.pm (interchange-5.8.2) | : | Error.pm (interchange-5.10.0) | ||
---|---|---|---|---|
skipping to change at line 189 | skipping to change at line 189 | |||
if($@) { | if($@) { | |||
::logError("Error running lockout subroutine %s: %s", $su bname, $@); | ::logError("Error running lockout subroutine %s: %s", $su bname, $@); | |||
} | } | |||
return $status if $status; | return $status if $status; | |||
} | } | |||
# Now we log the error after custom lockout routine gets chance | # Now we log the error after custom lockout routine gets chance | |||
# to bypass | # to bypass | |||
my $pause = $::Limit->{lockout_reset_seconds} || 30; | my $pause = $::Limit->{lockout_reset_seconds} || 30; | |||
$msg = errmsg( | my $msg_string = "WARNING: POSSIBLE BAD ROBOT. %s accesses with no %d sec | |||
"WARNING: POSSIBLE BAD ROBOT. %s accesses with no %d second pause | ond pause."; | |||
.", | ::logError($msg_string, $Vend::Session->{accesses}, $pause); | |||
$Vend::Session->{accesses}, | ||||
$pause, | ||||
); | ||||
::logError($msg); | ||||
if($cmd = $Global::LockoutCommand) { | if($cmd = $Global::LockoutCommand) { | |||
my $host = $CGI::remote_addr; | my $host = $CGI::remote_addr; | |||
$cmd =~ s/%s/$host/ or $cmd .= " $host"; | $cmd =~ s/%s/$host/ or $cmd .= " $host"; | |||
$msg .= errmsg("Performing lockout command '%s'", $cmd); | $msg .= errmsg("Performing lockout command '%s'", $cmd); | |||
system $cmd; | system $cmd; | |||
$msg .= errmsg("\nBad status %s from '%s': %s\n", $?, $cmd, $!) | $? and $msg .= "\n" . errmsg("Bad status %s from '%s': %s\n", $?, | |||
if $?; | $cmd, $!); | |||
logGlobal({level => 'notice'}, $msg); | logGlobal({level => 'notice'}, $msg); | |||
} | } | |||
$Vend::Cfg->{VendURL} = $Vend::Cfg->{SecureURL} = 'http://127.0.0.1'; | $Vend::Cfg->{VendURL} = $Vend::Cfg->{SecureURL} = 'http://127.0.0.1'; | |||
$Vend::LockedOut = 1; | $Vend::LockedOut = 1; | |||
logError($msg) if $msg; | ||||
return; | return; | |||
} | } | |||
1; | 1; | |||
End of changes. 3 change blocks. | ||||
10 lines changed or deleted | 5 lines changed or added |