Skip to content

Commit 7452b29

Browse files
author
Marius Cramer
committed
Merge branch 'stable-3.0.5' of /home/git/repositories/pixcept/ispconfig3 into stable-3.0.5
2 parents 80b5deb + 8eca284 commit 7452b29

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

install/lib/install.lib.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,23 @@ function removeLine($filename, $search_pattern, $strict = 0) {
666666
}
667667
}
668668

669+
function hasLine($filename, $search_pattern, $strict = 0) {
670+
if($lines = @file($filename)) {
671+
foreach($lines as $line) {
672+
if($strict == 0) {
673+
if(stristr($line, $search_pattern)) {
674+
return true;
675+
}
676+
} else {
677+
if(trim($line) == $search_pattern) {
678+
return true;
679+
}
680+
}
681+
}
682+
}
683+
return false;
684+
}
685+
669686
function is_installed($appname) {
670687
exec('which '.escapeshellcmd($appname).' 2> /dev/null', $out, $returncode);
671688
if(isset($out[0]) && stristr($out[0], $appname) && $returncode == 0) {

install/lib/installer_base.lib.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,15 @@ public function configure_apache() {
12251225
replaceLine('/etc/apache2/ports.conf', 'Listen 443', 'Listen 443', 1);
12261226
}
12271227

1228+
if(is_file('/etc/apache2/apache.conf')) {
1229+
if(hasLine('/etc/apache2/apache.conf', 'Include sites-enabled/', 1) == false) {
1230+
if(hasLine('/etc/apache2/apache.conf', 'IncludeOptional sites-enabled/*.conf', 1) == false) {
1231+
replaceLine('/etc/apache2/apache.conf', 'Include sites-enabled/', 'Include sites-enabled/', 1, 1);
1232+
} elseif(hasLine('/etc/apache2/apache.conf', 'IncludeOptional sites-enabled/*.vhost', 1) == false) {
1233+
replaceLine('/etc/apache2/apache.conf', 'IncludeOptional sites-enabled/*.vhost', 'IncludeOptional sites-enabled/*.vhost', 1, 1);
1234+
}
1235+
}
1236+
}
12281237

12291238
//* Copy the ISPConfig configuration include
12301239
$vhost_conf_dir = $conf['apache']['vhost_conf_dir'];

0 commit comments

Comments
 (0)