From bc6917486cdf177db87d9d6d1a2fad57bed17ce3 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Sun, 24 Apr 2016 13:57:40 -0400
Subject: [PATCH] Merge branch 'xfs-quota' into 'stable-3.1'

---
 install/lib/installer_base.lib.php |   33 ++++++++++++++++++++++++---------
 1 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index bbf8cfd..334a16b 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;
@@ -654,6 +658,15 @@
 				if(!$this->dbmaster->query($query, $value['db'] . '.mail_backup', $value['user'], $host)) {
 					$this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage);
 				}
+				
+				$query = "GRANT SELECT, UPDATE(`dnssec_initialized`, `dnssec_info`, `dnssec_last_signed`) ON ?? TO ?@?";
+				if ($verbose){
+					echo $query ."\n";
+				}
+				if(!$this->dbmaster->query($query, $value['db'] . '.dns_soa', $value['user'], $host)) {
+					$this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage);
+				}
+
 			}
 
 		}
@@ -1617,7 +1630,7 @@
         caselog('chmod u+x /etc/init.d/metronome', __FILE__, __LINE__);
         caselog('update-rc.d metronome defaults', __FILE__, __LINE__);
 
-        exec($this->getinitcommand('xmpp', 'restart'));
+        exec($this->getinitcommand($conf['xmpp']['init_script'], 'restart'));
 
 /*
 writing new private key to 'smtpd.key'
@@ -1829,12 +1842,14 @@
 
 	public function configure_ufw_firewall()
 	{
-		$configfile = 'ufw.conf';
-		if(is_file('/etc/ufw/ufw.conf')) copy('/etc/ufw/ufw.conf', '/etc/ufw/ufw.conf~');
-		$content = rf("tpl/".$configfile.".master");
-		wf('/etc/ufw/ufw.conf', $content);
-		exec('chmod 600 /etc/ufw/ufw.conf');
-		exec('chown root:root /etc/ufw/ufw.conf');
+		if($this->is_update == false) {
+			$configfile = 'ufw.conf';
+			if(is_file('/etc/ufw/ufw.conf')) copy('/etc/ufw/ufw.conf', '/etc/ufw/ufw.conf~');
+			$content = rf("tpl/".$configfile.".master");
+			wf('/etc/ufw/ufw.conf', $content);
+			exec('chmod 600 /etc/ufw/ufw.conf');
+			exec('chown root:root /etc/ufw/ufw.conf');
+		}
 	}
 
 	public function configure_bastille_firewall() {

--
Gitblit v1.9.1