Skip to content

Commit 8e5d526

Browse files
author
Till Brehm
committed
Merge branch '6389-apache-vhost-alias-stats' into 'develop'
Fix stats for vhost alias #6386 Closes #6389 See merge request ispconfig/ispconfig3!1730
2 parents f4e5e1c + 5aeb35e commit 8e5d526

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,18 +1935,18 @@ function update($event_name, $data) {
19351935

19361936
if($data['new']['stats_type'] != '') {
19371937
if(!is_dir($data['new']['document_root'].'/' . $web_folder . '/stats')) $app->system->mkdir($data['new']['document_root'].'/' . $web_folder . '/stats');
1938-
$ht_file = "AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$data['new']['document_root']."/web/stats/.htpasswd_stats\nrequire valid-user\nDirectoryIndex index.html index.php\nHeader set Content-Security-Policy \"default-src * 'self' 'unsafe-inline' 'unsafe-eval' data:;\"\n<Files \"goaindex.html\">\nAddDefaultCharset UTF-8\n</Files>\n";
1938+
$ht_file = "AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$data['new']['document_root']."/".$web_folder."/stats/.htpasswd_stats\nrequire valid-user\nDirectoryIndex index.html index.php\nHeader set Content-Security-Policy \"default-src * 'self' 'unsafe-inline' 'unsafe-eval' data:;\"\n<Files \"goaindex.html\">\nAddDefaultCharset UTF-8\n</Files>\n";
19391939
$app->system->file_put_contents($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', $ht_file);
19401940
$app->system->chmod($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', 0755);
19411941
unset($ht_file);
19421942

1943-
if(!is_file($data['new']['document_root'].'/web/stats/.htpasswd_stats') || $data['new']['stats_password'] != $data['old']['stats_password']) {
1943+
if(!is_file($data['new']['document_root'].'/'.$web_folder.'/stats/.htpasswd_stats') || $data['new']['stats_password'] != $data['old']['stats_password']) {
19441944
if(isset($data['new']['stats_password']) && trim($data['new']['stats_password']) != '') {
19451945
$htp_file = 'admin:'.trim($data['new']['stats_password']);
19461946
$app->system->web_folder_protection($data['new']['document_root'], false);
1947-
$app->system->file_put_contents($data['new']['document_root'].'/web/stats/.htpasswd_stats', $htp_file);
1947+
$app->system->file_put_contents($data['new']['document_root'].'/'.$web_folder.'/stats/.htpasswd_stats', $htp_file);
19481948
$app->system->web_folder_protection($data['new']['document_root'], true);
1949-
$app->system->chmod($data['new']['document_root'].'/web/stats/.htpasswd_stats', 0755);
1949+
$app->system->chmod($data['new']['document_root'].'/'.$web_folder.'/stats/.htpasswd_stats', 0755);
19501950
unset($htp_file);
19511951
}
19521952
}

0 commit comments

Comments
 (0)