/usr/share/htcheck/php/index.php is in htcheck-php 1:2.0.0~rc1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | <?php
// index.php
// Home page
//
// Part of the ht://Check package
//
// Copyright (c) 1999-2004 Comune di Prato - Prato - Italy
// Author: Gabriele Bartolini - Prato - Italy <angusgb@users.sourceforge.net>
//
// For copyright details, see the file COPYING in your distribution
// or the GNU General Public License version 2 or later
// <http://www.gnu.org/copyleft/gpl.html>
//
// $Id: index.php,v 1.22 2004/05/26 09:38:56 angusgb Exp $
include ("./include/global.inc.php");
//
// Show Summary function
// Declaration for PHP3 compatibility
//
function ShowSummary($dbname, $strSQL, $strHeader)
{
global $MyDB;
?>
<div class="header">
<h4><?php echo $strHeader; ?></h4>
</div>
<div class="content">
<?php
$result = $MyDB->CreateHTMLTable($strSQL, $dbname, true);
if ($result<0)
{
DisplayErrMsg($MyDB->errmsg);
return;
}
else if (!result):
?>
<p><?php echo $strNoOccurrencies; ?></p>
<?php
endif;
?>
</div>
<?php
}
if (!empty($dbname))
{
$pagetitle = "Database: $dbname";
$linkbar = "<a href=\"index.php\">" . $strMainPage . "</a>";
$linkbar = $linkbar . " | " .
"<a href=\"drop.php?dbname=" . $dbname . "\">" . $strDBDeletion . "</a>";
}
else
{
$pagetitle = $strMainPage;
$linkbar="";
}
?>
<?php include ("./include/header.inc.php"); ?>
<!-- Check the presence of any ht://Check databases -->
<?php
if (empty($dbname))
{
// No database selected
if (!is_array($dblist) || ! $numdbs=count($dblist))
{
if ($MyDB->GetHtCheckDBList())
{
DisplayErrMsg($MyDB->errmsg);
return;
}
// Redirect the dinamically created list to the managed one
$dblist = $MyDB->HtDBs;
// Set the number of databases
$numdbs = count ($dblist);
}
if ($numdbs)
{
if ($numdbs == 1)
$dbname = $dblist[0];
else
{
// At least one database found
eval ("\$strNumDBs=\"$strNumDBs\";");
?>
<h3><?php echo $strNumDBs; ?></h3>
<?php echo $strChooseaDB; ?>:<br>
<form>
<select name="dbname">
<?php
for ($i = 0; $i < $numdbs; $i++)
{
?>
<option><?php echo $dblist[$i]; ?></option>
<?php
}
?>
</select>
<input type="submit" value="<?php echo $strSelectaDB; ?>">
</form>
<?php
}
}
else
{
// No database found
eval ("\$strNoDBs=\"$strNoDBs\";");
?>
<h3><?php echo $strNoDBs; ?></h3>
<?php
}
}
if (! empty($dbname) )
{
// A database has been selected
eval ("\$strDBSelected=\"$strDBSelected\";");
?>
<?php echo $strDBSelected; ?><br>
<div class="header">
<h3><?php echo $strGeneralInfo; ?>:</h3>
</div>
<div class="content">
<?php
$strSQL = "Select * from htCheck";
// Get general info from htCheck table
$result=$MyDB->Query($dbname, $strSQL);
if ($result)
{
DisplayErrMsg($MyDB->errmsg);
die;
}
if ($MyDB->NumRows())
{
$row = $MyDB->FetchArray();
?>
<?php echo $strUser; ?>: <strong><?php echo $row["User"]; ?></strong><br>
<?php echo $strStartTime; ?>: <strong><?php echo $row["StartTime"]; ?></strong><br>
<?php echo $strEndTime; ?>: <strong><?php echo $row["EndTime"]; ?></strong><br>
<?php
}
$MyDB->Free();
$result=$MyDB->GetGeneralInfo($dbname);
if ($result<0)
{
DisplayErrMsg($MyDB->errmsg);
return;
}
else
{
?>
<?php echo $strServersEncountered; ?>: <strong><?php echo number_format($MyDB->Info["Server"]); ?></strong><br>
<?php echo $strScheduledURLS; ?>: <strong><?php echo number_format($MyDB->Info["Schedule"]); ?></strong><br>
<?php echo $strRetrievedURLS; ?>: <strong><?php echo number_format($MyDB->Info["Url"]); ?></strong><br>
<?php echo $strHTMLStatements; ?>: <strong><?php echo number_format($MyDB->Info["HtmlStatement"]); ?></strong>
(<?php echo $strHTMLAttributes; ?>: <strong><?php echo number_format($MyDB->Info["HtmlAttribute"]); ?></strong>)<br>
<?php echo $strLinks; ?>: <strong><?php echo number_format($MyDB->Info["Link"]); ?></strong><br>
</div>
<div class="header">
<h3><?php echo $strOperations; ?>:</h3>
</div>
<div class="content">
<ul>
<li><a href="qryurls.php?dbname=<?php echo $dbname; ?>"><?php echo $strShowListUrlsFltr; ?></a></li>
<li><a href="listlinks.php?dbname=<?php echo $dbname; ?>"><?php echo $strShowListLinks; ?></a></li>
<li><a href="listurls.php?dbname=<?php echo $dbname; ?>&all=1"><?php echo $strShowListUrls; ?></a></li>
<li><a href="qryachecks.php?dbname=<?php echo $dbname; ?>"><?php echo $strShowListAchecks; ?></a></li>
</ul>
</div>
<?php
// HTTP results
$strSQL = "Select StatusCode as '". $strStatusCode . "', ReasonPhrase as '"
. $strReasonPhrase ."',"
. " count(*) as '". $strNumber . "' from Url group by StatusCode, ReasonPhrase";
ShowSummary($dbname, $strSQL, $strHTTPRequestsResults);
// Servers seen
$strSQL = "Select Server, Port, HttpServer as '"
. $strWebServerInfo . "', HttpVersion as '" . $strProtocol . "',"
. " Requests as '" . $strRequests . "' from Server where Requests > 1"
. " order by Requests DESC";
ShowSummary($dbname, $strSQL, $strServersSeenOrdIDServer);
// Connection results
$strSQL = "Select ConnStatus as '". $strConnectionStatus . "',"
. " count(*) as 'Num.' from Url group by ConnStatus";
ShowSummary($dbname, $strSQL, $strConnectionResults);
// Content-Type results
$strSQL = "Select ContentType as 'Content Type',"
. " count(*) as '". $strNumber . "' from Url group by ContentType";
ShowSummary($dbname, $strSQL, $strContentTypeResults);
// Cookies
$strSQL = "SELECT Name, Value, Path, Domain, SrcUrl as '$strUrl' from Cookies";
ShowSummary($dbname, $strSQL, $strCookiesReport);
}
}
?>
<br>
<?php include ("./include/footer.inc.php"); ?>
|