Skip to content

Commit 83bf799

Browse files
author
Marius Burkard
committed
Merge branch 'stable-3.1'
2 parents e1ceb05 + cfc8475 commit 83bf799

File tree

75 files changed

+335
-103
lines changed

Some content is hidden

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

75 files changed

+335
-103
lines changed

install/lib/installer_base.lib.php

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ public function configure_mailman($status = 'insert') {
812812
public function get_postfix_service($service, $type) {
813813
global $conf;
814814

815-
exec("postconf -M", $out, $ret);
815+
exec("postconf -M 2> /dev/null", $out, $ret);
816816

817817
if ($ret === 0) { //* with postfix >= 2.9 we can detect configured services with postconf
818818
unset($out);
@@ -822,9 +822,9 @@ public function get_postfix_service($service, $type) {
822822
}
823823
$postfix_service = @($out[0]=='')?false:true;
824824
} else { //* fallback - Postfix < 2.9
825-
rf($conf['postfix']['config_dir'].'/master.cf');
826-
$regex = '/[^#]'.$service.'.*.'.$type.'.*/';
827-
$postfix_service = @(!preg_match($regex, $content))?true:false;
825+
$content = rf($conf['postfix']['config_dir'].'/master.cf');
826+
$regex = "/^((?!#)".$service.".*".$type.".*)$/m";
827+
$postfix_service = @(preg_match($regex, $content))?true:false;
828828
}
829829

830830
return $postfix_service;
@@ -1366,21 +1366,25 @@ public function configure_amavis() {
13661366

13671367
// Add the clamav user to the amavis group
13681368
exec('adduser clamav amavis');
1369-
1370-
// Create the director for DKIM-Keys
1371-
if(!is_dir('/var/lib/amavis/dkim')) mkdir('/var/lib/amavis/dkim', 0750, true);
1372-
// get shell-user for amavis
1373-
$amavis_user=exec('grep -o "^amavis:\|^vscan:" /etc/passwd');
1374-
if(!empty($amavis_user)) {
1375-
$amavis_user=rtrim($amavis_user, ":");
1376-
exec('chown '.$amavis_user.' /var/lib/amavis/dkim');
1377-
}
13781369
// get shell-group for amavis
13791370
$amavis_group=exec('grep -o "^amavis:\|^vscan:" /etc/group');
13801371
if(!empty($amavis_group)) {
13811372
$amavis_group=rtrim($amavis_group, ":");
1382-
exec('chgrp '.$amavis_group.' /var/lib/amavis/dkim');
13831373
}
1374+
// get shell-user for amavis
1375+
$amavis_user=exec('grep -o "^amavis:\|^vscan:" /etc/passwd');
1376+
if(!empty($amavis_user)) {
1377+
$amavis_user=rtrim($amavis_user, ":");
1378+
}
1379+
1380+
// Create the director for DKIM-Keys
1381+
if(!is_dir('/var/lib/amavis')) mkdir('/var/lib/amavis', 0750, true);
1382+
if(!empty($amavis_user)) exec('chown '.$amavis_user.' /var/lib/amavis');
1383+
if(!empty($amavis_group)) exec('chgrp '.$amavis_group.' /var/lib/amavis');
1384+
if(!is_dir('/var/lib/amavis/dkim')) mkdir('/var/lib/amavis/dkim', 0750);
1385+
if(!empty($amavis_user)) exec('chown -R '.$amavis_user.' /var/lib/amavis/dkim');
1386+
if(!empty($amavis_group)) exec('chgrp -R '.$amavis_group.' /var/lib/amavis/dkim');
1387+
13841388
}
13851389

13861390
public function configure_spamassassin() {
@@ -1693,7 +1697,7 @@ public function configure_apache() {
16931697
if(is_file('/etc/suphp/suphp.conf')) {
16941698
replaceLine('/etc/suphp/suphp.conf', 'php="php:/usr/bin', 'x-httpd-suphp="php:/usr/bin/php-cgi"', 0);
16951699
//replaceLine('/etc/suphp/suphp.conf','docroot=','docroot=/var/clients',0);
1696-
replaceLine('/etc/suphp/suphp.conf', 'umask=0077', 'umask=0022', 0);
1700+
replaceLine('/etc/suphp/suphp.conf', 'umask=00', 'umask=0022', 0);
16971701
}
16981702

16991703
if(is_file('/etc/apache2/sites-enabled/000-default')) {

install/tpl/apache_apps.vhost.master

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
SetHandler None
1616
</FilesMatch>
1717

18+
<IfModule mod_headers.c>
19+
RequestHeader unset Proxy early
20+
</IfModule>
21+
1822
<IfModule mod_php5.c>
1923
DocumentRoot {tmpl_var name='apps_vhost_dir'}
2024
AddType application/x-httpd-php .php

install/tpl/apache_ispconfig.vhost.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ NameVirtualHost *:<tmpl_var name="vhost_port">
8282

8383
<IfModule mod_headers.c>
8484
Header always add Strict-Transport-Security "max-age=15768000"
85+
RequestHeader unset Proxy early
8586
</IfModule>
8687

8788
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>

install/tpl/nginx_apps.vhost.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ server {
4040

4141
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
4242
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
43+
fastcgi_param HTTP_PROXY "";
4344

4445
fastcgi_param REMOTE_ADDR $remote_addr;
4546
fastcgi_param REMOTE_PORT $remote_port;

install/tpl/nginx_ispconfig.vhost.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ server {
3636
fastcgi_busy_buffers_size 256k;
3737
fastcgi_temp_file_write_size 256k;
3838
fastcgi_read_timeout 1200;
39+
fastcgi_param HTTP_PROXY "";
3940
}
4041

4142
location ~ /\. {

interface/lib/app.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ public function tpl_defaults() {
305305
//print_r($_SESSION);
306306
if(isset($_SESSION['s']['module']['name'])) {
307307
$this->tpl->setVar('app_module', $_SESSION['s']['module']['name']);
308+
$this->tpl->setVar('session_module', $_SESSION['s']['module']['name']);
308309
}
309310
if(isset($_SESSION['s']['user']) && $_SESSION['s']['user']['typ'] == 'admin') {
310311
$this->tpl->setVar('is_admin', 1);

interface/lib/classes/aps_guicontroller.inc.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,13 @@ public function validateInstallerInput($postinput, $pkg_details, $domains, $sett
574574
// Find out document_root and make sure no apps are installed twice to one location
575575
if(in_array($postinput['main_domain'], $domains))
576576
{
577-
$docroot = $app->db->queryOneRecord("SELECT document_root FROM web_domain
577+
$docroot = $app->db->queryOneRecord("SELECT document_root, web_folder FROM web_domain
578578
WHERE domain = ?", $this->getMainDomain($postinput['main_domain']));
579-
$new_path = $docroot['document_root'];
579+
if(trim($docroot['web_folder']) == '') {
580+
$new_path = $docroot['document_root'];
581+
} else {
582+
$new_path = $docroot['document_root'] . '/' . $docroot['web_folder'];
583+
}
580584
if(substr($new_path, -1) != '/') $new_path .= '/';
581585
$new_path .= $main_location;
582586

interface/lib/classes/auth.inc.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,10 @@ public function get_random_password($minLength = 8, $special = false) {
213213
return str_shuffle($password);
214214
}
215215

216-
public function crypt_password($cleartext_password) {
216+
public function crypt_password($cleartext_password, $charset = 'UTF-8') {
217+
if($charset != 'UTF-8') {
218+
$cleartext_password = mb_convert_encoding($cleartext_password, $charset, 'UTF-8');
219+
}
217220
$salt="$1$";
218221
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
219222
for ($n=0;$n<8;$n++) {

interface/lib/classes/remote.d/sites.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ public function sites_web_domain_add($session_id, $client_id, $params, $readonly
434434
if($params['pm_min_spare_servers'] == '') $params['pm_min_spare_servers'] = 1;
435435
if($params['pm_max_spare_servers'] == '') $params['pm_max_spare_servers'] = 1;
436436

437-
$domain_id = $this->insertQuery('../sites/form/web_vhost_domain.tform.php', $client_id, $params, 'sites:web_domain:on_after_insert');
437+
$domain_id = $this->insertQuery('../sites/form/web_vhost_domain.tform.php', $client_id, $params, 'sites:web_vhost_domain:on_after_insert');
438438
if ($readonly === true)
439439
$app->db->query("UPDATE web_domain SET `sys_userid` = '1' WHERE domain_id = ?", $domain_id);
440440
return $domain_id;

interface/lib/classes/remoting_lib.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ function ispconfig_sysuser_add($params, $insert_id){
284284
$startmodule=$_modules[0];
285285
}
286286
}
287-
$usertheme = $params["usertheme"];
287+
$usertheme = (isset($params["usertheme"]) && $params["usertheme"] != '')?$params["usertheme"]:'default';
288288
$type = 'user';
289289
$active = 1;
290290
$insert_id = $app->functions->intval($insert_id);

0 commit comments

Comments
 (0)