Commit 55c54a85 authored by Marius Burkard's avatar Marius Burkard

Merge branch 'stable-3.1'

parents 8cc6b5a4 7ddeb2a4
......@@ -31,11 +31,28 @@ while($row2 = mysql_fetch_array($sql2))
{
$file2=$row2['data'];
}
//
// Fix for 'domain.ext.' apex notation
//
$record_name_end=substr($row2['name'], -1);
if ($record_name_end==".")
{
// remove trailing dot from apex
$record_name = substr($row2['name'], 0, strlen($row2['name'])-1);
}
else
{
// add domain to make it a fqdn
$record_name = $row2['name'] . "." . $row3['origin'];
}
print "$row2[name].$row3[origin]" . " $record_name\r\n";
mysql_select_db("dbispconfig");
$sql3 = mysql_query("SELECT substr(origin,1, LENGTH(origin)-1) AS origin FROM dns_soa where id=$row2[zone];");
$row3 = mysql_fetch_array($sql3);
mysql_select_db("powerdns");
mysql_query("INSERT INTO records (domain_id,name,content,ispconfig_id,type,ttl,prio,change_date) values ('$row2[zone]','$row2[name].$row3[origin]','$file2','$row2[id]','$row2[type]','$row2[ttl]','$row2[aux]','1260446221');");
mysql_query("INSERT INTO records (domain_id,name,content,ispconfig_id,type,ttl,prio,change_date) values ('$row2[zone]','$record_name','$file2','$row2[id]','$row2[type]','$row2[ttl]','$row2[aux]','1260446221');");
}
else
{
......
......@@ -48,14 +48,21 @@ class installer_centos extends installer_dist {
$content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content);
$content = str_replace('{hostname}', $conf['hostname'], $content);
$content = str_replace('/var/spool/amavisd/clamd.sock', $this->clamav_socket, $content);
$content = str_replace('{amavis_config_dir}', $conf['amavis']['config_dir']);
$content = str_replace('{amavis_config_dir}', $conf['amavis']['config_dir'], $content);
wf($conf["amavis"]["config_dir"].'/amavisd.conf', $content);
chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640);
if(!is_file($conf['amavis']['config_dir'].'/60-dkim')) {
touch($conf['amavis']['config_dir'].'/60-dkim');
chmod($conf['amavis']['config_dir'].'/60-dkim', 0640);
}
// for CentOS 7.2 only
if($dist['confid'] == 'centos72') {
chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0750);
chgrp($conf['amavis']['config_dir'].'/amavisd.conf', 'amavis');
chmod($conf['amavis']['config_dir'].'/60-dkim', 0750);
chgrp($conf['amavis']['config_dir'].'/60-dkim', 'amavis');
}
......
......@@ -180,6 +180,7 @@ function get_distname() {
break;
default:
$relname = "UNKNOWN";
$distconfid = 'ubuntu1604';
}
$distver = $ver.$lts." ".$relname;
swriteln("Operating System: ".$distname.' '.$distver."\n");
......@@ -230,7 +231,8 @@ function get_distname() {
} else {
$distname = 'Debian';
$distver = 'Unknown';
$distid = 'debian40';
$distid = 'debian60';
$distconfid = 'debian90';
$distbaseid = 'debian';
swriteln("Operating System: Debian or compatible, unknown version.\n");
}
......
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
query = SELECT 'greylisting' FROM (SELECT greylisting, source AS email FROM mail_forwarding WHERE server_id = {server_id} UNION SELECT greylisting, email FROM mail_user WHERE server_id = {server_id}) addresses WHERE addresses.email='%s' AND addresses.greylisting='y'
query = SELECT 'greylisting' FROM (SELECT greylisting, source AS email FROM mail_forwarding WHERE server_id = {server_id} UNION SELECT greylisting, email FROM mail_user WHERE server_id = {server_id}) addresses WHERE addresses.email='%s' AND addresses.greylisting='y' UNION SELECT 'greylisting' FROM `mail_forwarding` f CROSS JOIN `mail_user` u ON u.email = f.destination WHERE f.type = 'catchall' AND u.greylisting = 'y' AND u.server_id = {server_id} AND f.source = '@%s'
hosts = {mysql_server_ip}
\ No newline at end of file
......@@ -244,7 +244,7 @@ class remoting_server extends remoting {
return false;
}
if (!empty($session_id)) {
if($server_id === 0) $ispc_app_version = array('ispc_app_version' => ISPC_APP_VERSION);
if($server_id == 0) $ispc_app_version = array('ispc_app_version' => ISPC_APP_VERSION);
else {
$rec = $app->db->queryOneRecord("SELECT data FROM monitor_data WHERE type = 'ispc_info' AND server_id = ?", $server_id);
$rec = unserialize($rec['data']);
......
......@@ -136,6 +136,13 @@
<select name="dmarc_sp" id="dmarc_sp" class="form-control">{tmpl_var name='dmarc_sp'}</select>
</div>
</div>
<div class="form-group">
<label for="ttl" class="col-sm-2 control-label">{tmpl_var name='ttl_txt'}</label>
<div class="col-sm-3">
<input type="text" name="ttl" id="ttl" value="{tmpl_var name='ttl'}" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{tmpl_var name='active_txt'}</label>
......
......@@ -223,7 +223,7 @@ class page_action extends tform_actions {
/* check if the domain module is used - and check if the selected domain can be used! */
$app->uses('ini_parser,getconf');
$settings = $app->getconf->get_global_config('domains');
if ($settings['use_domain_module'] == 'y') {
if ((isset($this->dataRecord['domain'])) && ($settings['use_domain_module'] == 'y')) {
if ($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
$this->dataRecord['client_group_id'] = $app->tools_sites->getClientIdForDomain($this->dataRecord['domain']);
}
......
......@@ -146,6 +146,8 @@ server {
location = /favicon.ico {
log_not_found off;
access_log off;
expires max;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
location = /robots.txt {
......
......@@ -14,8 +14,6 @@ export TMPDIR=<tmpl_var name='document_root'>/tmp
export TEMP=<tmpl_var name='document_root'>/tmp
exec <tmpl_var name='php_fcgi_bin'> \
<tmpl_if name="security_level" op="==" value="20"> -d open_basedir="<tmpl_var name='open_basedir'>" \
-d disable_functions="" \
-d suhosin.executor.func.blacklist="" \
-d upload_tmp_dir=<tmpl_var name='document_root'>/tmp \
-d session.save_path=<tmpl_var name='document_root'>/tmp \
-d sendmail_path="/usr/sbin/sendmail -t -i -f webmaster@<tmpl_var name='domain'>" \
......
......@@ -182,7 +182,7 @@
<tmpl_if name='python' op='==' value='y'>
<IfModule mod_python.c>
<Directory {tmpl_var name='web_document_root_www'}>
<Directory {tmpl_var name='web_document_root'}>
<FilesMatch "\.py$">
SetHandler mod_python
</FilesMatch>
......@@ -362,10 +362,10 @@
Action php5-fcgi /php5-fcgi virtual
Alias /php5-fcgi {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'}
<tmpl_if name='use_tcp'>
FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -host 127.0.0.1:<tmpl_var name='fpm_port'> -pass-header Authorization
FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -host 127.0.0.1:<tmpl_var name='fpm_port'> -pass-header Authorization -pass-header Content-Type
</tmpl_if>
<tmpl_if name='use_socket'>
FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -socket <tmpl_var name='fpm_socket'> -pass-header Authorization
FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -socket <tmpl_var name='fpm_socket'> -pass-header Authorization -pass-header Content-Type
</tmpl_if>
</IfModule>
<IfModule mod_proxy_fcgi.c>
......@@ -428,7 +428,7 @@
</Directory>
Action hhvm-fcgi /hhvm-fcgi virtual
Alias /hhvm-fcgi {tmpl_var name='document_root'}/cgi-bin/hhvm-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'}
FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/hhvm-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -socket /var/run/hhvm/hhvm.<tmpl_var name='system_user'>.sock -pass-header Authorization
FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/hhvm-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -socket /var/run/hhvm/hhvm.<tmpl_var name='system_user'>.sock -pass-header Authorization -pass-header Content-Type
</IfModule>
<IfModule mod_proxy_fcgi.c>
<Directory {tmpl_var name='document_root'}/cgi-bin>
......
......@@ -705,6 +705,13 @@ class apache2_plugin {
if(!is_dir($data['new']['document_root'].'/cgi-bin')) $app->system->mkdirpath($data['new']['document_root'].'/cgi-bin');
if(!is_dir($data['new']['document_root'].'/tmp')) $app->system->mkdirpath($data['new']['document_root'].'/tmp');
if(!is_dir($data['new']['document_root'].'/webdav')) $app->system->mkdirpath($data['new']['document_root'].'/webdav');
if(!is_dir($data['new']['document_root'].'/.ssh')) {
$app->system->mkdirpath($data['new']['document_root'].'/.ssh');
$app->system->chmod($data['new']['document_root'].'/.ssh', 0700);
$app->system->chown($data['new']['document_root'].'/.ssh', $username);
$app->system->chgrp($data['new']['document_root'].'/.ssh', $groupname);
}
//* Create the new private directory
if(!is_dir($data['new']['document_root'].'/private')) {
......@@ -2741,10 +2748,14 @@ class apache2_plugin {
$output .= "\n";
$output .= "Alias /webdav/$fn $webdavRoot/$fn\n";
$output .= "<Location /webdav/$fn>\n";
$output .= "Dav On\n";
$output .= "DAV On\n";
$output .= "BrowserMatch MSIE AuthDigestEnableQueryStringHack=On\n";
$output .= "AuthType Digest\n";
$output .= 'AuthName "'.(empty($fn)?'/':$fn)."\"\n";
if($fn != '' && $fn != '/') {
$output .= " AuthName \"" . $fn . "\"\n";
} else {
$output .= " AuthName \"Restricted Area\"\n";
}
$output .= "AuthUserFile $webdavRoot/$file\n";
$output .= "Require valid-user\n";
$output .= "Options +Indexes\n";
......
......@@ -78,13 +78,16 @@ class mysql_clientdb_plugin {
$unwanted_sql_plugins = array('validate_password'); // strict-password-validation
$temp = "'".implode("','", $unwanted_sql_plugins)."'";
$result = $link->query("SELECT plugin_name FROM information_schema.plugins WHERE plugin_status='ACTIVE' AND plugin_name IN ($temp)");
if($result) {
if($result && $result->num_rows > 0) {
$sql_plugins = array();
while ($row = $result->fetch_assoc()) {
$sql_plugins[] = $row['plugin_name'];
}
$result->free();
foreach ($sql_plugins as $plugin) $app->log("MySQL-Plugin $plugin enabled - can not execute function process_host_list", LOGLEVEL_ERROR);
return false;
if(count($sql_plugins) > 0) {
foreach ($sql_plugins as $plugin) $app->log("MySQL-Plugin $plugin enabled - can not execute function process_host_list", LOGLEVEL_ERROR);
return false;
}
}
if(!$user_access_mode) $user_access_mode = 'rw';
......
......@@ -552,7 +552,14 @@ class nginx_plugin {
if(!is_dir($data['new']['document_root'].'/cgi-bin')) $app->system->mkdirpath($data['new']['document_root'].'/cgi-bin');
if(!is_dir($data['new']['document_root'].'/tmp')) $app->system->mkdirpath($data['new']['document_root'].'/tmp');
//if(!is_dir($data['new']['document_root'].'/webdav')) $app->system->mkdirpath($data['new']['document_root'].'/webdav');
if(!is_dir($data['new']['document_root'].'/.ssh')) {
$app->system->mkdirpath($data['new']['document_root'].'/.ssh');
$app->system->chmod($data['new']['document_root'].'/.ssh', 0700);
$app->system->chown($data['new']['document_root'].'/.ssh', $username);
$app->system->chgrp($data['new']['document_root'].'/.ssh', $groupname);
}
//* Create the new private directory
if(!is_dir($data['new']['document_root'].'/private')) {
$app->system->mkdirpath($data['new']['document_root'].'/private');
......
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