From 181ee7eedc5b73dfb893fa13bd5a5fa155e0562b Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Thu, 26 May 2016 09:03:14 -0400
Subject: [PATCH] Fixed #3855 - Added missing html template for form page System > Interface config > DNS
---
install/lib/installer_base.lib.php | 45 +++++++++++++++++++++++++++++++++++----------
1 files changed, 35 insertions(+), 10 deletions(-)
diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 363a38c..8c6ef7f 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'])) {
@@ -287,6 +296,7 @@
$tpl_ini_array['fastcgi']['fastcgi_bin'] = $conf['fastcgi']['fastcgi_bin'];
$tpl_ini_array['server']['hostname'] = $conf['hostname'];
$tpl_ini_array['server']['ip_address'] = @gethostbyname($conf['hostname']);
+ $tpl_ini_array['server']['firewall'] = ($conf['ufw']['installed'] == true)?'ufw':'bastille';
$tpl_ini_array['web']['website_basedir'] = $conf['web']['website_basedir'];
$tpl_ini_array['web']['website_path'] = $conf['web']['website_path'];
$tpl_ini_array['web']['website_symlinks'] = $conf['web']['website_symlinks'];
@@ -649,6 +659,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);
+ }
+
}
}
@@ -1259,6 +1278,10 @@
$content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content);
$content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content);
$content = str_replace('{server_id}', $conf['server_id'], $content);
+ # enable iterate_query for dovecot2
+ if(version_compare($dovecot_version,2, '>=')) {
+ $content = str_replace('# iterate_query', 'iterate_query', $content);
+ }
wf($config_dir.'/'.$configfile, $content);
chmod($config_dir.'/'.$configfile, 0600);
@@ -1612,7 +1635,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'
@@ -1824,12 +1847,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