Skip to content

Commit c97bed4

Browse files
author
florian030
committed
show active for additional php-versions (#5090)
1 parent ff16ebc commit c97bed4

File tree

12 files changed

+103
-2
lines changed

12 files changed

+103
-2
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ function configure_postfix($options = '')
5353
$cf = $conf['postfix'];
5454
$config_dir = $cf['config_dir'];
5555

56+
exec('postconf mail_version', $ret);
57+
$postfix_version=str_replace('mail_version = ', '', $ret[0]);
58+
unset($ret);
59+
exec('openssl version', $ret);
60+
$openssl_version=$ret[0];
61+
unset($ret);
62+
$use_pfs=@(version_compare($openssl_version, 'OpenSSL 0.9', '>=') && version_compare($postfix_version, '2.6', '>='))?true:false;
63+
5664
if(!is_dir($config_dir)){
5765
$this->error("The postfix configuration directory '$config_dir' does not exist.");
5866
}
@@ -163,6 +171,19 @@ function configure_postfix($options = '')
163171
'{greylisting}' => $greylisting,
164172
'{reject_slm}' => $reject_sender_login_mismatch,
165173
);
174+
175+
//* If PFS is possible, configure it
176+
if($use_pfs && !file_exists($config_dir.'/dh_512.pem')) exec('openssl gendh -out '.$config_dir.'/dh_512.pem -2 512');
177+
if($use_pfs && !file_exists($config_dir.'/dh_2048.pem')) exec('openssl gendh -out '.$config_dir.'/dh_2048.pem -2 2048');
178+
if($use_pfs && file_exists($config_dir.'/dh_512.pem') && file_exists($config_dir.'/dh_2048.pem')) {
179+
$postconf_placeholders = array_merge($postconf_placeholders, array(
180+
'{smtpd_tls_dh512_param_file}' => $config_dir.'/dh_512.pem',
181+
'{smtpd_tls_dh1024_param_file}' => $config_dir.'/dh_2048.pem' ));
182+
} else {
183+
$postconf_placeholders = array_merge($postconf_placeholders, array(
184+
'{smtpd_tls_dh512_param_file}' => '',
185+
'{smtpd_tls_dh1024_param_file}' => ''));
186+
}
166187

167188
$postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_postfix.conf.master', 'tpl/fedora_postfix.conf.master');
168189
$postconf_tpl = strtr($postconf_tpl, $postconf_placeholders);

install/dist/lib/gentoo.lib.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ public function configure_postfix($options = '')
5454
$cf = $conf['postfix'];
5555
$config_dir = $cf['config_dir'];
5656

57+
exec('postconf mail_version', $ret);
58+
$postfix_version=str_replace('mail_version = ', '', $ret[0]);
59+
unset($ret);
60+
exec('openssl version', $ret);
61+
$openssl_version=$ret[0];
62+
unset($ret);
63+
$use_pfs=@(version_compare($openssl_version, 'OpenSSL 0.9', '>=') && version_compare($postfix_version, '2.6', '>='))?true:false;
64+
5765
if(!is_dir($config_dir)){
5866
$this->error("The postfix configuration directory '$config_dir' does not exist.");
5967
}
@@ -116,6 +124,19 @@ public function configure_postfix($options = '')
116124
'{reject_slm}' => $reject_sender_login_mismatch,
117125
);
118126

127+
//* If PFS is possible, configure it
128+
if($use_pfs && !file_exists($config_dir.'/dh_512.pem')) exec('openssl gendh -out '.$config_dir.'/dh_512.pem -2 512');
129+
if($use_pfs && !file_exists($config_dir.'/dh_2048.pem')) exec('openssl gendh -out '.$config_dir.'/dh_2048.pem -2 2048');
130+
if($use_pfs && file_exists($config_dir.'/dh_512.pem') && file_exists($config_dir.'/dh_2048.pem')) {
131+
$postconf_placeholders = array_merge($postconf_placeholders, array(
132+
'{smtpd_tls_dh512_param_file}' => $config_dir.'/dh_512.pem',
133+
'{smtpd_tls_dh1024_param_file}' => $config_dir.'/dh_2048.pem' ));
134+
} else {
135+
$postconf_placeholders = array_merge($postconf_placeholders, array(
136+
'{smtpd_tls_dh512_param_file}' => '',
137+
'{smtpd_tls_dh1024_param_file}' => ''));
138+
}
139+
119140
$postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/gentoo_postfix.conf.master', 'tpl/gentoo_postfix.conf.master');
120141
$postconf_tpl = strtr($postconf_tpl, $postconf_placeholders);
121142
$postconf_commands = array_filter(explode("\n", $postconf_tpl)); // read and remove empty lines

install/dist/lib/opensuse.lib.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ function configure_postfix($options = '')
5353
$cf = $conf['postfix'];
5454
$config_dir = $cf['config_dir'];
5555

56+
exec('postconf mail_version', $ret);
57+
$postfix_version=str_replace('mail_version = ', '', $ret[0]);
58+
unset($ret);
59+
exec('openssl version', $ret);
60+
$openssl_version=$ret[0];
61+
unset($ret);
62+
$use_pfs=@(version_compare($openssl_version, 'OpenSSL 0.9', '>=') && version_compare($postfix_version, '2.6', '>='))?true:false;
63+
5664
if(!is_dir($config_dir)){
5765
$this->error("The postfix configuration directory '$config_dir' does not exist.");
5866
}
@@ -174,6 +182,19 @@ function configure_postfix($options = '')
174182
'{greylisting}' => $greylisting,
175183
'{reject_slm}' => $reject_sender_login_mismatch,
176184
);
185+
186+
//* If PFS is possible, configure it
187+
if($use_pfs && !file_exists($config_dir.'/dh_512.pem')) exec('openssl gendh -out '.$config_dir.'/dh_512.pem -2 512');
188+
if($use_pfs && !file_exists($config_dir.'/dh_2048.pem')) exec('openssl gendh -out '.$config_dir.'/dh_2048.pem -2 2048');
189+
if($use_pfs && file_exists($config_dir.'/dh_512.pem') && file_exists($config_dir.'/dh_2048.pem')) {
190+
$postconf_placeholders = array_merge($postconf_placeholders, array(
191+
'{smtpd_tls_dh512_param_file}' => $config_dir.'/dh_512.pem',
192+
'{smtpd_tls_dh1024_param_file}' => $config_dir.'/dh_2048.pem' ));
193+
} else {
194+
$postconf_placeholders = array_merge($postconf_placeholders, array(
195+
'{smtpd_tls_dh512_param_file}' => '',
196+
'{smtpd_tls_dh1024_param_file}' => ''));
197+
}
177198

178199
$postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/opensuse_postfix.conf.master', 'tpl/opensuse_postfix.conf.master');
179200
$postconf_tpl = strtr($postconf_tpl, $postconf_placeholders);

install/tpl/debian_postfix.conf.master

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ smtpd_tls_protocols = !SSLv2,!SSLv3
4444
smtp_tls_protocols = !SSLv2,!SSLv3
4545
smtpd_tls_exclude_ciphers = RC4, aNULL
4646
smtp_tls_exclude_ciphers = RC4, aNULL
47+
smtpd_tls_dh512_param_file = {smtpd_tls_dh512_param_file}
48+
smtpd_tls_dh1024_param_file = {smtpd_tls_dh1024_param_file}
49+
smtpd_tls_eecdh_grade = strong
50+
tls_preempt_cipherlist = yes
51+
smtp_tls_loglevel = 1
52+
smtpd_tls_loglevel = 1

install/tpl/fedora_postfix.conf.master

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,9 @@ smtpd_tls_protocols = !SSLv2,!SSLv3
4040
smtp_tls_protocols = !SSLv2,!SSLv3
4141
smtpd_tls_exclude_ciphers = RC4, aNULL
4242
smtp_tls_exclude_ciphers = RC4, aNULL
43+
smtpd_tls_dh512_param_file = {smtpd_tls_dh512_param_file}
44+
smtpd_tls_dh1024_param_file = {smtpd_tls_dh1024_param_file}
45+
smtpd_tls_eecdh_grade = strong
46+
tls_preempt_cipherlist = yes
47+
smtp_tls_loglevel = 1
48+
smtpd_tls_loglevel = 1

install/tpl/gentoo_postfix.conf.master

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,9 @@ smtpd_tls_protocols = !SSLv2,!SSLv3
3939
smtp_tls_protocols = !SSLv2,!SSLv3
4040
smtpd_tls_exclude_ciphers = RC4, aNULL
4141
smtp_tls_exclude_ciphers = RC4, aNULL
42+
smtpd_tls_dh512_param_file = {smtpd_tls_dh512_param_file}
43+
smtpd_tls_dh1024_param_file = {smtpd_tls_dh1024_param_file}
44+
smtpd_tls_eecdh_grade = strong
45+
tls_preempt_cipherlist = yes
46+
smtp_tls_loglevel = 1
47+
smtpd_tls_loglevel = 1

install/tpl/opensuse_postfix.conf.master

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@ smtpd_tls_protocols = !SSLv2,!SSLv3
4242
smtp_tls_protocols = !SSLv2,!SSLv3
4343
smtpd_tls_exclude_ciphers = RC4, aNULL
4444
smtp_tls_exclude_ciphers = RC4, aNULL
45+
smtpd_tls_dh512_param_file = {smtpd_tls_dh512_param_file}
46+
smtpd_tls_dh1024_param_file = {smtpd_tls_dh1024_param_file}
47+
smtpd_tls_eecdh_grade = strong
48+
tls_preempt_cipherlist = yes
49+
smtp_tls_loglevel = 1
50+
smtpd_tls_loglevel = 1

install/tpl/server.ini.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ php_fpm_ini_path=/etc/php5/fpm/php.ini
102102
php_fpm_pool_dir=/etc/php5/fpm/pool.d
103103
php_fpm_start_port=9010
104104
php_fpm_socket_dir=/var/lib/php5-fpm
105-
php_default_name=Default
105+
php_default_name=default
106106
set_folder_permissions_on_update=n
107107
add_web_users_to_sshusers_group=y
108108
connect_userid_to_webid=n

interface/web/admin/lib/lang/de_server_php_list.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ $wb['server_id_txt'] = 'Server';
44
$wb['add_new_record_txt'] = 'Neue PHP Version hinzufügen';
55
$wb['client_id_txt'] = 'Kunde';
66
$wb['name_txt'] = 'PHP Name';
7+
$wb['active_txt'] = 'Aktiv';
78
?>

interface/web/admin/lib/lang/en_server_php_list.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ $wb['server_id_txt'] = 'Server';
44
$wb['add_new_record_txt'] = 'Add new PHP version';
55
$wb['client_id_txt'] = 'Client';
66
$wb['name_txt'] = 'PHP Name';
7+
$wb['active_txt'] = 'Active';
78
?>

0 commit comments

Comments
 (0)