From: cvs2git Date: Sun, 30 Nov 2008 16:02:45 +0000 (+0000) Subject: This commit was manufactured by cvs2git to create tag 'AWSTATS_6_9_BETA'. X-Git-Tag: AWSTATS_6_9_BETA X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d3033c155a1314e5b827af8fe767cbc78b62af81;p=thirdparty%2FAWStats.git This commit was manufactured by cvs2git to create tag 'AWSTATS_6_9_BETA'. Sprout from master 2008-11-15 16:20:53 UTC eldy 'Fix: Full list of extrasections was not ordered correctly' Cherrypick from master 2008-11-30 16:02:44 UTC eldy 'Add ax and rs domains': README.TXT make/makepack-howto.txt wwwroot/cgi-bin/awstats.pl wwwroot/cgi-bin/lib/domains.pm wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm --- diff --git a/README.TXT b/README.TXT index 11ec8376..c1c51c77 100644 --- a/README.TXT +++ b/README.TXT @@ -14,7 +14,7 @@ server log files (and even ftp servers or mail logs) on all Operating Systems. License: GNU GPL (GNU General Public License. See LICENSE file), OSI Certified Open Source Software license. Version: 6.9 -Release date: August 2008 +Release date: November 2008 Platforms: All (Linux, NT, BSD, Solaris and other *NIX's, BeOS, OS/2...) Author: Laurent Destailleur AWStats official web site and latest version: http://awstats.sourceforge.net @@ -91,6 +91,7 @@ I - 2) Requirements * Your server must log web access in a log file you can read. * To run awstats, from command line, your operating system must be able to run perl scripts (.pl files). + * Perl module "Encode" must be available. To run awstats as a CGI (for real-time statistics), your web server must also be able to run such scripts. diff --git a/make/makepack-howto.txt b/make/makepack-howto.txt index a36f0224..048251ab 100644 --- a/make/makepack-howto.txt +++ b/make/makepack-howto.txt @@ -1,18 +1,18 @@ -***** Actions to do to release ***** -- Check all files are commited. -- Update file README.txt -- Update version number in doc files -- Update version number in makepack files -- Update version number and copyright year in awstats.pl file -- Build PAD files -- Build PDF -- Tagger CVS +***** Actions to build a beta or release ***** +- Check all files are commited. +- Update file README.txt +- Update version number in doc files +- Update version number in makepack files +- Update version number and copyright year in awstats.pl file +- Build PAD files +- Build PDF +- Tagger CVS (AWSTATS_x_x_BETA or AWSTATS_x_x) -- makepack sur webmin -- makepack sur awstats (If on linux copy awstats_logo1.gif into $RPMDIR/SOURCES) -- Check content of built packages. -- Move build files into "files" directory -- Update web site page index.php -- Upload files and web site on web server -- Upload files on sourceforge -- Send mail on mailing-list +- makepack sur webmin +- makepack sur awstats (If on linux copy awstats_logo1.gif into $RPMDIR/SOURCES) +- Check content of built packages. +- Move build files into "files" directory +- Update web site page index.php +- Upload files and web site on web server +- Upload files on sourceforge (release only) +- Send mail on mailing-list diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 860b150e..591ad333 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -16,6 +16,7 @@ use strict; no strict "refs"; use Time::Local; # use Time::Local 'timelocal_nocheck' is faster but not supported by all Time::Local modules use Socket; +use Encode; #------------------------------------------------------------------------------ # Defines @@ -3587,16 +3588,10 @@ sub Read_History_With_TmpUpdate { } next; } - if ( $field[0] eq 'LastUpdate' - || $field[0] eq "${xmlrb}LastUpdate" ) + if ($field[0] eq 'LastUpdate' + || $field[0] eq "${xmlrb}LastUpdate") { - if ( $LastUpdate < $field[1] ) { - $LastUpdate = int( $field[1] ); - - #$LastUpdateLinesRead=int($field[2]); - #$LastUpdateNewLinesRead=int($field[3]); - #$LastUpdateLinesCorrupted=int($field[4]); - } + if (! $LastUpdate) { $LastUpdate=int($field[1]); }; next; } if ( $field[0] eq 'TotalVisits' @@ -6114,12 +6109,8 @@ sub Save_History { } # General - if ( $sectiontosave eq 'general' ) { - if ( $LastUpdate < - int("$nowyear$nowmonth$nowday$nowhour$nowmin$nowsec") ) - { - $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 "
\n"; @@ -7475,7 +7466,8 @@ sub XMLEncode { #------------------------------------------------------------------------------ # Function: Transforms spaces into %20 and special chars by HTML entities as needed in XML/XHTML -# Decoding is done by XMLDecodeFromHisto +# Decoding is done by XMLDecodeFromHisto. +# AWStats data files are stored in ISO-8859-1. # Parameters: stringtoencode # Return: encodedstring #------------------------------------------------------------------------------ @@ -7492,6 +7484,17 @@ sub XMLEncodeForHisto { return $string; } +#------------------------------------------------------------------------------ +# Function: Encode an ISO string to PageCode output +# Parameters: stringtoencode +# Return: encodedstring +#------------------------------------------------------------------------------ +sub EncodeToPageCode { + my $string = shift; + if ($PageCode eq 'utf-8') { $string=encode("utf8", $string); } + return $string; +} + #------------------------------------------------------------------------------ # Function: Encode a binary string into an ASCII string # Parameters: stringtoencode @@ -7585,6 +7588,7 @@ sub CleanXSS { #------------------------------------------------------------------------------ # Function: Clean tags in a string +# AWStats data files are stored in ISO-8859-1. # Parameters: stringtodecode # Input: None # Output: None diff --git a/wwwroot/cgi-bin/lib/domains.pm b/wwwroot/cgi-bin/lib/domains.pm index 1f16c869..630927b1 100644 --- a/wwwroot/cgi-bin/lib/domains.pm +++ b/wwwroot/cgi-bin/lib/domains.pm @@ -25,6 +25,7 @@ 'am','Armenia','an','Netherlands Antilles','ao','Angola', 'aq','Antarctica','ar','Argentina','arpa','Old style Arpanet', 'as','American Samoa','at','Austria','au','Australia','aw','Aruba', +'ax','Aland islands', 'az','Azerbaidjan','ba','Bosnia-Herzegovina','bb','Barbados', 'bd','Bangladesh','be','Belgium','bf','Burkina Faso','bg','Bulgaria', 'bh','Bahrain','bi','Burundi','biz','Biz domains','bj','Benin','bm','Bermuda', @@ -73,7 +74,9 @@ 'pg','Papua New Guinea','ph','Philippines','pk','Pakistan','pl','Poland', 'pm','Saint Pierre and Miquelon','pn','Pitcairn Island','pr','Puerto Rico','pro','Professional domains', 'ps','Palestinian Territories','pt','Portugal','pw','Palau','py','Paraguay','qa','Qatar', -'re','Reunion (French)','ro','Romania','ru','Russian Federation','rw','Rwanda', +'re','Reunion (French)','ro','Romania', +'rs','Republic of Serbia', +'ru','Russian Federation','rw','Rwanda', 'sa','Saudi Arabia','sb','Solomon Islands','sc','Seychelles', 'sd','Sudan','se','Sweden','sg','Singapore','sh','Saint Helena','si','Slovenia', 'sj','Svalbard and Jan Mayen Islands','sk','Slovak Republic','sl','Sierra Leone', diff --git a/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm b/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm index b7f6cbfa..ed1c7508 100755 --- a/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm +++ b/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm @@ -1157,7 +1157,7 @@ my %regall=( "ET_52","Sumale", "ET_53","Tigray", "ET_54","YeDebub Biheroch Bihereseboch na Hizboch", -"FI_01","�land", +"FI_01","Iland", "FI_06","Lapland", "FI_08","Oulu", "FI_13","Southern Finland", @@ -2124,7 +2124,7 @@ my %regall=( "KZ_01","Almaty", "KZ_02","Almaty City", "KZ_03","Aqmola", -"KZ_04","Aqt�be", +"KZ_04","Aqtebe", "KZ_05","Astana", "KZ_06","Atyrau", "KZ_07","West Kazakhstan", @@ -2245,21 +2245,21 @@ my %regall=( "LV_07","Daugavpils", "LV_08","Dobeles", "LV_09","Gulbenes", -"LV_10","J�kabpils", +"LV_10","Jekabpils", "LV_11","Jelgava", "LV_12","Jelgavas", "LV_13","Jurmala", -"LV_14","Kr�slavas", +"LV_14","Krelavas", "LV_15","Kuldigas", -"LV_16","Liep�ja", -"LV_17","Liep�jas", +"LV_16","Liepeja", +"LV_17","Liepejas", "LV_18","Limbazu", "LV_19","Ludzas", "LV_20","Madonas", "LV_21","Ogres", "LV_22","Preilu", -"LV_23","R�zekne", -"LV_24","R�zeknes", +"LV_23","Rezekne", +"LV_24","Rezeknes", "LV_25","Riga", "LV_26","Rigas", "LV_27","Saldus", @@ -4389,7 +4389,7 @@ sub AddHTMLGraph_geoip_city_maxmind { print "".$DomainsHashIDLib{$countrycode}.""; my $regionlib=RegionName($countrycode, $regioncode); print "".($regionlib?$regionlib:' ').""; - print "".ucfirst($city).""; + print "".ucfirst(EncodeToPageCode($city)).""; if ($ShowCities =~ /P/i) { print "".($_city_p{$key}?$_city_p{$key}:" ").""; } if ($ShowCities =~ /P/i) { print "".($_city_p{$key}?"$p_p %":' ').""; } if ($ShowCities =~ /H/i) { print "".($_city_h{$key}?$_city_h{$key}:" ").""; } @@ -4590,7 +4590,7 @@ sub ShowInfoHost_geoip_city_maxmind { # else { print "$Message[0]"; } # print ""; print ""; - if ($city) { print "$city"; } + if ($city) { print EncodeToPageCode($city); } else { print "$Message[0]"; } print ""; } @@ -4626,7 +4626,7 @@ sub ShowInfoHost_geoip_city_maxmind { # else { print "$Message[0]"; } # print ""; print ""; - if ($city) { print "$city"; } + if ($city) { print EncodeToPageCode($city); } else { print "$Message[0]"; } print ""; } @@ -4811,14 +4811,14 @@ sub SectionWriteHistory_geoip_city_maxmind { #my $page=$_city_p{$_}||0; #my $bytes=$_city_k{$_}||0; #my $lastaccess=$_city_l{$_}||''; - print HISTORYTMP "${xmlrb}$_${xmlrs}0${xmlrs}", $_city_h{$_}, "${xmlrs}0${xmlrs}0${xmlre}\n"; next; + print HISTORYTMP "${xmlrb}".XMLEncodeForHisto($_)."${xmlrs}0${xmlrs}", $_city_h{$_}, "${xmlrs}0${xmlrs}0${xmlre}\n"; next; } foreach (keys %_city_h) { if ($keysinkeylist{$_}) { next; } #my $page=$_city_p{$_}||0; #my $bytes=$_city_k{$_}||0; #my $lastaccess=$_city_l{$_}||''; - print HISTORYTMP "${xmlrb}$_${xmlrs}0${xmlrs}", $_city_h{$_}, "${xmlrs}0${xmlrs}0${xmlre}\n"; next; + print HISTORYTMP "${xmlrb}".XMLEncodeForHisto($_)."${xmlrs}0${xmlrs}", $_city_h{$_}, "${xmlrs}0${xmlrs}0${xmlre}\n"; next; } print HISTORYTMP "${xmleb}END_PLUGIN_geoip_city_maxmind${xmlee}\n"; # ----->