~ubuntu-branches/debian/sid/awstats/sid

« back to all changes in this revision

Viewing changes to wwwroot/js/awstats_misc_tracker.js

  • 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
// awstats_misc_tracker.js
2
2
//-------------------------------------------------------------------
3
 
// You can add this file onto some of your web pages (main home page
4
 
// can be enough) by adding the following HTML code:
5
 
// <script language=javascript src="/js/awstats_misc_tracker.js"></script>
 
3
// You can add this file onto some of your web pages (main home page can
 
4
// be enough) by adding the following HTML code to your page body:
 
5
//
 
6
// <script language=javascript src="/js/awstats_misc_tracker.js"></script>
 
7
// <noscript><img src="/js/awstats_misc_tracker.js?nojs=y" height=0 width=0 border=0 style="display: none"></noscript>
 
8
//
 
9
// * This must be added after the <body> tag, not placed within the
 
10
//   <head> tags, or the resulting tracking <img> tag will not be handled
 
11
//   correctly by all browsers.  Internet explorer will also not report
 
12
//   screen height and width attributes until it begins to render the
 
13
//   body.
 
14
//
6
15
// This allows AWStats to be enhanced with some miscellanous features:
7
16
// - Screen size detection (TRKscreen)
 
17
// - Browser size detection (TRKwinsize)
8
18
// - Screen color depth detection (TRKcdi)
9
19
// - Java enabled detection (TRKjava)
10
20
// - Macromedia Director plugin detection (TRKshk)
15
25
// - Acrobat PDF plugin detection (TRKpdf)
16
26
//-------------------------------------------------------------------
17
27
 
18
 
 
 
28
// If you use pslogger.php to generate your log, you can change this line with
 
29
// var awstatsmisctrackerurl="pslogger.php?loc=/js/awstats_misc_tracker.js";
19
30
var awstatsmisctrackerurl="/js/awstats_misc_tracker.js";
20
31
 
21
32
function awstats_setCookie(TRKNameOfCookie, TRKvalue, TRKexpirehours) {
39
50
 
40
51
function awstats_getCookie(TRKNameOfCookie){
41
52
        if (document.cookie.length > 0){
42
 
                TRKbegin = document.cookie.indexOf(TRKNameOfCookie+"="); 
 
53
                TRKbegin = document.cookie.indexOf(TRKNameOfCookie+"=");
43
54
            if (TRKbegin != -1) {
44
55
                        TRKbegin += TRKNameOfCookie.length+1; 
45
56
                        TRKend = document.cookie.indexOf(";", TRKbegin);
51
62
        return null; 
52
63
}
53
64
 
54
 
if (window.location.search == "") {
55
 
 
 
65
if (window.location.search == "" || window.location.search == "?") {
 
66
    // If no query string
56
67
        TRKnow = new Date();
57
68
        TRKscreen=screen.width+"x"+screen.height;
58
69
        if (navigator.appName != "Netscape") {TRKcdi=screen.colorDepth}
73
84
        var TRKns  = (navigator.appName.indexOf("Netscape") != -1);
74
85
        var TRKwin = ((TRKagt.indexOf("win")!=-1) || (TRKagt.indexOf("32bit")!=-1));
75
86
        var TRKmac = (TRKagt.indexOf("mac")!=-1);
 
87
 
 
88
    // Detect the browser internal width and height
 
89
    if (document.documentElement && document.documentElement.clientWidth)
 
90
        TRKwinsize = document.documentElement.clientWidth + 'x' + document.documentElement.clientHeight;
 
91
    else if (document.body)
 
92
        TRKwinsize = document.body.clientWidth + 'x' + document.body.clientHeight;
 
93
    else
 
94
        TRKwinsize = window.innerWidth + 'x' + window.innerHeight;
76
95
        
77
96
        if (TRKie && TRKwin) {
78
97
                var TRKshk = awstats_detectIE("SWCtl.SWCtl.1")
80
99
                var TRKrp  = awstats_detectIE("rmocx.RealPlayer G2 Control.1")
81
100
                var TRKmov = awstats_detectIE("QuickTimeCheckObject.QuickTimeCheck.1")
82
101
                var TRKwma = awstats_detectIE("MediaPlayer.MediaPlayer.1")
83
 
                var TRKpdf = awstats_detectIE("PDF.PdfCtrl.5");
 
102
                var TRKpdf = 'n'; 
 
103
        if (awstats_detectIE("PDF.PdfCtrl.1") == 'y') { TRKpdf = 'y'; }
 
104
            if (awstats_detectIE('PDF.PdfCtrl.5') == 'y') { TRKpdf = 'y'; }
 
105
                if (awstats_detectIE('PDF.PdfCtrl.6') == 'y') { TRKpdf = 'y'; }
84
106
        }
85
107
        if (TRKns || !TRKwin) {
86
108
                TRKnse = ""; for (var TRKi=0;TRKi<navigator.mimeTypes.length;TRKi++) TRKnse += navigator.mimeTypes[TRKi].type.toLowerCase();
91
113
                var TRKwma = awstats_detectNS("application/x-mplayer2")
92
114
                var TRKpdf = awstats_detectNS("application/pdf");
93
115
        }
94
 
        document.write('<img src="'+awstatsmisctrackerurl+'?screen='+TRKscreen+'&cdi='+TRKcdi+'&java='+TRKjava+'&shk='+TRKshk+'&fla='+TRKfla+'&rp='+TRKrp+'&mov='+TRKmov+'&wma='+TRKwma+'&pdf='+TRKpdf+'&uid='+TRKuserid+'&sid='+TRKsessionid+'" height=0 width=0 border=0>')
 
116
        document.write('<img src="'+awstatsmisctrackerurl+'?screen='+TRKscreen+'&win='+TRKwinsize+'&cdi='+TRKcdi+'&java='+TRKjava+'&shk='+TRKshk+'&fla='+TRKfla+'&rp='+TRKrp+'&mov='+TRKmov+'&wma='+TRKwma+'&pdf='+TRKpdf+'&uid='+TRKuserid+'&sid='+TRKsessionid+'" height=0 width=0 border=0>')
95
117
 
96
118
}