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;
}
}
?>
|