From afee192d2a77afa1c11d25156d0a44df94e19aed Mon Sep 17 00:00:00 2001
From: A. Täffner <darkalex@firesplash.de>
Date: Sat, 23 Jan 2016 07:30:37 -0500
Subject: [PATCH] fixed the cronjob and noticed a bug in ISPC but not able to report as FlySpray is offline

---
 server/plugins-available/firewall_plugin.inc.php |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/server/plugins-available/firewall_plugin.inc.php b/server/plugins-available/firewall_plugin.inc.php
index 186e9b9..d3538cc 100644
--- a/server/plugins-available/firewall_plugin.inc.php
+++ b/server/plugins-available/firewall_plugin.inc.php
@@ -38,7 +38,7 @@
 	public function onInstall() {
 		global $conf;
 
-		if($conf['bastille']['installed'] = true && $conf['services']['firewall'] == true) {
+		if($conf['bastille']['installed'] == true && $conf['services']['firewall'] == true) {
 			return true;
 		} else {
 			return false;
@@ -76,29 +76,31 @@
 		global $app, $conf;
 
 		//* load the server configuration options
-		$app->uses('getconf');
-		$server_config = $app->getconf->get_server_config($conf['server_id'], 'server');
-		if($server_config['firewall'] == 'ufw') {
-			$this->ufw_update($event_name, $data);
-		} else {
-			$this->bastille_update($event_name, $data);
+		if(!$data['mirrored']) {
+			$app->uses('getconf');
+			$server_config = $app->getconf->get_server_config($conf['server_id'], 'server');
+			if($server_config['firewall'] == 'ufw') {
+				$this->ufw_update($event_name, $data);
+			} else {
+				$this->bastille_update($event_name, $data);
+			}
 		}
-
 	}
 
 	public function delete($event_name, $data) {
 		global $app, $conf;
 
 		//* load the server configuration options
-		$app->uses('getconf');
-		$server_config = $app->getconf->get_server_config($conf['server_id'], 'server');
+		if(!$data['mirrored']) {
+			$app->uses('getconf');
+			$server_config = $app->getconf->get_server_config($conf['server_id'], 'server');
 
-		if($server_config['firewall'] == 'ufw') {
-			$this->ufw_delete($event_name, $data);
-		} else {
-			$this->bastille_delete($event_name, $data);
+			if($server_config['firewall'] == 'ufw') {
+				$this->ufw_delete($event_name, $data);
+			} else {
+				$this->bastille_delete($event_name, $data);
+			}
 		}
-
 	}
 
 	private function ufw_update($event_name, $data) {

--
Gitblit v1.9.1