|
From: Jon O. <jon...@us...> - 2006-06-17 20:51:11
|
Update of /cvsroot/mxbb/mx_sitestats/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7266/modules/mx_sitestats/includes Modified Files: common.php Log Message: security Index: common.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/includes/common.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** common.php 2 May 2006 23:29:13 -0000 1.5 --- common.php 17 Jun 2006 20:51:08 -0000 1.6 *************** *** 9,12 **** --- 9,17 ---- */ + if( !defined('IN_PORTAL') ) + { + die("Hacking attempt"); + } + define( '_SITESTATS_VERSION', 'v1.3.0' ); *************** *** 14,21 **** if ( empty( $mx_table_prefix ) ) ! { ! // Workaround to retrieve MX config data from phpBB scope... ! if ( !function_exists( 'get_mx_table_prefix' ) ) { --- 19,26 ---- if ( empty( $mx_table_prefix ) ) ! { ! // Workaround to retrieve MX config data from phpBB scope... ! if ( !function_exists( 'get_mx_table_prefix' ) ) { *************** *** 73,80 **** $sitestats_config[$row['config_name']] = $row['config_value']; } ! } ! // Set Default Configuration (safety)... ! if ( empty( $sitestats_config['text_class'] ) ) { --- 78,85 ---- $sitestats_config[$row['config_name']] = $row['config_value']; } ! } ! // Set Default Configuration (safety)... ! if ( empty( $sitestats_config['text_class'] ) ) { *************** *** 112,116 **** { var $sql; // Last SQL query executed. ! function dbQuery( $sql ) { --- 117,121 ---- { var $sql; // Last SQL query executed. ! function dbQuery( $sql ) { *************** *** 144,162 **** class sitestats_counter extends sitestats ! { ! // Public Properties ! var $id, // Internal page identifier. $page, // Human page identifier. $hits_counter, // Hits Counter. $sess_counter; // Sessions Counter. ! var $digits_path, // Current relative path to digits path. $digits_ext; // File Extension for current digit images. ! ! // Constructor... ! function sitestats_counter() { --- 149,167 ---- class sitestats_counter extends sitestats ! { ! // Public Properties ! var $id, // Internal page identifier. $page, // Human page identifier. $hits_counter, // Hits Counter. $sess_counter; // Sessions Counter. ! var $digits_path, // Current relative path to digits path. $digits_ext; // File Extension for current digit images. ! ! // Constructor... ! function sitestats_counter() { *************** *** 175,182 **** $this->SERVER = &$_SERVER; } ! } ! // Public Methods related to the Counter... ! function readCounter( $page ) { --- 180,187 ---- $this->SERVER = &$_SERVER; } ! } ! // Public Methods related to the Counter... ! function readCounter( $page ) { *************** *** 210,217 **** { if ( $this->id == 0 ) ! { ! // There is still no counter for this page? ! $this->id = $this->dbMaxId( SITESTATS_COUNTER_TABLE, 'id' ); if ( empty( $this->id ) ) --- 215,222 ---- { if ( $this->id == 0 ) ! { ! // There is still no counter for this page? ! $this->id = $this->dbMaxId( SITESTATS_COUNTER_TABLE, 'id' ); if ( empty( $this->id ) ) *************** *** 221,228 **** } else ! { ! // Update the hits counter for this page... ! $sql = 'UPDATE ' . SITESTATS_COUNTER_TABLE . " SET page = '" . $this->page . "' , " . ' hits_counter = ' . $this->hits_counter . ' , ' . ' sess_counter = ' . $this->sess_counter . ' WHERE id = ' . $this->id; } --- 226,233 ---- } else ! { ! // Update the hits counter for this page... ! $sql = 'UPDATE ' . SITESTATS_COUNTER_TABLE . " SET page = '" . $this->page . "' , " . ' hits_counter = ' . $this->hits_counter . ' , ' . ' sess_counter = ' . $this->sess_counter . ' WHERE id = ' . $this->id; } *************** *** 233,240 **** $sql = 'DELETE FROM ' . SITESTATS_COUNTER_TABLE . ' WHERE id = ' . $this->id; return $this->dbQuery( $sql ) ? true : false; ! } ! // Public Methods related to Counter Images... ! function _getDigitsExt() { --- 238,245 ---- $sql = 'DELETE FROM ' . SITESTATS_COUNTER_TABLE . ' WHERE id = ' . $this->id; return $this->dbQuery( $sql ) ? true : false; ! } ! // Public Methods related to Counter Images... ! function _getDigitsExt() { *************** *** 293,300 **** ksort( $digits_ary ); return $digits_ary; ! } ! // Public Methods related to HTTP Referer... ! function updateReferer() { --- 298,305 ---- ksort( $digits_ary ); return $digits_ary; ! } ! // Public Methods related to HTTP Referer... ! function updateReferer() { *************** *** 330,337 **** var $usercount, $newestuser, $postcount, $topiccount; // get_db_stat var $return_limit; ! var $text_class; ! // Constructor ! function sitestats_phpbb() { --- 335,342 ---- var $usercount, $newestuser, $postcount, $topiccount; // get_db_stat var $return_limit; ! var $text_class; ! // Constructor ! function sitestats_phpbb() { *************** *** 342,349 **** $this->postcount = -1; $this->topiccount = -1; ! } ! // Basic phpBB statistics... ! function get_db_stat( $mode ) { --- 347,354 ---- $this->postcount = -1; $this->topiccount = -1; ! } ! // Basic phpBB statistics... ! function get_db_stat( $mode ) { *************** *** 353,360 **** } return $this->$mode; ! } ! // Compute the percent math... ! function do_percent_math( $firstval, $value, $total ) { --- 358,365 ---- } return $this->$mode; ! } ! // Compute the percent math... ! function do_percent_math( $firstval, $value, $total ) { *************** *** 366,373 **** $percent_array['bar_percent'] = max( 1, round( $value * $cst ) ); return $percent_array; ! } ! // Get voting bar info and Set templates variables... ! function set_voting_bar() { --- 371,378 ---- $percent_array['bar_percent'] = max( 1, round( $value * $cst ) ); return $percent_array; ! } ! // Get voting bar info and Set templates variables... ! function set_voting_bar() { *************** *** 381,385 **** $template->assign_vars( array( 'LEFT_GRAPH_IMAGE' => $vote_left, 'RIGHT_GRAPH_IMAGE' => $vote_right, ! 'GRAPH_IMAGE' => $vote_bar ) ); } --- 386,390 ---- $template->assign_vars( array( 'LEFT_GRAPH_IMAGE' => $vote_left, 'RIGHT_GRAPH_IMAGE' => $vote_right, ! 'GRAPH_IMAGE' => $vote_bar ) ); } |