[phpMP-CVS] CVS: phpMP/core main.php,1.8,1.9 session.php,1.4,1.5 template.php,1.4,1.5 user.php,1.2,1
Status: Pre-Alpha
Brought to you by:
heimidal
|
From: Brian R. <hei...@us...> - 2003-09-15 06:40:59
|
Update of /cvsroot/phpmp/phpMP/core
In directory sc8-pr-cvs1:/tmp/cvs-serv3465/core
Modified Files:
main.php session.php template.php user.php
Log Message:
A few bug fixes and resolved integration issues.
Index: main.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/main.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** main.php 15 Sep 2003 05:29:54 -0000 1.8
--- main.php 15 Sep 2003 06:40:24 -0000 1.9
***************
*** 55,60 ****
* @desc Initiates all core components.
*/
! function Portal()
{
// The following code ensures that, no matter what, the dreaded
// magic_quotes function will *never* mess with our data.
--- 55,61 ----
* @desc Initiates all core components.
*/
! function init()
{
+
// The following code ensures that, no matter what, the dreaded
// magic_quotes function will *never* mess with our data.
***************
*** 73,100 ****
include_once( C_PHPMP_ROOT . 'config.php' );
// Globalize all major class-containing variables.
global $Debug, $DB, $User, $MPCode, $Template;
! include_once( C_PHPMP_ROOT . CORE_DIR . '/debug.php' );
! $Debug = new Debug();
include_once( C_PHPMP_ROOT . CORE_DIR . 'dba/' . $dbinfo['type'] . '.php' );
! $DB = new sql_db($dbinfo['type'], $dbinfo['user'], $dbinfo['passwd'], $dbinfo['name'], false);
! $DB->connect();
unset($dbinfo);
- define('DB_CONFIG_TABLE', DB_NAME . '.' . DB_TABLE_PREFIX . 'config');
- define('DB_USERS_TABLE', DB_NAME . '.' . DB_TABLE_PREFIX . 'users');
- define('DB_SESSIONS_TABLE', DB_NAME . '.' . DB_TABLE_PREFIX . 'sessions');
- define('DB_MODULES_TABLE', DB_NAME . '.' . DB_TABLE_PREFIX . 'modules');
- define('DB_BLOCK_TABLE', DB_NAME . '.' . DB_TABLE_PREFIX . 'blocks');
- define('DB_TEMPLATE_VARS_TABLE', DB_NAME . '.' . DB_TABLE_PREFIX . 'template_vars');
-
- include_once(C_PHPMP_ROOT . CORE_DIR . 'config.init.php');
$this->_cfg_start();
-
- include_once(C_PHPMP_ROOT . CORE_DIR . 'constants.php');
include_once(C_PHPMP_ROOT . CORE_DIR . 'functions.php');
--- 74,101 ----
include_once( C_PHPMP_ROOT . 'config.php' );
+
+ include_once(C_PHPMP_ROOT . CORE_DIR . 'constants.php');
+
+ if(DEBUG_ON) { echo "Included constants.php.<br>\n"; }
// Globalize all major class-containing variables.
global $Debug, $DB, $User, $MPCode, $Template;
! //include_once( C_PHPMP_ROOT . CORE_DIR . '/debug.php' );
! //$Debug = new Debug();
include_once( C_PHPMP_ROOT . CORE_DIR . 'dba/' . $dbinfo['type'] . '.php' );
! $DB = new sql_db($dbinfo['host'], $dbinfo['user'], $dbinfo['passwd'], $dbinfo['name'], false);
!
! define('DB_CONFIG_TABLE', $dbinfo['name'] . '.' . $dbinfo['prefix'] . 'config');
! define('DB_USERS_TABLE', $dbinfo['name'] . '.' . $dbinfo['prefix'] . 'users');
! define('DB_SESSIONS_TABLE', $dbinfo['name'] . '.' . $dbinfo['prefix'] . 'sessions');
! define('DB_MODULES_TABLE', $dbinfo['name'] . '.' . $dbinfo['prefix'] . 'modules');
! define('DB_BLOCK_TABLE', $dbinfo['name'] . '.' . $dbinfo['prefix'] . 'blocks');
! define('DB_TEMPLATE_VARS_TABLE', $dbinfo['name'] . '.' . $dbinfo['prefix'] . 'template_vars');
unset($dbinfo);
$this->_cfg_start();
include_once(C_PHPMP_ROOT . CORE_DIR . 'functions.php');
***************
*** 103,107 ****
$User = new User(); // Create an instance of User.
! create_vars();
include_once(C_PHPMP_ROOT . CORE_DIR . 'session.php');
--- 104,108 ----
$User = new User(); // Create an instance of User.
! //create_vars();
include_once(C_PHPMP_ROOT . CORE_DIR . 'session.php');
***************
*** 142,146 ****
$Template->set_template( $this->cfg_get('template'), false, true );
! $DB->close();
}
--- 143,147 ----
$Template->set_template( $this->cfg_get('template'), false, true );
! $DB->sql_close();
}
***************
*** 153,161 ****
global $DB;
! $result = $DB->query( "SELECT * FROM " . DB_CONFIG_TABLE );
// 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'];
--- 154,162 ----
global $DB;
! $result = $DB->sql_query( "SELECT * FROM " . DB_CONFIG_TABLE );
// Loop through all config values from DB.
// Define each key as its respective value.
! while( $row = $DB->sql_fetch_row($result) )
{
$this->_cfgvars[$row['config_key']] = $row['config_value'];
Index: session.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/session.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** session.php 14 Sep 2003 21:55:51 -0000 1.4
--- session.php 15 Sep 2003 06:40:24 -0000 1.5
***************
*** 206,210 ****
}
! $DB->query($sql);
if( $this->is_logged_in == false )
--- 206,210 ----
}
! $DB->sql_query($sql);
if( $this->is_logged_in == false )
***************
*** 213,219 ****
WHERE user_id=' . $this->session_user_id;
! $result = $DB->query($sql);
! $User->set( $DB->fetch_assoc($result) );
}
--- 213,219 ----
WHERE user_id=' . $this->session_user_id;
! $result = $DB->sql_query($sql);
! $User->set( $DB->sql_fetch_row($result) );
}
***************
*** 236,240 ****
{
$sql = "DELETE FROM " . DB_SESSIONS_TABLE . " WHERE session_exp_time<" . time();
! $DB->query($sql);
if((!empty($this->session_user_id)) && ($this->session_user_id != ANONYMOUS) && (!empty($this->session_key)))
--- 236,240 ----
{
$sql = "DELETE FROM " . DB_SESSIONS_TABLE . " WHERE session_exp_time<" . time();
! $DB->sql_query($sql);
if((!empty($this->session_user_id)) && ($this->session_user_id != ANONYMOUS) && (!empty($this->session_key)))
Index: template.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/template.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** template.php 14 Sep 2003 21:55:51 -0000 1.4
--- template.php 15 Sep 2003 06:40:24 -0000 1.5
***************
*** 43,47 ****
// Root dir and hash of filenames for each template handle.
var $root = '';
! var $cache_root = 'cache/templates/';
var $files = array();
--- 43,47 ----
// Root dir and hash of filenames for each template handle.
var $root = '';
! var $cache_root = CACHE_DIR;
var $files = array();
***************
*** 61,65 ****
{
! $this->root = C_PHPMP_ROOT . 'templates/' . $template;
$this->cachedir = C_PHPMP_ROOT . $this->cache_root . $template . '/';
--- 61,65 ----
{
! $this->root = C_PHPMP_ROOT . TEMPLATES_DIR . $template;
$this->cachedir = C_PHPMP_ROOT . $this->cache_root . $template . '/';
Index: user.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/user.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** user.php 14 Sep 2003 21:55:51 -0000 1.2
--- user.php 15 Sep 2003 06:40:24 -0000 1.3
***************
*** 82,86 ****
function get_ip_encoded()
{
! $this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : $REMOTE_ADDR;
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
--- 82,86 ----
function get_ip_encoded()
{
! $this->ip = $_SERVER['REMOTE_ADDR'];
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
|