~ubuntu-branches/ubuntu/lucid/awstats/lucid-updates

« back to all changes in this revision

Viewing changes to tools/awstats_buildstaticpages.pl

  • Committer: Bazaar Package Importer
  • Author(s): Nico Golde
  • Date: 2008-12-10 13:05:43 UTC
  • mfrom: (7.1.10 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081210130543-2sh59pphufllknju
Tags: 6.7.dfsg-5.1
* Non-maintainer upload by the Security Team.
* Strip '"' characters during URL decoding, fixing a cross-site
  scripting attack (CVE-2008-3714; CVE-2008-5080; Closes: #495432).

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
# Launch awstats with -staticlinks option to build all static pages.
4
4
# See COPYING.TXT file about AWStats GNU General Public License.
5
5
#------------------------------------------------------------------------------
6
 
# $Revision: 1.33 $ - $Author: eldy $ - $Date: 2005/08/23 19:56:35 $
 
6
# $Revision: 1.34 $ - $Author: eldy $ - $Date: 2007/05/05 02:18:05 $
7
7
 
8
8
#$|=1;
9
9
#use warnings;          # Must be used in test mode only. This reduce a little process speed
15
15
#------------------------------------------------------------------------------
16
16
# Defines
17
17
#------------------------------------------------------------------------------
18
 
my $REVISION='$Revision: 1.33 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1;
 
18
my $REVISION='$Revision: 1.34 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1;
19
19
my $VERSION="1.2 (build $REVISION)";
20
20
 
21
21
# ---------- Init variables --------
30
30
my $Lang;
31
31
my $YearRequired;
32
32
my $MonthRequired;
 
33
my $DayRequired;
33
34
my $Awstats='awstats.pl';
34
35
my $AwstatsDir='';
35
36
my $HtmlDoc='htmldoc';          # ghtmldoc.exe
44
45
my $FileConfig;
45
46
my $FileSuffix;
46
47
my $SiteConfig;
 
48
my $DatabaseBreak;
47
49
use vars qw/
48
50
$ShowAuthenticatedUsers $ShowFileSizesStats $ShowScreenSizeStats $ShowSMTPErrorsStats
49
51
$ShowEMailSenders $ShowEMailReceivers $ShowWormsStats $ShowClusterStats
243
245
if ($QueryString =~ /(^|-|&)debug=(\d+)/i)                      { $Debug=$2; }
244
246
if ($QueryString =~ /(^|-|&)configdir=([^&]+)/i)        { $DirConfig="$2"; }
245
247
if ($QueryString =~ /(^|-|&)config=([^&]+)/i)           { $SiteConfig="$2"; }
 
248
if ($QueryString =~ /(^|-|&)databasebreak=([^&]+)/i)    { $DatabaseBreak="$2"; }
246
249
if ($QueryString =~ /(^|-|&)awstatsprog=([^&]+)/i)      { $Awstats="$2"; }
247
250
if ($QueryString =~ /(^|-|&)buildpdf/i)                         { $BuildPDF=1; }
248
251
if ($QueryString =~ /(^|-|&)buildpdf=([^&]+)/i)         { $HtmlDoc="$2"; }
254
257
if ($QueryString =~ /(^|-|&)builddate=?([^&]*)/i)       { $BuildDate=$2||'%YY%MM%DD'; }
255
258
if ($QueryString =~ /(^|-|&)year=(\d\d\d\d)/i)          { $YearRequired="$2"; }
256
259
if ($QueryString =~ /(^|-|&)month=(\d{1,2})/i || $QueryString =~ /(^|-|&)month=(all)/i) { $MonthRequired="$2"; }
 
260
if ($QueryString =~ /(^|-|&)day=(\d{1,2})/i)        { $DayRequired="$2"; }
 
261
 
257
262
if ($QueryString =~ /(^|-|&)lang=([^&]+)/i)                     { $Lang="$2"; }
258
263
 
259
264
if ($OutputDir) { if ($OutputDir !~ /[\\\/]$/) { $OutputDir.="/"; } }
355
360
if ($Update) {
356
361
        my $command="\"$Awstats\" -config=$SiteConfig -update";
357
362
        $command .= " -configdir=$DirConfig" if defined $DirConfig;
 
363
        $command .= " -databasebreak=$DatabaseBreak" if defined $DatabaseBreak;
358
364
        print "Launch update process : $command\n";
359
365
        $retour=`$command  2>&1`;
360
366
}
403
409
my $smallcommand="\"$Awstats\" -config=$SiteConfig".($BuildPDF?" -buildpdf":"").($NoLoadPlugin?" -noloadplugin=$NoLoadPlugin":"")." -staticlinks".($OutputSuffix ne $SiteConfig?"=$OutputSuffix":"");
404
410
if ($StaticExt && $StaticExt ne 'html')     { $smallcommand.=" -staticlinksext=$StaticExt"; }
405
411
if ($DirIcons)      { $smallcommand.=" -diricons=$DirIcons"; }
406
 
if ($DirConfig)         { $smallcommand.=" -configdir=$DirConfig"; }
 
412
if ($DirConfig)     { $smallcommand.=" -configdir=$DirConfig"; }
407
413
if ($Lang)          { $smallcommand.=" -lang=$Lang"; }
 
414
if ($DayRequired)   { $smallcommand.=" -day=$DayRequired"; }
408
415
if ($MonthRequired) { $smallcommand.=" -month=$MonthRequired"; }
409
416
if ($YearRequired)  { $smallcommand.=" -year=$YearRequired"; }
410
417