Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
lolo888
ISPConfig 3
Commits
430309f2
Commit
430309f2
authored
Oct 06, 2009
by
tbrehm
Browse files
Implemented: FS#912 - Improve statistics .htaccess file
parent
c4570e2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/plugins-available/apache2_plugin.inc.php
View file @
430309f2
...
...
@@ -803,7 +803,7 @@ class apache2_plugin {
//* Create .htaccess and .htpasswd file for website statistics
if
(
!
is_file
(
$data
[
"new"
][
"document_root"
]
.
'/web/stats/.htaccess'
)
or
$data
[
"old"
][
"document_root"
]
!=
$data
[
"new"
][
"document_root"
])
{
if
(
!
is_dir
(
$data
[
"new"
][
"document_root"
]
.
'/web/stats'
))
mkdir
(
$data
[
"new"
][
"document_root"
]
.
'/web/stats'
);
$ht_file
=
"AuthType Basic
\n
AuthName
\"
Members Only
\"\n
AuthUserFile "
.
$data
[
"new"
][
"document_root"
]
.
"/.htpasswd_stats
\
n
<limit GET PUT POST>
\
n
require valid-user
\n
</limit>
"
;
$ht_file
=
"AuthType Basic
\n
AuthName
\"
Members Only
\"\n
AuthUserFile "
.
$data
[
"new"
][
"document_root"
]
.
"/.htpasswd_stats
\n
require valid-user"
;
file_put_contents
(
$data
[
"new"
][
"document_root"
]
.
'/web/stats/.htaccess'
,
$ht_file
);
chmod
(
$data
[
"new"
][
"document_root"
]
.
'/web/stats/.htaccess'
,
0664
);
unset
(
$ht_file
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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