[Web] f2b banlist - add http status codes
This commit is contained in:
parent
1537fb39c0
commit
987cfd5dae
@ -342,12 +342,14 @@ function fail2ban($_action, $_data = null, $_extra = null) {
|
||||
'log' => array(__FUNCTION__, $_action, $_data_log, $_extra),
|
||||
'msg' => array('redis_error', $e)
|
||||
);
|
||||
http_response_code(500);
|
||||
return false;
|
||||
}
|
||||
if (is_array($_extra)) {
|
||||
$_extra = $_extra[0];
|
||||
}
|
||||
if ($_extra != $f2b_options['banlist_id']){
|
||||
http_response_code(404);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -363,6 +365,7 @@ function fail2ban($_action, $_data = null, $_extra = null) {
|
||||
'log' => array(__FUNCTION__, $_action, $_data_log, $_extra),
|
||||
'msg' => array('redis_error', $e)
|
||||
);
|
||||
http_response_code(500);
|
||||
return false;
|
||||
}
|
||||
$banlist = implode("\n", array_merge($bl, $active_bans));
|
||||
|
@ -70,6 +70,7 @@ try {
|
||||
}
|
||||
}
|
||||
catch (Exception $e) {
|
||||
http_response_code(500);
|
||||
?>
|
||||
<center style='font-family:sans-serif;'>Connection to Redis failed.<br /><br />The following error was reported:<br/><?=$e->getMessage();?></center>
|
||||
<?php
|
||||
|
Loading…
Reference in New Issue
Block a user