Cpanel-tools

   

awstats sample
Those fields in the index.php file that must be modified are highlighted below.

INSTRUCTIONS:
1. Replace all occurences of mysite.com with your web site's domain name
2. Replace awstatsuser/awstatspw with a unique userid and password to be used to access this utility
3. Replace cpaneluser/cpanelpw with your web site's cpanel userid & password


INDEX.PHP FILE:


<?php
// -------------------------------------------------------------------------- //
// AWStats Access 1.1.0 //
//Provides access to AWStats outside of cPanel, for when you don't want users to have full access. //
//Fixed error when choosing date other than current date. //
// ------------------------------------------------------------------------- //
// Copyright (C) 2003 GeekMob.com//
// crazeegeek@geekmob.com //
// ------------------------------------------------------------------------ //
// Core script was written by Real Web Host //
// (http://realwebhost.net //
// ------------------------------------------------------------------------ //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// ----------------------------------------------------------------------- //


if (!isset($PHP_AUTH_USER)) {


header('WWW-Authenticate: Basic realm="Site Statistics"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;


} else if (isset($PHP_AUTH_USER)) {


if (($PHP_AUTH_USER != "awstatsuser") || ($PHP_AUTH_PW != "awstatspw")) {


header('WWW-Authenticate: Basic realm="Site Statistics"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;


} else {
if($QUERY_STRING == ""){$query = "config=mysite.com";}else{$query=$QUERY_STRING;};


exec("/usr/bin/curl 'http://cpaneluser:cpanelpwd@mysite.com:2082/awstats.pl?$query'",$return_message_array, $return_number);


for ($i = 0; $i < count($return_message_array); $i++) {
$results = $results.$return_message_array[$i];
}


if($query == "config=mysite.com"){$results = str_replace("src=\"", "src=\"?", $results);}


if($framename==index){$results = str_replace("src=\"", "src=\"index.php?", $results);}
$results = str_replace("action=\"", "action=\"index.php?", $results);
$results = str_replace("href=\"", "href=\"?", $results);
$results = str_replace("awstats.pl?", "", $results);


echo $results;
}
}
?>


   
Talk with us live about your problems!

Having a web hosting problem and need an answer now? Our web hosting support team is ready to answer your toughest account questions 24/7. Feel free to reach us if you are having a problem or just have a question or two about our services. We are here to help!
Leftbottom
 
  home | sitemap | forums | support | terms | status                                                    Copyright © 2008 TotalChoice Hosting, L.L.C.