[phpMP-CVS] CVS: phpMP/includes config.init.php,1.7,1.8 core.php,1.59,1.60 debug.php,1.8,1.9 functio
Status: Pre-Alpha
Brought to you by:
heimidal
From: Brian R. <hei...@us...> - 2003-06-29 18:33:24
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv4663/includes Modified Files: config.init.php core.php debug.php functions.php session.php user.php Log Message: Updating function names. Index: config.init.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/config.init.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** config.init.php 29 Jun 2003 08:19:55 -0000 1.7 --- config.init.php 29 Jun 2003 18:33:21 -0000 1.8 *************** *** 35,39 **** // Loop through all config values from DB. // Define each key as its respective value. ! while( $row = $DB->fetchArray( $result ) ) { $this->_cfgvars[$row['config_key']] = $row['config_value']; --- 35,39 ---- // Loop through all config values from DB. // Define each key as its respective value. ! while( $row = $DB->fetch_array( $result ) ) { $this->_cfgvars[$row['config_key']] = $row['config_value']; Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -r1.59 -r1.60 *** core.php 29 Jun 2003 08:19:55 -0000 1.59 --- core.php 29 Jun 2003 18:33:21 -0000 1.60 *************** *** 26,30 **** { ! function stripMagicQuotes($arr) { foreach ($arr as $k => $v) --- 26,30 ---- { ! function strip_magic_quotes($arr) { foreach ($arr as $k => $v) *************** *** 56,62 **** if (get_magic_quotes_gpc()) { ! if (!empty($_GET)) { $_GET = $this->stripMagicQuotes($_GET); } ! if (!empty($_POST)) { $_POST = $this->stripMagicQuotes($_POST); } ! if (!empty($_COOKIE)) { $_COOKIE = $this->stripMagicQuotes($_COOKIE); } } --- 56,62 ---- if (get_magic_quotes_gpc()) { ! if (!empty($_GET)) { $_GET = $this->strip_magic_quotes($_GET); } ! if (!empty($_POST)) { $_POST = $this->strip_magic_quotes($_POST); } ! if (!empty($_COOKIE)) { $_COOKIE = $this->strip_magic_quotes($_COOKIE); } } *************** *** 99,103 **** $User = new User(); // Create an instance of User. ! createVars(); include_once(PHPMP_ROOT . 'includes/session.php'); --- 99,103 ---- $User = new User(); // Create an instance of User. ! create_vars(); include_once(PHPMP_ROOT . 'includes/session.php'); Index: debug.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/debug.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** debug.php 29 Jun 2003 08:19:55 -0000 1.8 --- debug.php 29 Jun 2003 18:33:21 -0000 1.9 *************** *** 28,37 **** function Debug() { ! @set_error_handler( array(&$this, 'msgDisplay') ); } // Very similar to that of phpBB2, considering this is my first forray into error management. // Hopefully, once I figure all of these different error codes and such out, I'll make it fit in more with the project. ! function msgDisplay($errno, $msg_text, $errfile, $errline) { global $DB, $Config, $User, $Template; --- 28,37 ---- function Debug() { ! @set_error_handler( array(&$this, 'msg_display') ); } // Very similar to that of phpBB2, considering this is my first forray into error management. // Hopefully, once I figure all of these different error codes and such out, I'll make it fit in more with the project. ! function msg_display($errno, $msg_text, $errfile, $errline) { global $DB, $Config, $User, $Template; Index: functions.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/functions.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -r1.31 -r1.32 *** functions.php 29 Jun 2003 08:19:55 -0000 1.31 --- functions.php 29 Jun 2003 18:33:21 -0000 1.32 *************** *** 27,31 **** // Accepts: none. // Returns: none. ! function createVars() { global $Config, $User; --- 27,31 ---- // Accepts: none. // Returns: none. ! function create_vars() { global $Config, $User; Index: session.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/session.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** session.php 29 Jun 2003 08:19:55 -0000 1.14 --- session.php 29 Jun 2003 18:33:22 -0000 1.15 *************** *** 43,47 **** if($this->started == false) { ! $this->getSessionData(); $this->started = true; } --- 43,47 ---- if($this->started == false) { ! $this->get_session_data(); $this->started = true; } *************** *** 91,99 **** $result = $DB->query($sql); ! $num_rows = $DB->numRows($result); if( $num_rows == 1 ) // We have a user! { ! $User->set( $DB->fetchAssoc($result) ); $this->session_user_id = $User->get('user_id'); $this->is_logged_in = true; --- 91,99 ---- $result = $DB->query($sql); ! $num_rows = $DB->num_rows($result); if( $num_rows == 1 ) // We have a user! { ! $User->set( $DB->fetch_assoc($result) ); $this->session_user_id = $User->get('user_id'); $this->is_logged_in = true; *************** *** 137,141 **** $cur_time = time(); // Time as of right now. $exp_time = $cur_time + $Config->get('session_length'); // Time at which this session will become invalid. ! $this->ip = $User->getIPEncoded(); // Gets the user's IP address. $session_exists = false; // We'll assume that no sessions exist yet. --- 137,141 ---- $cur_time = time(); // Time as of right now. $exp_time = $cur_time + $Config->get('session_length'); // Time at which this session will become invalid. ! $this->ip = $User->get_ip_encoded(); // Gets the user's IP address. $session_exists = false; // We'll assume that no sessions exist yet. *************** *** 150,154 **** $result = $DB->query($sql); ! $num_rows = $DB->numRows($result); // Checks for a session in the database. --- 150,154 ---- $result = $DB->query($sql); ! $num_rows = $DB->num_rows($result); // Checks for a session in the database. *************** *** 157,161 **** // If the session is expired, we'll go ahead and create a new one regardless. // The old one *should* be cleaned out by our clean() function later. ! $this->session_data = $DB->fetchAssoc($result); if( $this->session_data['session_exp_time'] < $cur_time ) { --- 157,161 ---- // If the session is expired, we'll go ahead and create a new one regardless. // The old one *should* be cleaned out by our clean() function later. ! $this->session_data = $DB->fetch_assoc($result); if( $this->session_data['session_exp_time'] < $cur_time ) { *************** *** 202,206 **** $result = $DB->query($sql); ! $User->set( $DB->fetchAssoc($result) ); } --- 202,206 ---- $result = $DB->query($sql); ! $User->set( $DB->fetch_assoc($result) ); } *************** *** 230,234 **** } ! function getSessionData() { global $Config, $DB, $User; --- 230,234 ---- } ! function get_session_data() { global $Config, $DB, $User; *************** *** 272,280 **** $result = $DB->query($sql); ! $num_rows = $DB->numRows($result); if( $num_rows == 1 ) // This cookie is valid. { ! $User->set( $DB->fetchAssoc($result) ); $User->set('invisible_mode', $auto_cookie_array[2]); $this->session_user_id = $auto_cookie_array[0]; --- 272,280 ---- $result = $DB->query($sql); ! $num_rows = $DB->num_rows($result); if( $num_rows == 1 ) // This cookie is valid. { ! $User->set( $DB->fetch_assoc($result) ); $User->set('invisible_mode', $auto_cookie_array[2]); $this->session_user_id = $auto_cookie_array[0]; Index: user.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/user.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** user.php 29 Jun 2003 08:19:56 -0000 1.25 --- user.php 29 Jun 2003 18:33:22 -0000 1.26 *************** *** 69,73 **** // Taken from phpBB2. Fetches the IP in a hex form. ! function getIPEncoded() { $this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : $REMOTE_ADDR; --- 69,73 ---- // Taken from phpBB2. Fetches the IP in a hex form. ! function get_ip_encoded() { $this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : $REMOTE_ADDR; *************** *** 84,88 **** // Taken from phpBB2. Decodes a hexed IP. ! function decodeIP($encoded_ip) { $hexipbang = explode('.', chunk_split($encoded_ip, 2, '.')); --- 84,88 ---- // Taken from phpBB2. Decodes a hexed IP. ! function decode_ip($encoded_ip) { $hexipbang = explode('.', chunk_split($encoded_ip, 2, '.')); |