Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISPConfig
ISPConfig 3
Commits
6165e36f
Commit
6165e36f
authored
Mar 02, 2018
by
Marius Burkard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed htpasswd path for nginx awstats, fixes
#4937
parent
542eb1da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
server/plugins-available/nginx_plugin.inc.php
server/plugins-available/nginx_plugin.inc.php
+15
-4
No files found.
server/plugins-available/nginx_plugin.inc.php
View file @
6165e36f
...
...
@@ -1770,8 +1770,19 @@ class nginx_plugin {
$tpl
->
setLoop
(
'alias_seo_redirects'
,
$alias_seo_redirects
);
}
$stats_web_folder
=
'web'
;
if
(
$data
[
'new'
][
'type'
]
==
'vhost'
){
if
(
$data
[
'new'
][
'web_folder'
]
!=
''
){
if
(
substr
(
$data
[
'new'
][
'web_folder'
],
0
,
1
)
==
'/'
)
$data
[
'new'
][
'web_folder'
]
=
substr
(
$data
[
'new'
][
'web_folder'
],
1
);
if
(
substr
(
$data
[
'new'
][
'web_folder'
],
-
1
)
==
'/'
)
$data
[
'new'
][
'web_folder'
]
=
substr
(
$data
[
'new'
][
'web_folder'
],
0
,
-
1
);
}
$stats_web_folder
.
=
'/'
.
$data
[
'new'
][
'web_folder'
];
}
elseif
(
$data
[
'new'
][
'type'
]
==
'vhostsubdomain'
||
$data
[
'new'
][
'type'
]
==
'vhostalias'
)
{
$stats_web_folder
=
$data
[
'new'
][
'web_folder'
];
}
//* Create basic http auth for website statistics
$tpl
->
setVar
(
'stats_auth_passwd_file'
,
$data
[
'new'
][
'document_root'
]
.
"/
web
/stats/.htpasswd_stats"
);
$tpl
->
setVar
(
'stats_auth_passwd_file'
,
$data
[
'new'
][
'document_root'
]
.
"/
"
.
$stats_web_folder
.
"
/stats/.htpasswd_stats"
);
// Create basic http auth for other directories
$basic_auth_locations
=
$this
->
_create_web_folder_auth_configuration
(
$data
[
'new'
]);
...
...
@@ -1839,11 +1850,11 @@ class nginx_plugin {
}
// create password file for stats directory
if
(
!
is_file
(
$data
[
'new'
][
'document_root'
]
.
'/
web
/stats/.htpasswd_stats'
)
||
$data
[
'new'
][
'stats_password'
]
!=
$data
[
'old'
][
'stats_password'
])
{
if
(
!
is_file
(
$data
[
'new'
][
'document_root'
]
.
'/
'
.
$stats_web_folder
.
'
/stats/.htpasswd_stats'
)
||
$data
[
'new'
][
'stats_password'
]
!=
$data
[
'old'
][
'stats_password'
])
{
if
(
trim
(
$data
[
'new'
][
'stats_password'
])
!=
''
)
{
$htp_file
=
'admin:'
.
trim
(
$data
[
'new'
][
'stats_password'
]);
$app
->
system
->
file_put_contents
(
$data
[
'new'
][
'document_root'
]
.
'/
web
/stats/.htpasswd_stats'
,
$htp_file
);
$app
->
system
->
chmod
(
$data
[
'new'
][
'document_root'
]
.
'/
web
/stats/.htpasswd_stats'
,
0755
);
$app
->
system
->
file_put_contents
(
$data
[
'new'
][
'document_root'
]
.
'/
'
.
$stats_web_folder
.
'
/stats/.htpasswd_stats'
,
$htp_file
);
$app
->
system
->
chmod
(
$data
[
'new'
][
'document_root'
]
.
'/
'
.
$stats_web_folder
.
'
/stats/.htpasswd_stats'
,
0755
);
unset
(
$htp_file
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment