Example #1
0
*

*
*/
if (!defined('e107_INIT')) {
    exit;
}
if (vartrue($pref['statActivate'])) {
    if (!$pref['statCountAdmin'] && ADMIN) {
        return;
    }
    // Page to log here
    if (USER_AREA) {
        require_once e_PLUGIN . 'log/consolidate.php';
        $lgc = new logConsolidate();
        $lgc->run();
        $err_flag = '';
        if (defined('ERR_PAGE_ACTIVE')) {
            // We've got an error - set a flag to log it
            $err_flag = "&err_direct=" . ERR_PAGE_ACTIVE;
            if (is_numeric(e_QUERY)) {
                $err_flag .= '/' . substr(e_QUERY, 0, 10);
            }
            // This should pick up the error code - and limit numeric length to upset the malicious
            $err_flag .= "&err_referer=" . $_SERVER['HTTP_REFERER'];
        }
    }
    if (USER_AREA) {
        $logJS = "\r\n\r\n\t\t\$(function() {\r\n\r\n\t\t\tfunction rstr2b64(input)\r\n\t\t\t{\r\n\t\t\t\tvar b64pad  = \"=\"; /* base-64 pad character. \"=\" for strict RFC compliance   */\r\n\t\t\t\tvar tab = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\r\n\t\t\t\tvar output = \"\";\r\n\t\t\t\tvar len = input.length;\r\n\t\t\t\tfor(var i = 0; i < len; i += 3)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar triplet = (input.charCodeAt(i) << 16)\r\n\t\t\t                | (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)\r\n\t\t\t                | (i + 2 < len ? input.charCodeAt(i+2)      : 0);\r\n\t\t\t\t\tfor(var j = 0; j < 4; j++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i * 8 + j * 6 > input.length * 8) output += b64pad;\r\n\t\t\t\t\t\telse output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn output;\r\n\t\t\t}\r\n\r\n\r\n\r\n\r\n\r\n\t\t\tvar ref\t\t\t=\"\"+escape(top.document.referrer);\r\n\t\t\tvar eeself       = escape(window.location.href);\r\n\r\n\t\t\tvar colord \t\t= window.screen.colorDepth;\r\n\t\t\tvar res \t\t= window.screen.width + \"x\" + window.screen.height;\r\n\t\t\tvar logString \t= 'referer=' + ref + '&colour=' + colord + '&eself=' + eeself + '&res=' + res + '" . $err_flag . "';\r\n\t\t\tlogString \t\t= rstr2b64(logString);\r\n\r\n\t\t\tvar url = '" . SITEURLBASE . e_PLUGIN_ABS . "log/log.php';\r\n\t\t\tvar dataText = 'lv='+logString;\r\n\r\n\t\t\t\$.ajax({\r\n\t\t\t\ttype: 'get',\r\n\t\t\t\turl: url,\r\n\t\t\t\tdata: {'lv' :logString},\r\n\t\t\t\tsuccess: function(e) {\r\n\t\t\t\t\tif(e)\r\n\t\t\t\t\t{\r\n\t\t\t\t//\t\talert(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t\t";
        e107::js('footer-inline', $logJS, 'jquery');
    }