View Single Post
  #28  
Old 23rd November 2009, 12:13
sirrus sirrus is offline
Junior Member
 
Join Date: May 2009
Location: Frankfurt am Main
Posts: 15
Thanks: 4
Thanked 1 Time in 1 Post
Send a message via ICQ to sirrus Send a message via Skype™ to sirrus
Default

Thank you for this plugin.

It is not creating awstat conf files in my case. A lot of people use secured php where exec is denied. I think it is at least one securtiy rights issue.

I suggest to rewrite this code to use fwrite:

Code:
function domain_insert($event_name,$data) {
        global $app, $conf;

        $newfile = "/etc/awstats/awstats.".$data["new"]["domain"].".conf";
        $oldfile = "/etc/awstats/awstats.".$data["old"]["domain"].".conf";

        if(!@is_file($newfile) || ($oldfile != '' && $newfile != $oldfile)) {
                if ( @is_file($oldfile) )
                        exec("rm -f ".$oldfile);

                $fp = fopen($newfile,"w");
                if ($fp) {
                        $awcon = "Include \"/etc/awstats/awstats.conf\"\n" .
                        "LogFile=\"/var/log/ispconfig/httpd/".$data["new"]["domain"]."/access.log\"\n" .
                        "SiteDomain=\"".$data["new"]["domain"]."\"\n" .
                        "DNSLookup=\"1\"\n" .
                        "DirData =\"/var/cache/awstats\"\n" .
                        "AllowFullYearView=\"3\"";
                        //$awcon .= "\nAllowAccessFromWebToFollowingAuthenticatedUsers=\"".$ht_user_list."\"";
                        fwrite($fp, $awcon);
                        fclose($fp);
                }
        }
}

Last edited by sirrus; 23rd November 2009 at 13:59.
Reply With Quote