Commit 7a2f3234 authored by Marius Burkard's avatar Marius Burkard

Merge branch 'stable-3.1'

parents 6f4ac3d3 6165e36f
......@@ -345,6 +345,7 @@ class installer extends installer_base
if(version_compare($dovecot_version,2, '>=')) {
$content = str_replace('# iterate_query', 'iterate_query', $content);
}
$content = str_replace('{server_id}', $conf['server_id'], $content);
$this->write_config_file($configfile, $content);
}
......
......@@ -55,7 +55,7 @@ $sql_select_policy =
$sql_select_white_black_list = 'SELECT wb FROM spamfilter_wblist'.
' WHERE (spamfilter_wblist.rid=?) AND (spamfilter_wblist.email IN (%k))' .
' WHERE (spamfilter_wblist.rid=?) AND (spamfilter_wblist.email IN (%k)) AND (spamfilter_wblist.active="y")' .
' ORDER BY spamfilter_wblist.priority DESC';
#
......@@ -112,9 +112,10 @@ $policy_bank{'ORIGINATING'} = {
# Allow SMTP access from IPs in @inet_acl to amvisd SMTP Port
@inet_acl = qw( 127.0.0.1 [::1] 192.168.0.0/16 );
$signed_header_fields{'received'} = 0; # turn off signing of Received
# DKIM
$enable_dkim_verification = 1;
$enable_dkim_signing = 1;
$enable_dkim_signing = 1; # load DKIM signing code
$signed_header_fields{'received'} = 0; # turn off signing of Received
@dkim_signature_options_bysender_maps = (
{ '.' => { ttl => 21*24*3600, c => 'relaxed/simple' } } );
......
......@@ -408,6 +408,8 @@ class ApsGUIController extends ApsBase
//* Set package status to install afetr we inserted the settings
$app->db->datalogUpdate('aps_instances', array("instance_status" => INSTANCE_INSTALL), 'id', $InstanceID);
return $InstanceID;
}
/**
......
......@@ -70,7 +70,7 @@ class backup_plugin {
$app->uses('ini_parser,file,getconf,system');
$web = $app->dbmaster->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ?", $backup['parent_domain_id']);
$web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ?", $backup['parent_domain_id']);
$server_config = $app->getconf->get_server_config($conf['server_id'], 'server');
$backup_dir = trim($server_config['backup_dir']);
if($backup_dir == '') return;
......
......@@ -237,7 +237,7 @@ class cron_plugin {
$command .= "\t{$this->parent_domain['system_user']}"; //* running as user
if($job['type'] == 'url') {
$command .= "\t{$cron_config['wget']} --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0' -q -t 1 -T 7200 -O " . $log_wget_target . " " . escapeshellarg($job['command']) . " " . $log_target;
$command .= "\t{$cron_config['wget']} --no-check-certificate --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0' -q -t 1 -T 7200 -O " . $log_wget_target . " " . escapeshellarg($job['command']) . " " . $log_target;
} else {
if(strpos($job['command'], "\n") !== false || strpos($job['command'], "\r") !== false || strpos($job['command'], chr(0)) !== false) {
$app->log("Insecure Cron job SKIPPED: " . $job['command'], LOGLEVEL_WARN);
......
......@@ -1779,8 +1779,19 @@ class nginx_plugin {
$tpl->setLoop('alias_seo_redirects', $alias_seo_redirects);
}
$stats_web_folder = 'web';
if($data['new']['type'] == 'vhost'){
if($data['new']['web_folder'] != ''){
if(substr($data['new']['web_folder'], 0, 1) == '/') $data['new']['web_folder'] = substr($data['new']['web_folder'],1);
if(substr($data['new']['web_folder'], -1) == '/') $data['new']['web_folder'] = substr($data['new']['web_folder'],0,-1);
}
$stats_web_folder .= '/'.$data['new']['web_folder'];
} elseif($data['new']['type'] == 'vhostsubdomain' || $data['new']['type'] == 'vhostalias') {
$stats_web_folder = $data['new']['web_folder'];
}
//* Create basic http auth for website statistics
$tpl->setVar('stats_auth_passwd_file', $data['new']['document_root']."/web/stats/.htpasswd_stats");
$tpl->setVar('stats_auth_passwd_file', $data['new']['document_root']."/" . $stats_web_folder . "/stats/.htpasswd_stats");
// Create basic http auth for other directories
$basic_auth_locations = $this->_create_web_folder_auth_configuration($data['new']);
......@@ -1848,11 +1859,11 @@ class nginx_plugin {
}
// create password file for stats directory
if(!is_file($data['new']['document_root'].'/web/stats/.htpasswd_stats') || $data['new']['stats_password'] != $data['old']['stats_password']) {
if(!is_file($data['new']['document_root'].'/' . $stats_web_folder . '/stats/.htpasswd_stats') || $data['new']['stats_password'] != $data['old']['stats_password']) {
if(trim($data['new']['stats_password']) != '') {
$htp_file = 'admin:'.trim($data['new']['stats_password']);
$app->system->file_put_contents($data['new']['document_root'].'/web/stats/.htpasswd_stats', $htp_file);
$app->system->chmod($data['new']['document_root'].'/web/stats/.htpasswd_stats', 0755);
$app->system->file_put_contents($data['new']['document_root'].'/' . $stats_web_folder . '/stats/.htpasswd_stats', $htp_file);
$app->system->chmod($data['new']['document_root'].'/' . $stats_web_folder . '/stats/.htpasswd_stats', 0755);
unset($htp_file);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment