View Single Post
Old 7th April 2010, 20:51
dclardy dclardy is offline
Senior Member
Join Date: Sep 2009
Location: Dallas, TX
Posts: 347
Thanks: 10
Thanked 50 Times in 28 Posts

Thanks for the help Till.

Just in case any one else wants to add this automatically. It gives you access to the stats folder when Drupal is installed. It might work with other CMS as well.

DirectoryIndex index.php index.html index.htm
Options +Indexes
//* 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 = "DirectoryIndex index.php index.html index.htm\nOptions +Indexes\n\n\nAuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$data["new"]["document_root"]."/.htpasswd_stats\nrequire valid-user";
It starts at line 818 and ends at 825. You can just copy and paste this in if you want you can look at the changes that I have made to it.
Reply With Quote