git subrepo commit (merge) mailcow/src/mailcow-dockerized

subrepo: subdir:   "mailcow/src/mailcow-dockerized"
  merged:   "02ae5285"
upstream: origin:   "https://github.com/mailcow/mailcow-dockerized.git"
  branch:   "master"
  commit:   "649a5c01"
git-subrepo: version:  "0.4.3"
  origin:   "???"
  commit:   "???"
Change-Id: I870ad468fba026cc5abf3c5699ed1e12ff28b32b
diff --git a/mailcow/src/mailcow-dockerized/data/web/inc/functions.fail2ban.inc.php b/mailcow/src/mailcow-dockerized/data/web/inc/functions.fail2ban.inc.php
index 6f6b024..2a7f11e 100644
--- a/mailcow/src/mailcow-dockerized/data/web/inc/functions.fail2ban.inc.php
+++ b/mailcow/src/mailcow-dockerized/data/web/inc/functions.fail2ban.inc.php
@@ -18,7 +18,7 @@
           }

           if (isset($tmp_wl_data)) {

             natsort($tmp_wl_data);

-            $f2b_options['whitelist'] = implode(PHP_EOL, $tmp_wl_data);

+            $f2b_options['whitelist'] = implode(PHP_EOL, (array)$tmp_wl_data);

           }

           else {

             $f2b_options['whitelist'] = "";

@@ -34,7 +34,7 @@
           }

           if (isset($tmp_bl_data)) {

             natsort($tmp_bl_data);

-            $f2b_options['blacklist'] = implode(PHP_EOL, $tmp_bl_data);

+            $f2b_options['blacklist'] = implode(PHP_EOL, (array)$tmp_bl_data);

           }

           else {

             $f2b_options['blacklist'] = "";

@@ -46,7 +46,11 @@
         $pb = $redis->hGetAll('F2B_PERM_BANS');

         if (is_array($pb)) {

           foreach ($pb as $key => $value) {

-            $f2b_options['perm_bans'][] = $key;

+            $f2b_options['perm_bans'][] = array(

+                'network'=>$key,

+                'ip' => strtok($key,'/')

+            );

+

           }

         }

         else {

@@ -61,6 +65,7 @@
             $f2b_options['active_bans'][] = array(

               'queued_for_unban' => $queued_for_unban,

               'network' => $network,

+              'ip' => strtok($network,'/'),

               'banned_until' => sprintf('%02dh %02dm %02ds', ($difference/3600), ($difference/60%60), $difference%60)

             );

           }

@@ -133,14 +138,6 @@
               $redis->Set('F2B_REGEX', json_encode($regex_array, JSON_UNESCAPED_SLASHES));

             }

           }

-          else {

-            $_SESSION['return'][] = array(

-              'type' => 'success',

-              'log' => array(__FUNCTION__, $_action, $_data_log),

-              'msg' => print_r($_data, true)

-            );

-            return false;

-          }

           $_SESSION['return'][] = array(

             'type' => 'success',

             'log' => array(__FUNCTION__, $_action, $_data_log),