| | |
| | | |
| | | |
| | | // Load required base-classes |
| | | $app->uses('ini_parser,file,services,getconf'); |
| | | $app->uses('ini_parser,file,services,getconf,system'); |
| | | |
| | | |
| | | ####################################################################################################### |
| | |
| | | exec($command); |
| | | if(is_file($rec['document_root'].'/'.$web_folder.'/stats/index.html')) unlink($rec['document_root'].'/'.$web_folder.'/stats/index.html'); |
| | | rename($rec['document_root'].'/'.$web_folder.'/stats/awstats.'.$domain.'.html',$rec['document_root'].'/'.$web_folder.'/stats/awsindex.html'); |
| | | if(!is_file($rec['document_root']."/".$web_folder."/stats/index.php")) copy("/usr/local/ispconfig/server/conf/awstats_index.php.master",$rec['document_root']."/".$web_folder."/stats/index.php"); |
| | | if(!is_file($rec['document_root']."/".$web_folder."/stats/index.php")) { |
| | | if(file_exists("/usr/local/ispconfig/server/conf-custom/awstats_index.php.master")) { |
| | | copy("/usr/local/ispconfig/server/conf-custom/awstats_index.php.master",$rec['document_root']."/".$web_folder."/stats/index.php"); |
| | | } else { |
| | | copy("/usr/local/ispconfig/server/conf/awstats_index.php.master",$rec['document_root']."/".$web_folder."/stats/index.php"); |
| | | } |
| | | } |
| | | |
| | | $app->log('Created awstats statistics with command: '.$command,LOGLEVEL_DEBUG); |
| | | } else { |
| | |
| | | unset($dir_handle); |
| | | |
| | | //* Remove backupdir symlink and create as directory instead |
| | | $app->uses('system'); |
| | | $app->system->web_folder_protection($web_path,false); |
| | | |
| | | if(is_link($web_path.'/backup')) { |
| | | unlink($web_path.'/backup'); |
| | | } |
| | |
| | | chown($web_path.'/backup', $rec['system_user']); |
| | | chgrp($web_path.'/backup', $rec['system_group']); |
| | | } |
| | | |
| | | $app->system->web_folder_protection($web_path,true); |
| | | |
| | | } |
| | | |