Skip to content

Commit b45475a

Browse files
author
jnsc
committed
Merge remote-tracking branch 'upstream/stable-3.1' into stable-3.1
2 parents 07e7575 + f90e18f commit b45475a

File tree

1,487 files changed

+14114
-6953
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,487 files changed

+14114
-6953
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

docs/autoinstall_samples/autoinstall.conf_sample.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,14 @@
4949
$autoupdate['ispconfig_port'] = '8080'; // default: 8080
5050
$autoupdate['create_new_ispconfig_ssl_cert'] = 'no'; // no (default), yes
5151
$autoupdate['reconfigure_crontab'] = 'yes'; // yes (default), no
52+
53+
/* These are for service-detection (defaulting to old behaviour where alle changes were automatically accepted) */
54+
$autoupdate['svc_detect_change_mail_server'] = 'yes'; // yes (default), no
55+
$autoupdate['svc_detect_change_web_server'] = 'yes'; // yes (default), no
56+
$autoupdate['svc_detect_change_dns_server'] = 'yes'; // yes (default), no
57+
$autoupdate['svc_detect_change_xmpp_server'] = 'yes'; // yes (default), no
58+
$autoupdate['svc_detect_change_firewall_server'] = 'yes'; // yes (default), no
59+
$autoupdate['svc_detect_change_vserver_server'] = 'yes'; // yes (default), no
60+
$autoupdate['svc_detect_change_db_server'] = 'yes'; // yes (default), no
61+
5262
?>

docs/autoinstall_samples/autoinstall.ini.sample

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,13 @@ reconfigure_permissions_in_master_database=no
4747
reconfigure_services=yes
4848
ispconfig_port=8080
4949
create_new_ispconfig_ssl_cert=no
50-
reconfigure_crontab=yes
50+
reconfigure_crontab=yes
51+
52+
; These are for service-detection (defaulting to old behaviour where alle changes were automatically accepted)
53+
svc_detect_change_mail_server=yes
54+
svc_detect_change_web_server=yes
55+
svc_detect_change_dns_server=yes
56+
svc_detect_change_xmpp_server=yes
57+
svc_detect_change_firewall_server=yes
58+
svc_detect_change_vserver_server=yes
59+
svc_detect_change_db_server=yes

install/apps/metronome_libs/mod_auth_external/db_auth.php

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717

1818
// check for existing user
1919
$dbmail = $db->real_escape_string($arg_email);
20-
$result = $db->query("SELECT jid, password FROM xmpp_user WHERE jid LIKE ? AND active='y' AND server_id=?", $dbmail, $isp_server_id);
21-
result_false($result->num_rows != 1);
22-
23-
$user = $result->fetch_object();
24-
25-
// check for domain autologin api key
26-
$domain_key = 'f47kmm5Yh5hJzSws2KTS';
27-
28-
checkAuth($argv[1], $argv[2], $arg_password, $user->password, $domain_key);
20+
$query = $db->prepare("SELECT jid, password FROM xmpp_user WHERE jid LIKE ? AND active='y' AND server_id=?");
21+
$query->bind_param('si', $arg_email, $isp_server_id);
22+
$query->execute();
23+
$query->bind_result($jid, $password);
24+
$query->fetch();
25+
$query->close();
26+
27+
result_false(is_null($jid));
28+
checkAuth($arg_password, $password);
2929
}catch(Exception $ex){
3030
echo 0;
3131
exit();
@@ -40,19 +40,9 @@ function result_true(){
4040
echo 1;
4141
exit();
4242
}
43-
function checkAuth($user, $domain, $pw_arg, $pw_db, $domain_key){
43+
function checkAuth($pw_arg, $pw_db){
4444
if(crypt($pw_arg, $pw_db) == $pw_db)
4545
result_true();
46-
47-
if($domain_key){
48-
$datetime = new DateTime();
49-
$datetime->setTimezone(new DateTimeZone("UTC"));
50-
for($t = $datetime->getTimestamp(); $t >= $datetime->getTimestamp()-30; $t--){
51-
$pw_api = md5($domain.'@'.$domain_key.'@'.$user.'@'.$t);
52-
if($pw_api == $pw_arg)
53-
result_true();
54-
}
55-
}
5646
result_false();
5747
}
5848
?>

install/apps/metronome_libs/mod_auth_external/db_isuser.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@
1515

1616
// check for existing user
1717
$dbmail = $db->real_escape_string($arg_email);
18-
$result = $db->query("SELECT jid, password FROM xmpp_user WHERE jid LIKE ? AND active='y' AND server_id=?", $dbmail, $isp_server_id);
19-
result_false($result->num_rows != 1);
18+
$query = $db->prepare("SELECT count(*) AS usercount FROM xmpp_user WHERE jid LIKE ? AND active='y' AND server_id=?");
19+
$query->bind_param('si', $arg_email, $isp_server_id);
20+
$query->execute();
21+
$query->bind_result($usercount);
22+
$query->fetch();
23+
$query->close();
24+
25+
result_false($usercount != 1);
2026
result_true();
2127

2228
}catch(Exception $ex){
@@ -34,4 +40,4 @@ function result_true(){
3440
exit();
3541
}
3642

37-
?>
43+
?>

install/dist/lib/centos72.lib.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2014, Till Brehm, ISPConfig UG
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
require_once realpath(dirname(__FILE__)) . '/centos_base.lib.php';
32+
33+
class installer extends installer_centos {
34+
35+
protected $clamav_socket = '/var/run/clamd.amavisd/clamd.sock';
36+
37+
// everything else is inherited from installer_centos class
38+
}
39+
40+
?>

install/dist/lib/centos_base.lib.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class installer_centos extends installer_dist {
3333
protected $clamav_socket = '/tmp/clamd.socket';
3434

3535
public function configure_amavis() {
36-
global $conf;
36+
global $conf, $dist;
3737

3838
// amavisd user config file
3939
$configfile = 'fedora_amavisd_conf';
@@ -50,6 +50,12 @@ public function configure_amavis() {
5050
$content = str_replace('/var/spool/amavisd/clamd.sock', $this->clamav_socket, $content);
5151
wf($conf["amavis"]["config_dir"].'/amavisd.conf', $content);
5252
chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640);
53+
54+
// for CentOS 7.2 only
55+
if($dist['confid'] == 'centos72') {
56+
chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0750);
57+
chgrp($conf['amavis']['config_dir'].'/amavisd.conf', 'amavis');
58+
}
5359

5460

5561
// Adding the amavisd commands to the postfix configuration

install/dist/lib/fedora.lib.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ function configure_postfix($options = '')
8989

9090
//* mysql-virtual_relayrecipientmaps.cf
9191
$this->process_postfix_config('mysql-virtual_relayrecipientmaps.cf');
92+
93+
//* mysql-virtual_outgoing_bcc.cf
94+
$this->process_postfix_config('mysql-virtual_outgoing_bcc.cf');
9295

9396
//* mysql-virtual_policy_greylist.cf
9497
$this->process_postfix_config('mysql-virtual_policy_greylist.cf');
@@ -179,6 +182,7 @@ function configure_postfix($options = '')
179182
//if(!is_file('/var/lib/mailman/data/aliases')) touch('/var/lib/mailman/data/aliases');
180183
if(is_file('/var/lib/mailman/data/aliases')) unlink('/var/lib/mailman/data/aliases');
181184
if(!is_link('/var/lib/mailman/data/aliases')) symlink('/etc/mailman/aliases', '/var/lib/mailman/data/aliases');
185+
if(!is_file('/etc/mailman/aliases')) touch('/etc/mailman/aliases');
182186
exec('postalias /var/lib/mailman/data/aliases');
183187
if(!is_file('/etc/mailman/virtual-mailman')) touch('/etc/mailman/virtual-mailman');
184188
exec('postmap /etc/mailman/virtual-mailman');
@@ -476,7 +480,7 @@ public function configure_dovecot()
476480
}
477481

478482
public function configure_amavis() {
479-
global $conf;
483+
global $conf, $dist;
480484

481485
// amavisd user config file
482486
$configfile = 'fedora_amavisd_conf';
@@ -491,6 +495,12 @@ public function configure_amavis() {
491495
$content = str_replace('{hostname}', $conf['hostname'], $content);
492496
wf($conf["amavis"]["config_dir"].'/amavisd.conf', $content);
493497
chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640);
498+
499+
// for CentOS 7.2 only
500+
if($dist['confid'] == 'centos72') {
501+
chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0750);
502+
chgrp($conf['amavis']['config_dir'].'/amavisd.conf', 'amavis');
503+
}
494504

495505

496506
// Adding the amavisd commands to the postfix configuration

install/dist/tpl/gentoo/amavisd-ispconfig.conf.master

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ $log_level = 0; # (defaults to 0)
9595

9696
$inet_socket_port = [10024,10026];
9797

98-
# *:* = send to IP/HOST:incoming Port + 1
99-
$forward_method = 'smtp:*:*';
100-
$notify_method = 'smtp:*:*';
98+
# :* = send to incoming Port + 1
99+
$forward_method = 'smtp:127.0.0.1:*';
100+
$notify_method = 'smtp:127.0.0.1:*';
101101

102102
$interface_policy{'10026'} = 'ORIGINATING';
103103
$policy_bank{'ORIGINATING'} = {

0 commit comments

Comments
 (0)