* Site access logging * * */ 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');
{ return false; } if ($logQry) { $pageName .= '+'.$match[3]; // All queries match } $pageName = $err_code.$pageName; // Add the error code at the beginning, so its treated uniquely return $pageName; }*/ require_once e_PLUGIN . "log/consolidate.php"; $lgc = new logConsolidate(); if (!($pageName = $lgc->getPageKey($self, false, $err_code, e_LAN))) { if (LOG_DEBUG == true) { echo 'pageName was empty'; } return; } if (LOG_DEBUG == true) { echo "<br />File: " . $logPfile; } //$logfp = fopen(e_LOG.'rcvstring.txt', 'a+'); fwrite($logfp, $pageName."\n"); fclose($logfp); $p_handle = fopen($logPfile, 'r+'); if ($p_handle && flock($p_handle, LOCK_EX)) { $log_file_contents = ''; while (!feof($p_handle)) { $log_file_contents .= fgets($p_handle, 1000);
public function init() { if (!empty($_POST['rebuild'])) { require_once e_PLUGIN . 'log/consolidate.php'; $lgc = new logConsolidate(); $file = $_POST['rebuild'] . "_SiteStats.log"; $lgc->processRawBackupLog($file, true); } if (!empty($_POST['rebuildTotal'])) { require_once e_PLUGIN . 'log/consolidate.php'; $lgc = new logConsolidate(); if ($lgc->collatePageTotalDB()) { e107::getMessage()->addSuccess(LAN_UPDATED); } else { e107::getMessage()->addError(LAN_UPDATED_FAILED); } } // Set drop-down values (if any). if (isset($_POST['updatesettings'])) { $this->prefsPageSubmit(); } if (isset($_POST['remSelP'])) { $this->rempagePageSubmit(); // Do the deletions - then redisplay the list of pages } if (isset($_POST['wipeSubmit'])) { $this->wipe(); } }