721 | 721 |
char szTemp [80];
|
722 | 722 |
|
723 | 723 |
strncpy (szTemp, ctime (&iTime), sizeof (szTemp) - 1);
|
724 | |
szTemp [sizeof (szTemp) - 1] = '\0'; // Ensure the time string is null-terminated.
|
725 | |
|
|
724 |
// Ensure the time string is null-terminated.
|
|
725 |
szTemp [sizeof (szTemp) - 1] = '\0';
|
726 | 726 |
iCount = strlen (szTemp);
|
727 | 727 |
if (iCount > 0)
|
728 | 728 |
if (szTemp [iCount - 1] == '\n')
|
|
2350 | 2350 |
if (sDispLine != "")
|
2351 | 2351 |
{
|
2352 | 2352 |
GetColumn (sDispLine.c_str(), 1, sTemp);
|
2353 | |
for (iVectorCount = 0; iVectorCount < iNumRecords; iVectorCount++)
|
|
2353 |
for (iVectorCount = 0; iVectorCount < iNumRecords;
|
|
2354 |
iVectorCount++)
|
2354 | 2355 |
{
|
2355 | 2356 |
if (sTemp == vUserDetails [iVectorCount].sLoginName)
|
2356 | 2357 |
{
|
|
2428 | 2429 |
{
|
2429 | 2430 |
bMadeOutput = true;
|
2430 | 2431 |
sTemp = RightJustify (
|
2431 | |
ItoCommas (
|
2432 | |
rDomainPointers.vList [iVectorCount].iBytes), nSizeCols);
|
|
2432 |
ItoCommas (
|
|
2433 |
rDomainPointers.vList [iVectorCount].iBytes), nSizeCols);
|
2433 | 2434 |
if (iRepWordHits == CSV)
|
2434 | 2435 |
sTemp += sRepSeperator;
|
2435 | 2436 |
else
|
|
2802 | 2803 |
GetColumn (sLine.c_str(), 2, sTemp);
|
2803 | 2804 |
if (sTemp == "")
|
2804 | 2805 |
sTemp = "unkown";
|
2805 | |
sLine = "Total bytes including small requests: " + sTemp + "\n";
|
|
2806 |
sLine = "Total bytes including small requests: " + sTemp
|
|
2807 |
+ "\n";
|
2806 | 2808 |
bWrite = true;
|
2807 | 2809 |
iLen = 0;
|
2808 | 2810 |
}
|
|
3156 | 3158 |
}
|
3157 | 3159 |
|
3158 | 3160 |
MyCls();
|
3159 | |
con << "Filter a report leaving one user.\n\nEnter new report name: ";
|
|
3161 |
con << "Filter a report leaving one user.\n\n"
|
|
3162 |
<< "Enter new report name: ";
|
3160 | 3163 |
GetFileName (sDest, &bGood);
|
3161 | 3164 |
if (!bGood)
|
3162 | 3165 |
break;
|
|
4443 | 4446 |
CalcPercentage (iSouthMarkEnd, iOneUserFileSize, sTemp);
|
4444 | 4447 |
NoLeadingSpaces (sTemp);
|
4445 | 4448 |
sLine += " to " + sTemp;
|
4446 | |
CalcPercentage (iSelectedAddress, iTotalRows == 0 ? 0 : iTotalRows - 1, sTemp);
|
|
4449 |
CalcPercentage (iSelectedAddress,
|
|
4450 |
iTotalRows == 0 ? 0 : iTotalRows - 1, sTemp);
|
4447 | 4451 |
NoLeadingSpaces (sTemp);
|
4448 | 4452 |
sLine += ") " + sTemp;
|
4449 | 4453 |
|
|
5416 | 5420 |
|
5417 | 5421 |
printf ("Making .squidview directory and links....\n");
|
5418 | 5422 |
|
|
5423 |
// bug fix contributed by Willi Mann: check for file existance, not size
|
5419 | 5424 |
sLogLocation = "";
|
5420 | |
for (iTemp = 0; iTemp < int (sizeof (sLogLocations)); iTemp++)
|
5421 | |
if (GetFileSize (sLogLocations [iTemp]) > 0)
|
|
5425 |
for (iTemp = 0; sLogLocations [iTemp] != ""; iTemp++)
|
|
5426 |
if (stat (sLogLocations [iTemp].c_str(), &sStatTable) == 0)
|
5422 | 5427 |
{
|
5423 | 5428 |
sLogLocation = sLogLocations [iTemp];
|
5424 | 5429 |
break;
|
|
5446 | 5451 |
{
|
5447 | 5452 |
printf ("The squid log file doesn't exist or is of zero size.\n");
|
5448 | 5453 |
printf ("You may need to manually adjust the symlinks in ~/.squidview\n");
|
5449 | |
exit (1);
|
|
5454 |
printf ("It was assumed that your access.log is at %s\n",
|
|
5455 |
sLogLocation.c_str());
|
|
5456 |
|
|
5457 |
// Don't exit if logfile is empty but does exist.
|
|
5458 |
if (stat (sLogLocation.c_str(), &sStatTable) != 0)
|
|
5459 |
{
|
|
5460 |
#ifdef DEBIANIZED
|
|
5461 |
printf ("You may want to add your username to the group proxy.\n");
|
|
5462 |
#endif
|
|
5463 |
exit (1);
|
|
5464 |
}
|
5450 | 5465 |
}
|
5451 | 5466 |
}
|
5452 | 5467 |
|