~ubuntu-branches/ubuntu/jaunty/awstats/jaunty

« back to all changes in this revision

Viewing changes to wwwroot/cgi-bin/plugins/example/example.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2005-02-05 17:13:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050205171348-h8uy32bhbcnhciie
Tags: 6.3-1
* New upstream release. Closes: bug#293702, #293668 (thanks to Nelson
  A. de Oliveira <naoliv@biolinux.df.ibilce.unesp.br>).
  + Includes upstream fix for security bug fixed in 6.2-1.1.
  + Includes upstream fix for most of security bug fixed in 6.2-1.1.
* Acknowledge NMUs. Closes: bug#291064, #294488 (thanks to Martin
  Schulze <joey@infodrom.org>, Martin Pitt <mpitt@debian.org>, Ubuntu,
  Joey Hess <joeyh@debian.org>, Frank Lichtenheld <djpig@debian.org> and Steve
  Langasek <vorlon@debian.org>).
* Include patch for last parts of security bug fixed in 6.2-1.1:
  01_sanitize_more.patch.
* Patch (02) to include snapshot of recent development:
  + Fix security hole that allowed a user to read log file content
    even when plugin rawlog was not enabled.
  + Fix a possible use of AWStats for a DoS attack.
  + configdir option was broken on windows servers.
  + DebugMessages is by default set to 0 for security reasons.
  + Minor fixes.
* References:
  CAN-2005-0435 - read server logs via loadplugin and pluginmode
  CAN-2005-0436 - code injection via PluginMode
  CAN-2005-0437 - directory traversal via loadplugin
  CAN-2005-0438 - information leak via debug

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/perl
2
2
#-----------------------------------------------------------------------------
3
 
# AWStats axample plugin
 
3
# Example AWStats plugin
4
4
# <-----
5
5
# THIS IS A SAMPLE OF AN EMPTY PLUGIN FILE WITH INSTRUCTIONS TO HELP YOU TO
6
6
# WRITE YOUR OWN WORKING PLUGIN. REPLACE THIS SENTENCE WITH THE PLUGIN GOAL.
9
9
#-----------------------------------------------------------------------------
10
10
# Perl Required Modules: Put here list of all required plugins
11
11
#-----------------------------------------------------------------------------
12
 
# $Revision: 1.10 $ - $Author: eldy $ - $Date: 2003/11/15 19:39:01 $
 
12
# $Revision: 1.12 $ - $Author: eldy $ - $Date: 2004/03/28 17:02:23 $
13
13
 
14
14
 
15
15
# <-----
49
49
 
50
50
        # <-----
51
51
        # ENTER HERE CODE TO DO INIT PLUGIN ACTIONS
52
 
        debug("InitParams=$InitParams",1);
 
52
        debug(" InitParams=$InitParams",1);
53
53
        $PluginVariable1="";
54
54
        # ----->
55
55
 
67
67
# PLUGIN FUNCTION: AddHTMLStyles_pluginname
68
68
# UNIQUE: NO (Several plugins using this function can be loaded)
69
69
# Function called to Add HTML styles at beginning of BODY section.
 
70
# Parameters: None
70
71
#-----------------------------------------------------------------------------
71
72
sub AddHTMLStyles_example {
72
73
        # <-----
77
78
#-----------------------------------------------------------------------------
78
79
# PLUGIN FUNCTION: AddHTMLBodyHeader_pluginname
79
80
# UNIQUE: NO (Several plugins using this function can be loaded)
80
 
# Function called to Add HTML code at beginning of BODY section.
 
81
# Function called to Add HTML code at beginning of BODY section (top of page).
 
82
# Parameters: None
81
83
#-----------------------------------------------------------------------------
82
84
sub AddHTMLBodyHeader_example {
83
85
        # <-----
86
88
}
87
89
 
88
90
#-----------------------------------------------------------------------------
 
91
# PLUGIN FUNCTION: AddHTMLBodyFooter_pluginname
 
92
# UNIQUE: NO (Several plugins using this function can be loaded)
 
93
# Function called to Add HTML code at end of BODY section (bottom of page).
 
94
# Parameters: None
 
95
#-----------------------------------------------------------------------------
 
96
sub AddHTMLBodyFooter_example {
 
97
        # <-----
 
98
        # PERL CODE HERE
 
99
        # ----->
 
100
}
 
101
 
 
102
#-----------------------------------------------------------------------------
 
103
# PLUGIN FUNCTION: AddHTMLMenuHeader_pluginname
 
104
# UNIQUE: NO (Several plugins using this function can be loaded)
 
105
# Function called to Add HTML code just before the menu section
 
106
# Parameters: None
 
107
#-----------------------------------------------------------------------------
 
108
sub AddHTMLMenuHeader_example {
 
109
        # <-----
 
110
        # PERL CODE HERE
 
111
        # ----->
 
112
}
 
113
 
 
114
#-----------------------------------------------------------------------------
 
115
# PLUGIN FUNCTION: AddHTMLMenuFooter_pluginname
 
116
# UNIQUE: NO (Several plugins using this function can be loaded)
 
117
# Function called to Add HTML code just after the menu section
 
118
# Parameters: None
 
119
#-----------------------------------------------------------------------------
 
120
sub AddHTMLMenuFooter_example {
 
121
        # <-----
 
122
        # PERL CODE HERE
 
123
        # ----->
 
124
}
 
125
 
 
126
#-----------------------------------------------------------------------------
 
127
# PLUGIN FUNCTION: AddHTMLContentHeader_pluginname
 
128
# UNIQUE: NO (Several plugins using this function can be loaded)
 
129
# Function called to Add HTML code just before the first report
 
130
# Parameters: None
 
131
#-----------------------------------------------------------------------------
 
132
sub AddHTMLContentHeader_example {
 
133
        # <-----
 
134
        # PERL CODE HERE
 
135
        # ----->
 
136
}
 
137
 
 
138
#-----------------------------------------------------------------------------
89
139
# PLUGIN FUNCTION: ShowInfoHost_pluginname
90
140
# UNIQUE: NO (Several plugins using this function can be loaded)
91
141
# Function called to add additionnal columns to the Hosts report.
92
142
# This function is called when building rows of the report (One call for each
93
143
# row). So it allows you to add a column in report, for example with code :
94
 
#   print "<TD>This is a new cell</TD>";
 
144
#   print "<TD>This is a new cell for $param</TD>";
95
145
# Parameters: Host name or ip
96
146
#-----------------------------------------------------------------------------
97
 
sub ShowInfoHost_hostinfo {
 
147
sub ShowInfoHost_example {
 
148
    my $param="$_[0]";
98
149
        # <-----
99
150
        # PERL CODE HERE
100
151
        # ----->
106
157
# Function used to add additionnal columns to the Top Pages-URL report.
107
158
# This function is called when building rows of the report (One call for each
108
159
# row). So it allows you to add a column in report, for example with code :
109
 
#   print "<TD>This is a new cell</TD>";
 
160
#   print "<TD>This is a new cell for $param</TD>";
 
161
# Parameters: URL
110
162
#-----------------------------------------------------------------------------
111
163
sub ShowPagesAddField_example {
 
164
    my $param="$_[0]";
112
165
        # <-----
113
166
        # PERL CODE HERE
114
167
        # ----->
123
176
# Parameters: URL
124
177
#-----------------------------------------------------------------------------
125
178
sub ShowInfoURL_example {
 
179
    my $param="$_[0]";
126
180
        # <-----
127
181
        # PERL CODE HERE
128
182
        # ----->
134
188
# Function called to add additionnal columns to Authenticated users report.
135
189
# This function is called when building rows of the report (One call for each
136
190
# row). So it allows you to add a column in report, for example with code :
137
 
#   print "<TD>This is a new cell</TD>";
 
191
#   print "<TD>This is a new cell for $param</TD>";
138
192
# Parameters: User
139
193
#-----------------------------------------------------------------------------
140
194
sub ShowInfoUser_example {
 
195
    my $param="$_[0]";
141
196
        # <-----
142
197
        # PERL CODE HERE
143
198
        # ----->