From 7bce72dd8ffc5a1e072d9d51cd4e40ede7258d3d Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Thu, 07 Apr 2016 12:26:40 -0400
Subject: [PATCH] Fixed: Issue #3693 Choose better default customer numbers for clients of resellers.

---
 install/lib/installer_base.lib.php |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index e7a664d..7621df3 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -172,9 +172,9 @@
 		if(is_installed('squid')) $conf['squid']['installed'] = true;
 		if(is_installed('nginx')) $conf['nginx']['installed'] = true;
 		if(is_installed('iptables') && is_installed('ufw')) $conf['ufw']['installed'] = true;
+		if(is_installed('iptables') && is_installed('bastille-netfilter')) $conf['firewall']['installed'] = true;
 		if(is_installed('fail2ban-server')) $conf['fail2ban']['installed'] = true;
 		if(is_installed('vzctl')) $conf['openvz']['installed'] = true;
-		if(is_installed('iptables') && is_installed('bastille-netfilter')) $conf['bastille']['installed'] = true;
 		if(is_installed('metronome') && is_installed('metronomectl')) $conf['xmpp']['installed'] = true;
 		if(is_installed('spamassassin')) $conf['spamassassin']['installed'] = true;
 		if(is_installed('vlogger')) $conf['vlogger']['installed'] = true;
@@ -185,7 +185,11 @@
 
     public function force_configure_app($service, $enable_force=true) {
 		$force = false;
-        swriteln("[WARN] autodetect for $service failed");
+		if($enable_force == true) {
+			swriteln("[WARN] autodetect for $service failed");
+		} else {
+			swriteln("[INFO] service $service not detected");
+		}
 		if($enable_force) {
 	        if(strtolower($this->simple_query("Force configure $service", array('y', 'n'), 'n') ) == 'y') {
 	            $force = true;
@@ -217,7 +221,12 @@
 		//* check sql-mode
 		$check_sql_mode = $this->db->queryOneRecord("SELECT @@sql_mode");
 
-		if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') die('Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION');
+		if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') {
+			echo "Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION. Add\n\n";
+			echo "    sql-mode=\"NO_ENGINE_SUBSTITUTION\"\n\n";
+			echo"to the mysqld-section in /etc/mysql/my.cnf and restart mysqld afterwards\n";
+			die();
+		}
 
 		//** Create the database
 		if(!$this->db->query('CREATE DATABASE IF NOT EXISTS ?? DEFAULT CHARACTER SET ?', $conf['mysql']['database'], $conf['mysql']['charset'])) {
@@ -263,7 +272,7 @@
 		}
 
 		// Delete ISPConfig user in the local database, in case that it exists
-		$this->db->query("DROP USER ?'@'? ", $conf['mysql']['ispconfig_user'], $from_host);
+		$this->db->query("DROP USER ?@?", $conf['mysql']['ispconfig_user'], $from_host);
 		$this->db->query("DROP DATABASE IF EXISTS ?", $conf['mysql']['database']);
 
 		//* Create the ISPConfig database user in the local database

--
Gitblit v1.9.1