Advertisement
janter13

awstats cpanel

Nov 1st, 2014
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. <?php
  2.  
  3. $user = 'user';
  4. $pass = 'pass';
  5. $domain = 'jan-ter.com';
  6.  
  7. function getFile($fileQuery){
  8.   global $user, $pass, $domain;
  9.   return file_get_contents("https://$user:$pass@$domain:2083/".$fileQuery);
  10. }
  11.  
  12. if(strpos($_SERVER['QUERY_STRING'],'.png')!==false) {
  13.   $fileQuery = $_SERVER['QUERY_STRING'];
  14. }
  15. elseif(empty($_SERVER['QUERY_STRING'])){
  16.   $fileQuery = "awstats.pl?config=$domain";
  17. }
  18. else {
  19.   $fileQuery = 'awstats.pl?'.$_SERVER['QUERY_STRING'];
  20. }
  21.  
  22. $file = getFile($fileQuery);
  23.  
  24. if(strpos($_SERVER['QUERY_STRING'],'.png')===false) {
  25.   $file = str_replace('awstats.pl', basename($_SERVER['PHP_SELF']), $file);
  26.   $file = str_replace('="/images','="'.basename($_SERVER['PHP_SELF']).'?images',$file);
  27. }
  28. else {
  29.   header("Content-type: image/png");
  30. }
  31.  
  32. echo $file;
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement