NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Commit

[Web] Fix return for unban/ban actions via API

b74226a9
andryyy <[email protected]> 7 years ago
data/web/inc/functions.fail2ban.inc.php | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Diff

diff --git a/data/web/inc/functions.fail2ban.inc.php b/data/web/inc/functions.fail2ban.inc.php
index 41d682b0..1cde10d3 100644
--- a/data/web/inc/functions.fail2ban.inc.php
+++ b/data/web/inc/functions.fail2ban.inc.php
@@ -113,6 +113,14 @@ function fail2ban($_action, $_data = null) {
                 $redis->hDel('F2B_BLACKLIST', $network, 1);
                 $redis->hSet('F2B_QUEUE_UNBAN', $network, 1);
               }
+              else  {
+                $_SESSION['return'][] = array(
+                  'type' => 'danger',
+                  'log' => array(__FUNCTION__, $_action, $_data_log),
+                  'msg' => array('network_host_invalid', $network)
+                );
+                continue;
+              }
             }
             elseif ($_data['action'] == "blacklist") {
               if (valid_network($network)) {
@@ -120,6 +128,14 @@ function fail2ban($_action, $_data = null) {
                 $redis->hDel('F2B_WHITELIST', $network, 1);
                 $response = docker('post', 'netfilter-mailcow', 'restart');
               }
+              else  {
+                $_SESSION['return'][] = array(
+                  'type' => 'danger',
+                  'log' => array(__FUNCTION__, $_action, $_data_log),
+                  'msg' => array('network_host_invalid', $network)
+                );
+                continue;
+              }
             }
           }
           catch (RedisException $e) {