phpmp-commits Mailing List for phpMyPublications (Page 3)
Status: Pre-Alpha
Brought to you by:
heimidal
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
(69) |
May
(1) |
Jun
|
Jul
(53) |
Aug
(27) |
Sep
|
Oct
|
Nov
(35) |
Dec
(71) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(5) |
Feb
(65) |
Mar
|
Apr
(15) |
May
(40) |
Jun
(72) |
Jul
|
Aug
(2) |
Sep
(95) |
Oct
(37) |
Nov
|
Dec
|
| 2005 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Brian R. <hei...@us...> - 2003-09-22 10:26:23
|
Update of /cvsroot/phpmp/phpMP/core
In directory sc8-pr-cvs1:/tmp/cvs-serv22906/core
Modified Files:
sessions.php
Log Message:
Index: sessions.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/sessions.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** sessions.php 22 Sep 2003 10:23:27 -0000 1.5
--- sessions.php 22 Sep 2003 10:26:20 -0000 1.6
***************
*** 30,33 ****
--- 30,34 ----
var $_session_exists = false;
var $_sess_key = false;
+ var $ip = false;
function sess_start($create=true)
***************
*** 148,152 ****
$sql = "INSERT INTO " . DB_SESSIONS_TABLE . "
(session_key, session_user_id, session_start_time, session_exp_time, session_ip)
! VALUES('" . $this->_sess_key . "', " . $user_id . ", " . $time . ", " . $exp_time . ", '" . $ip . "')";
$result = $DB->sql_query($sql);
--- 149,153 ----
$sql = "INSERT INTO " . DB_SESSIONS_TABLE . "
(session_key, session_user_id, session_start_time, session_exp_time, session_ip)
! VALUES('" . $this->_sess_key . "', " . $user_id . ", " . $time . ", " . $exp_time . ", '" . $this->ip . "')";
$result = $DB->sql_query($sql);
***************
*** 252,256 ****
function _sess_ip_encoded()
{
! $ip = $_SERVER['REMOTE_ADDR'];
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
--- 253,257 ----
function _sess_ip_encoded()
{
! $this->ip = $_SERVER['REMOTE_ADDR'];
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
***************
*** 259,267 ****
{
$private_ip = array('#^0\.#', '#^127\.0\.0\.1#', '#^192\.168\.#', '#^172\.16\.#', '#^10\.#', '#^224\.#', '#^240\.#');
! $ip = preg_replace($private_ip, $ip, $ip_list[1]);
}
}
-
- return $ip;
}
--- 260,266 ----
{
$private_ip = array('#^0\.#', '#^127\.0\.0\.1#', '#^192\.168\.#', '#^172\.16\.#', '#^10\.#', '#^224\.#', '#^240\.#');
! $this->ip = preg_replace($private_ip, $this->ip, $ip_list[1]);
}
}
}
|
|
From: Brian R. <hei...@us...> - 2003-09-22 10:23:31
|
Update of /cvsroot/phpmp/phpMP/core
In directory sc8-pr-cvs1:/tmp/cvs-serv22470/core
Modified Files:
sessions.php
Log Message:
Another oops.
Index: sessions.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/sessions.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** sessions.php 22 Sep 2003 10:13:06 -0000 1.4
--- sessions.php 22 Sep 2003 10:23:27 -0000 1.5
***************
*** 252,256 ****
function _sess_ip_encoded()
{
! $this->ip = $_SERVER['REMOTE_ADDR'];
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
--- 252,256 ----
function _sess_ip_encoded()
{
! $ip = $_SERVER['REMOTE_ADDR'];
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
***************
*** 259,265 ****
{
$private_ip = array('#^0\.#', '#^127\.0\.0\.1#', '#^192\.168\.#', '#^172\.16\.#', '#^10\.#', '#^224\.#', '#^240\.#');
! $this->ip = preg_replace($private_ip, $this->ip, $ip_list[1]);
}
}
}
--- 259,267 ----
{
$private_ip = array('#^0\.#', '#^127\.0\.0\.1#', '#^192\.168\.#', '#^172\.16\.#', '#^10\.#', '#^224\.#', '#^240\.#');
! $ip = preg_replace($private_ip, $ip, $ip_list[1]);
}
}
+
+ return $ip;
}
|
|
From: Brian R. <hei...@us...> - 2003-09-22 10:13:10
|
Update of /cvsroot/phpmp/phpMP/core
In directory sc8-pr-cvs1:/tmp/cvs-serv21057/core
Modified Files:
sessions.php
Log Message:
Oops.
Index: sessions.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/sessions.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** sessions.php 22 Sep 2003 10:04:04 -0000 1.3
--- sessions.php 22 Sep 2003 10:13:06 -0000 1.4
***************
*** 33,37 ****
function sess_start($create=true)
{
-
if(!$this->_started)
{
--- 33,36 ----
***************
*** 176,179 ****
--- 175,179 ----
else
{
+ setcookie($Portal->cfg_get('cookie_name') . '_data', '', time() - 31536000, $Portal->cfg_get('cookie_path'), $Portal->cfg_get('cookie_domain'), $Portal->cfg_get('cookie_secure'));
// Trigger invalid session error.
die('Invalid session. Please try again.');
|
|
From: Brian R. <hei...@us...> - 2003-09-22 10:05:14
|
Update of /cvsroot/phpmp/phpMP/core
In directory sc8-pr-cvs1:/tmp/cvs-serv19751/core
Modified Files:
main.php
Log Message:
I am such an idiot. Especially at 4am when I have class at 9am.
Index: main.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/main.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** main.php 22 Sep 2003 09:52:28 -0000 1.12
--- main.php 22 Sep 2003 10:05:10 -0000 1.13
***************
*** 107,113 ****
//create_vars();
- $Session->start();
- $Session->run();
-
$cfg_lang = $this->cfg_get('default_lang');
$usr_lang = $User->get('language');
--- 107,110 ----
|
|
From: Brian R. <hei...@us...> - 2003-09-22 10:04:08
|
Update of /cvsroot/phpmp/phpMP/core
In directory sc8-pr-cvs1:/tmp/cvs-serv19427/core
Modified Files:
sessions.php
Log Message:
Try #3.
Index: sessions.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/sessions.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** sessions.php 22 Sep 2003 10:00:01 -0000 1.2
--- sessions.php 22 Sep 2003 10:04:04 -0000 1.3
***************
*** 204,210 ****
}
! $cookie_data = urlencode( $this->user_id . ':' . $this->_sess_key );
! (setcookie($Portal->cfg_get('cookie_name') . '_data', $cookie_data, $cur_time + $Portal->cfg_get('session_length'), $Portal->cfg_get('cookie_path'), $Portal->cfg_get('cookie_domain'), $Portal->cfg_get('cookie_secure'))) ? ($SID = "?sid=") : ($SID = "?sid=" . $this->_sess_key);
! $this->clean();
}
--- 204,210 ----
}
! $cookie_data = urlencode( $user_id . ':' . $this->_sess_key );
! (setcookie($Portal->cfg_get('cookie_name') . '_data', $cookie_data, $time + $Portal->cfg_get('session_length'), $Portal->cfg_get('cookie_path'), $Portal->cfg_get('cookie_domain'), $Portal->cfg_get('cookie_secure'))) ? ($SID = "?sid=") : ($SID = "?sid=" . $this->_sess_key);
! $this->sess_clean();
}
|
|
From: Brian R. <hei...@us...> - 2003-09-22 10:01:26
|
Update of /cvsroot/phpmp/phpMP In directory sc8-pr-cvs1:/tmp/cvs-serv18780 Modified Files: config.php Log Message: Index: config.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/config.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** config.php 22 Sep 2003 09:59:27 -0000 1.8 --- config.php 22 Sep 2003 10:01:21 -0000 1.9 *************** *** 1,20 **** - <?php - - ## DO NOT ALTER THIS FILE. - ## This file is automatically generated - ## by the phpMP install script. Do not - ## alter this file if you don't know - ## what you're doing. - - define( "PHPMP_INSTALLED", TRUE ); - - $dbinfo = array( - 'type' => 'mysql', - 'host' => 'localhost', - 'name' => 'phpmp_general', - 'prefix'=> 'phpmp_', - 'user' => 'phpmp', - 'passwd'=> 'f1r3m4n' - ); - - ?> --- 0 ---- |
|
From: Brian R. <hei...@us...> - 2003-09-22 10:00:05
|
Update of /cvsroot/phpmp/phpMP/core
In directory sc8-pr-cvs1:/tmp/cvs-serv18386/core
Modified Files:
sessions.php
Log Message:
Try #2.
Index: sessions.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/sessions.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** sessions.php 22 Sep 2003 09:52:28 -0000 1.1
--- sessions.php 22 Sep 2003 10:00:01 -0000 1.2
***************
*** 66,69 ****
--- 66,70 ----
$ip = $this->_sess_ip_encoded();
$session_exists = false;
+ $user_id = false;
if(!$this->_logged_in)
***************
*** 80,84 ****
////////////////////////////////////////////
! if($_COOKIE[$Portal->cfg_get('cookie_name') . '_data'])
{
$cookie_data = $_COOKIE[$Portal->cfg_get('cookie_name') . '_data'];
--- 81,85 ----
////////////////////////////////////////////
! if(!empty($_COOKIE[$Portal->cfg_get('cookie_name') . '_data']))
{
$cookie_data = $_COOKIE[$Portal->cfg_get('cookie_name') . '_data'];
***************
*** 154,158 ****
$this->_data['session_key'] = $this->_sess_key;
$this->_data['session_user_id'] = $user_id;
! $this->_data['session_start_time'] = $exp_time;
$this->_data['session_ip'] = $ip;
}
--- 155,160 ----
$this->_data['session_key'] = $this->_sess_key;
$this->_data['session_user_id'] = $user_id;
! $this->_data['session_start_time'] = $time;
! $this->_data['session_exp_time'] = $exp_time;
$this->_data['session_ip'] = $ip;
}
***************
*** 197,201 ****
$sql = "UPDATE " . DB_SESSIONS_TABLE . " SET
session_exp_time=" . $exp_time . " WHERE
! session_key=" . $this->_sess_key;
$result = $DB->sql_query($sql);
--- 199,203 ----
$sql = "UPDATE " . DB_SESSIONS_TABLE . " SET
session_exp_time=" . $exp_time . " WHERE
! session_key='" . $this->_sess_key . "'";
$result = $DB->sql_query($sql);
|
|
From: Brian R. <hei...@us...> - 2003-09-22 09:59:30
|
Update of /cvsroot/phpmp/phpMP In directory sc8-pr-cvs1:/tmp/cvs-serv18225 Modified Files: config.php Log Message: Try #2. Index: config.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/config.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** config.php 30 Jun 2003 01:44:06 -0000 1.7 --- config.php 22 Sep 2003 09:59:27 -0000 1.8 *************** *** 0 **** --- 1,20 ---- + <?php + + ## DO NOT ALTER THIS FILE. + ## This file is automatically generated + ## by the phpMP install script. Do not + ## alter this file if you don't know + ## what you're doing. + + define( "PHPMP_INSTALLED", TRUE ); + + $dbinfo = array( + 'type' => 'mysql', + 'host' => 'localhost', + 'name' => 'phpmp_general', + 'prefix'=> 'phpmp_', + 'user' => 'phpmp', + 'passwd'=> 'f1r3m4n' + ); + + ?> |
|
From: Brian R. <hei...@us...> - 2003-09-22 09:53:06
|
Update of /cvsroot/phpmp/phpMP/core
In directory sc8-pr-cvs1:/tmp/cvs-serv16164/core
Modified Files:
main.php user.php
Added Files:
sessions.php
Removed Files:
session.php
Log Message:
Drastic rewrite of session.php (now sessions.php). We'll see how it goes.
--- NEW FILE: sessions.php ---
<?php
/*
* phpMP - The PHP Modular Portal System
* Copyright (C) 2002-2003 Brian Rose and the phpMP group
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id: sessions.php,v 1.1 2003/09/22 09:52:28 heimidal Exp $
*
*/
class Session
{
var $_started = false;
var $_logged_in = false;
var $_session_exists = false;
var $_sess_key = false;
function sess_start($create=true)
{
if(!$this->_started)
{
if( isset($_POST['login_user']) && isset($_POST['login_password']) )
{
$this->_sess_do_login($_POST['login_user'], $_POST['login_password'], $_POST['login_auto'], $POST['login_invisible']);
}
$this->_started = true;
}
if($create)
{
$this->sess_create();
}
}
function sess_create()
{
global $DB, $Portal, $SID;
if(!$this->_started)
{
//In the future, die with a trigger_error.
die('Sessions must be started explicitly.');
}
$time = time();
$exp_time = $time + $Portal->cfg_get('session_length');
$ip = $this->_sess_ip_encoded();
$session_exists = false;
if(!$this->_logged_in)
{
////////////////////////////////////////////
// The following code tests for
// a valid cookie that may or may not
// exist.
//
// If a session is found, we will
// continue to use it. If none is found,
// we will go ahead and create one.
////////////////////////////////////////////
if($_COOKIE[$Portal->cfg_get('cookie_name') . '_data'])
{
$cookie_data = $_COOKIE[$Portal->cfg_get('cookie_name') . '_data'];
$cookie_array = explode(':', urldecode($cookie_data) );
if( ( !empty($cookie_array[0]) ) && ( strlen($cookie_array[1]) == 32 ) )
{
$user_id = $cookie_array[0];
$this->_sess_key = $cookie_array[1];
}
}
elseif(!empty($_GET['sid']))
{
$this->_sess_key = $_GET['sid'];
}
if( !$user_id )
{
if( !empty( $_COOKIE[$Portal->cfg_get('cookie_name') . '_auto'] ) )
{
$cookie_data = $_COOKIE[$Portal->cfg_get('cookie_name') . '_auto'];
$cookie_array = explode(':', urldecode($cookie_data) );
$sql = "SELECT * FROM " . DB_USERS_TABLE . "
WHERE user_id=" . $cookie_array[0] . "
AND password='" . $cookie_array[1] . "'";
$result = $DB->sql_query($sql);
if($DB->sql_num_rows($result))
{
$this->_data = $DB->sql_fetch_row($result);
$this->_data['invisible_mode'] = $cookie_array[2];
$user_id = $cookie_array[0];
$this->_logged_in = true;
}
else
{
setcookie($Portal->cfg_get('cookie_name') . '_auto', '', time() - 31536000, $Portal->cfg_get('cookie_path'), $Portal->cfg_get('cookie_domain'), $Portal->cfg_get('cookie_secure'));
$user_id = ANONYMOUS;
$this->_logged_in = false;
}
}
else
{
$user_id = ANONYMOUS;
$this->_logged_in = false;
}
}
}
else
{
$user_id = $this->_data['user_id'];
}
////////////////////////////////////////////
// If we have reached this point,
// the $user_id variable has been set.
// Either the user has logged in or
// they have a user_id of ANONYMOUS.
////////////////////////////////////////////
if(empty($this->_sess_key))
{
$this->_sess_key = md5( uniqid (microtime(), 1) );
$sql = "INSERT INTO " . DB_SESSIONS_TABLE . "
(session_key, session_user_id, session_start_time, session_exp_time, session_ip)
VALUES('" . $this->_sess_key . "', " . $user_id . ", " . $time . ", " . $exp_time . ", '" . $ip . "')";
$result = $DB->sql_query($sql);
$this->_data['session_key'] = $this->_sess_key;
$this->_data['session_user_id'] = $user_id;
$this->_data['session_start_time'] = $exp_time;
$this->_data['session_ip'] = $ip;
}
else
{
$sql = "SELECT * FROM " . DB_USERS_TABLE . " u, " . DB_SESSIONS_TABLE . " s
WHERE s.session_key='" . $this->_sess_key . "'
AND s.session_exp_time>" . $time . "
AND s.session_user_id=u.user_id
LIMIT 1";
$result = $DB->sql_query($sql);
if($DB->sql_num_rows($result))
{
$this->_data = $DB->sql_fetch_row($result);
($user_id == ANONYMOUS) ? ($this->_logged_in = false) : ($this->_logged_in = true);
}
else
{
// Trigger invalid session error.
die('Invalid session. Please try again.');
}
}
////////////////////////////////////////////////////////
// The next if() statement is a bit confusing.
// If the session will expire in less than 1/3
// of the session_length, we'll update it.
//
// EXAMPLES
// session_length=30, time to expire is 7 minutes.
// This session would be updated.
//
// session_length=30, time to expire is 11 minutes.
// This session would not be updated.
////////////////////////////////////////////////////////
if( ($this->_data['session_exp_time'] - $time) < ($Portal->cfg_get('session_length') * .33333) )
{
$sql = "UPDATE " . DB_SESSIONS_TABLE . " SET
session_exp_time=" . $exp_time . " WHERE
session_key=" . $this->_sess_key;
$result = $DB->sql_query($sql);
}
$cookie_data = urlencode( $this->user_id . ':' . $this->_sess_key );
(setcookie($Portal->cfg_get('cookie_name') . '_data', $cookie_data, $cur_time + $Portal->cfg_get('session_length'), $Portal->cfg_get('cookie_path'), $Portal->cfg_get('cookie_domain'), $Portal->cfg_get('cookie_secure'))) ? ($SID = "?sid=") : ($SID = "?sid=" . $this->_sess_key);
$this->clean();
}
function _sess_do_login($username, $password, $autologin=0, $invisible_mode=0)
{
global $DB, $Portal;
$username = addslashes($username);
$enc_password = md5($password);
$sql = "SELECT * FROM " . DB_USERS_TABLE . "
WHERE user_name='$username' AND password='$enc_password'";
$result = $DB->sql_query($sql);
if($DB->sql_num_rows($result))
{
$this->_data = $DB->sql_fetch_row($result); // _data is a variable that exists in the User class.
$this->_logged_in = true;
$user_id = $this->_data['user_id'];
$this->_data['invisible_mode'] = $invisible_mode;
if($autologin)
{
$cookie_data = urlencode( $user_id . ':' . $passwd_enc . ':' . $invisible_mode );
setcookie($Portal->cfg_get('cookie_name') . '_auto', $cookie_data, time() + 31536000, $Portal->cfg_get('cookie_path'), $Portal->cfg_get('cookie_domain'), $Portal->cfg_get('cookie_secure'));
}
}
else
{
// Trigger error concerning invalid username/password.
// The following is temporary.
die('Your username/password are incorrect.');
}
}
/**
* @return void
* @desc Fetches the user's IP in hex-encoded form.
* Taken from phpBB2.
*/
function _sess_ip_encoded()
{
$this->ip = $_SERVER['REMOTE_ADDR'];
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
if (preg_match('#^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)#', $_SERVER['HTTP_X_FORWARDED_FOR'], $ip_list))
{
$private_ip = array('#^0\.#', '#^127\.0\.0\.1#', '#^192\.168\.#', '#^172\.16\.#', '#^10\.#', '#^224\.#', '#^240\.#');
$this->ip = preg_replace($private_ip, $this->ip, $ip_list[1]);
}
}
}
/**
* @return string
* @param encoded_ip string
* @desc Decodes a hexed IP.
* Taken from phpBB2.
*/
function _sess_decode_ip($encoded_ip)
{
$hexipbang = explode('.', chunk_split($encoded_ip, 2, '.'));
return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]);
}
function sess_clean($all = false)
{
global $DB, $SID;
// 1:10 chance of session cleanup. This may later become a setting.
$rand = rand(0,10);
if(($rand <= 1) || $all)
{
$sql = "DELETE FROM " . DB_SESSIONS_TABLE . " WHERE session_exp_time<" . time();
$DB->sql_query($sql);
}
}
}
?>
Index: main.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/main.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** main.php 15 Sep 2003 07:26:06 -0000 1.11
--- main.php 22 Sep 2003 09:52:28 -0000 1.12
***************
*** 99,109 ****
include_once(C_PHPMP_ROOT . CORE_DIR . 'functions.php');
include_once(C_PHPMP_ROOT . CORE_DIR . 'user.php');
$User = new User(); // Create an instance of User.
//create_vars();
-
- include_once(C_PHPMP_ROOT . CORE_DIR . 'session.php');
- $Session = new Session();
$Session->start();
--- 99,109 ----
include_once(C_PHPMP_ROOT . CORE_DIR . 'functions.php');
+ include_once(C_PHPMP_ROOT . CORE_DIR . 'sessions.php');
include_once(C_PHPMP_ROOT . CORE_DIR . 'user.php');
$User = new User(); // Create an instance of User.
+
+ $User->sess_start();
//create_vars();
$Session->start();
Index: user.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/user.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** user.php 15 Sep 2003 06:40:24 -0000 1.3
--- user.php 22 Sep 2003 09:52:28 -0000 1.4
***************
*** 23,27 ****
*/
! class User
{
--- 23,27 ----
*/
! class User extends Session
{
***************
*** 75,108 ****
}
- /**
- * @return void
- * @desc Fetches the user's IP in hex-encoded form.
- * Taken from phpBB2.
- */
- function get_ip_encoded()
- {
- $this->ip = $_SERVER['REMOTE_ADDR'];
-
- if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
- {
- if (preg_match('#^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)#', $_SERVER['HTTP_X_FORWARDED_FOR'], $ip_list))
- {
- $private_ip = array('#^0\.#', '#^127\.0\.0\.1#', '#^192\.168\.#', '#^172\.16\.#', '#^10\.#', '#^224\.#', '#^240\.#');
- $this->ip = preg_replace($private_ip, $this->ip, $ip_list[1]);
- }
- }
- }
-
- /**
- * @return string
- * @param encoded_ip string
- * @desc Decodes a hexed IP.
- * Taken from phpBB2.
- */
- function decode_ip($encoded_ip)
- {
- $hexipbang = explode('.', chunk_split($encoded_ip, 2, '.'));
- return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]);
- }
}
--- 75,78 ----
--- session.php DELETED ---
|
|
From: Cameron C. <nor...@us...> - 2003-09-17 03:02:47
|
Update of /cvsroot/phpmp/phpMP/core/dba
In directory sc8-pr-cvs1:/tmp/cvs-serv7215/core/dba
Modified Files:
mysql.php
Log Message:
added some more functions, and hopefully got them all... if not I blame Adam.
Index: mysql.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/dba/mysql.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** mysql.php 16 Sep 2003 01:05:21 -0000 1.10
--- mysql.php 17 Sep 2003 03:02:42 -0000 1.11
***************
*** 253,259 ****
}
! if(! $result = @mysql_num_fields($db_connect_id))
{
return $return;
}
else
--- 253,380 ----
}
! if( $result = @mysql_num_fields($db_connect_id))
{
return $return;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ //
+ // sql_field_name
+ //
+ function sql_field_name($db_query_id = 0, $field_offset)
+ {
+ if(! $db_query_id)
+ {
+ $db_query_id = $this->db_query_result;
+ }
+
+ if( $result = @mysql_fielf_name($db_query_id, $field_offset))
+ {
+ return $result;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ //
+ // sql_field_type
+ //
+ function sql_field_type($db_query_id = 0, $field_offset)
+ {
+ if(! $db_query_id)
+ {
+ $db_query_id = $this->db_query_result;
+ }
+
+ if( $result = @mysql_field_type($db_query_id, $field_offset))
+ {
+ return $result;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ //
+ // sql_fetch_field
+ //
+ function sql_fetch_field($db_query_id = 0, $field_row = -1, $field_name)
+ {
+ if(! $db_query_id)
+ {
+ $db_query_id = $this->db_query_result;
+ }
+
+ if( $field_row > -1)
+ {
+ $result = @mysql_fetch_field($db_query_id, $field_row, $field_name);
+ }
+ else
+ {
+ if( empty($this->db_row[$db_query_id]) && empty($this->db_rowset[$db_query_id]))
+ {
+ if( $this->sql_fetch_row($db_query_id))
+ {
+ $result = $this->db_row[$query_id][$field_name];
+ }
+ }
+ else
+ {
+ if( $this->db_rowset[$db_query_id])
+ {
+ $result = $this->db_rowset[$db_query_id][$field_name];
+ }
+ else if( $this->db_row[$db_query_id])
+ {
+ $result = $this->db_row[$query_id][$field_name];
+ }
+ }
+ }
+
+ return $result;
+ }
+
+ //
+ // sql_affected_rows
+ //
+ function sql_affected_rows()
+ {
+ if( $this->db_connection_id)
+ {
+ if( $result = @mysql_affected_rows($this->db_connection_id))
+ {
+ return $result;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ //
+ // sql_row_seek
+ //
+ function sql_row_seek($db_query_id = 0, $row)
+ {
+ if(! $db_query_id)
+ {
+ $db_query_id = $this->db_query_result;
+ }
+
+ if( $result = @mysql_row_seek($db_query_id, $row))
+ {
+ return $result;
}
else
|
|
From: Cameron C. <nor...@us...> - 2003-09-16 01:05:25
|
Update of /cvsroot/phpmp/phpMP/core/dba
In directory sc8-pr-cvs1:/tmp/cvs-serv18935
Modified Files:
mysql.php
Log Message:
eh.. yeah new stuff to play with.
Index: mysql.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/dba/mysql.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** mysql.php 15 Sep 2003 07:26:06 -0000 1.9
--- mysql.php 16 Sep 2003 01:05:21 -0000 1.10
***************
*** 22,25 ****
--- 22,29 ----
*/
+ //
+ // some parts of this file based upon code in phpBB 2.0.6
+ //
+
class sql_db
{
***************
*** 155,159 ****
//
// sql_fetch_rowset
! //
function sql_fetch_rowset($db_query_id = 0)
{
--- 159,163 ----
//
// sql_fetch_rowset
! //
function sql_fetch_rowset($db_query_id = 0)
{
***************
*** 176,180 ****
//
// sql_num_rows
- // probably needs editing...
//
function sql_num_rows($db_query_id = 0)
--- 180,183 ----
***************
*** 233,236 ****
--- 236,259 ----
{
return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ //
+ // sql_num_fields
+ //
+ function sql_num_fields($db_query_id = 0)
+ {
+ if(! $db_query_id)
+ {
+ $db_query_id = $this->db_query_result;
+ }
+
+ if(! $result = @mysql_num_fields($db_connect_id))
+ {
+ return $return;
}
else
|
|
From: Brian R. <hei...@us...> - 2003-09-15 07:32:24
|
Update of /cvsroot/phpmp/phpMP/admin In directory sc8-pr-cvs1:/tmp/cvs-serv17846/admin Added Files: index.html Log Message: Committing index.html as placeholder. |
|
From: Brian R. <hei...@us...> - 2003-09-15 07:31:33
|
Update of /cvsroot/phpmp/phpMP/core
In directory sc8-pr-cvs1:/tmp/cvs-serv17615/core
Modified Files:
debug.php session.php
Log Message:
Finally fixed the tempate issue.
Index: debug.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/debug.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** debug.php 14 Sep 2003 09:24:25 -0000 1.3
--- debug.php 15 Sep 2003 07:31:30 -0000 1.4
***************
*** 26,32 ****
{
! /**
! * @return void
! * @desc Sets the error handler.
*/
function Debug()
--- 26,32 ----
{
! /**
! * @return void
! * @desc Sets the error handler.
*/
function Debug()
***************
*** 35,46 ****
}
! /**
* @return void
* @param errno int
* @param msg_text string
* @param errfile string
! * @param errline int
* @desc Error/message handler. Taken from phpBB2.
! I still don't quite understand it. :P
*/
function msg_display($errno, $msg_text, $errfile, $errline)
--- 35,46 ----
}
! /**
* @return void
* @param errno int
* @param msg_text string
* @param errfile string
! * @param errline int
* @desc Error/message handler. Taken from phpBB2.
! I still don't quite understand it. :P
*/
function msg_display($errno, $msg_text, $errfile, $errline)
***************
*** 60,64 ****
if(isset($DB))
{
! $DB->close();
echo $msg_text;
}
--- 60,64 ----
if(isset($DB))
{
! $DB->sql_close();
echo $msg_text;
}
Index: session.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/session.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** session.php 15 Sep 2003 07:26:06 -0000 1.6
--- session.php 15 Sep 2003 07:31:30 -0000 1.7
***************
*** 70,74 ****
WHERE session_key='" . $this->session_key . "'";
! $DB->query($sql);
$this->session_user_id = ANONYMOUS;
--- 70,74 ----
WHERE session_key='" . $this->session_key . "'";
! $DB->sql_query($sql);
$this->session_user_id = ANONYMOUS;
***************
*** 100,109 ****
AND user_passwd='" . $passwd_enc . "'";
! $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;
--- 100,109 ----
AND user_passwd='" . $passwd_enc . "'";
! $result = $DB->sql_query($sql);
! $num_rows = $DB->sql_num_rows($result);
if( $num_rows == 1 ) // We have a user!
{
! $User->set( $DB->sql_fetch_row($result) );
$this->session_user_id = $User->get('user_id');
$this->is_logged_in = true;
***************
*** 243,247 ****
{
$sql = "DELETE FROM " . DB_SESSIONS_TABLE . " WHERE session_user_id=" . $this->session_user_id . " AND session_key!='" . $this->session_key . "'";
! $DB->query($sql);
}
}
--- 243,247 ----
{
$sql = "DELETE FROM " . DB_SESSIONS_TABLE . " WHERE session_user_id=" . $this->session_user_id . " AND session_key!='" . $this->session_key . "'";
! $DB->sql_query($sql);
}
}
***************
*** 293,302 ****
AND user_passwd='" . $auto_cookie_array[1] . "'";
! $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];
--- 293,302 ----
AND user_passwd='" . $auto_cookie_array[1] . "'";
! $result = $DB->sql_query($sql);
! $num_rows = $DB->sql_num_rows($result);
if( $num_rows == 1 ) // This cookie is valid.
{
! $User->set( $DB->sql_fetch_row($result) );
$User->set('invisible_mode', $auto_cookie_array[2]);
$this->session_user_id = $auto_cookie_array[0];
|
|
From: Brian R. <hei...@us...> - 2003-09-15 07:31:17
|
Update of /cvsroot/phpmp/phpMP/admin In directory sc8-pr-cvs1:/tmp/cvs-serv17549 Removed Files: index.php main.php nav.php Log Message: Clutter-B-Gone! --- index.php DELETED --- --- main.php DELETED --- --- nav.php DELETED --- |
|
From: Brian R. <hei...@us...> - 2003-09-15 07:26:12
|
Update of /cvsroot/phpmp/phpMP/core
In directory sc8-pr-cvs1:/tmp/cvs-serv16331/core
Modified Files:
main.php session.php
Log Message:
Template fix.
Index: main.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/main.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** main.php 15 Sep 2003 06:53:55 -0000 1.10
--- main.php 15 Sep 2003 07:26:06 -0000 1.11
***************
*** 131,135 ****
$Template = new Template();
! if( $User->get('template') == false )
{
$this->cfg_set('template', $this->cfg_get('default_tpl'));
--- 131,135 ----
$Template = new Template();
! if( $User->get('template') == '' )
{
$this->cfg_set('template', $this->cfg_get('default_tpl'));
Index: session.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/session.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** session.php 15 Sep 2003 06:40:24 -0000 1.5
--- session.php 15 Sep 2003 07:26:06 -0000 1.6
***************
*** 162,174 ****
ORDER BY session_exp_time DESC";
! $result = $DB->query($sql);
! $num_rows = $DB->num_rows($result);
// Checks for a session in the database.
! ($num_rows >= 1) ? ($session_exists = true) : ($session_exists = false);
// 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 )
{
--- 162,174 ----
ORDER BY session_exp_time DESC";
! $result = $DB->sql_query($sql);
! $num_rows = $DB->sql_num_rows($result);
// Checks for a session in the database.
! ($num_rows == 1) ? ($session_exists = true) : ($session_exists = false);
// 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->sql_fetch_row($result);
if( $this->session_data['session_exp_time'] < $cur_time )
{
|
|
From: Brian R. <hei...@us...> - 2003-09-15 07:26:12
|
Update of /cvsroot/phpmp/phpMP/core/dba
In directory sc8-pr-cvs1:/tmp/cvs-serv16331/core/dba
Modified Files:
mysql.php
Log Message:
Template fix.
Index: mysql.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/dba/mysql.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** mysql.php 15 Sep 2003 06:53:55 -0000 1.8
--- mysql.php 15 Sep 2003 07:26:06 -0000 1.9
***************
*** 173,177 ****
--- 173,198 ----
return $rowset;
}
+
+ //
+ // sql_num_rows
+ // probably needs editing...
+ //
+ function sql_num_rows($db_query_id = 0)
+ {
+ if(! $db_query_id)
+ {
+ $db_query_id = $this->db_query_result;
+ }
+ if( $this->db_row[$db_query_id] = @mysql_num_rows($db_query_id))
+ {
+ return $this->db_row[$db_query_id];
+ }
+ else
+ {
+ return false;
+ }
+ }
+
//
// sql_insert_id
|
|
From: Brian R. <hei...@us...> - 2003-09-15 07:26:09
|
Update of /cvsroot/phpmp/phpMP
In directory sc8-pr-cvs1:/tmp/cvs-serv16331
Modified Files:
directories.php
Log Message:
Template fix.
Index: directories.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/directories.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** directories.php 15 Sep 2003 06:40:24 -0000 1.3
--- directories.php 15 Sep 2003 07:26:06 -0000 1.4
***************
*** 38,42 ****
define('TEMPLATES_DIR', 'templates/');
// Template Cache Directory
! define('CACHE_DIR', 'template_cache/');
?>
--- 38,42 ----
define('TEMPLATES_DIR', 'templates/');
// Template Cache Directory
! define('CACHE_DIR', 'templates_cache/');
?>
|
|
From: Brian R. <hei...@us...> - 2003-09-15 07:05:46
|
Update of /cvsroot/phpmp/phpMP/core
In directory sc8-pr-cvs1:/tmp/cvs-serv9608/core
Modified Files:
template.php
Log Message:
Template fix.
Index: template.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/template.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** template.php 15 Sep 2003 06:58:19 -0000 1.6
--- template.php 15 Sep 2003 07:05:40 -0000 1.7
***************
*** 393,407 ****
// This will handle the remaining root-level varrefs
! if (!$this->static_lang)
! {
! global $User;
! $text_blocks = preg_replace('#\{L_([a-z0-9\-_]*?)\}#is', "<?php echo ((isset(\$this->_tpldata['.'][0]['L_\\1'])) ? \$this->_tpldata['.'][0]['L_\\1'] : ((isset(\$User->lang['\\1'])) ? \$User->lang['\\1'] : ucfirst(strtolower(str_replace('_', ' ', '\\1'))))); ?>", $text_blocks);
! }
! else
! {
! global $User;
! $text_blocks = preg_replace('#\{L_([A-Z0-9\-_]*?)\}#e', "'<?php echo ((isset(\$this->_tpldata[\'.\'][0][\'L_\\1\'])) ? \$this->_tpldata[\'.\'][0][\'L_\\1\'] : \'' . ((isset(\$User->lang['\\1'])) ? \$User->lang['\\1'] : '') . '\'); ?>'" , $text_blocks);
! }
$text_blocks = preg_replace('#\{([a-z0-9\-_]*?)\}#is', "<?php echo \$this->_tpldata['.'][0]['\\1']; ?>", $text_blocks);
--- 393,399 ----
// This will handle the remaining root-level varrefs
! global $User;
! $text_blocks = preg_replace('#\{L_([A-Z0-9\-_]*?)\}#e', "'<?php echo ((isset(\$this->_tpldata[\'.\'][0][\'L_\\1\'])) ? \$this->_tpldata[\'.\'][0][\'L_\\1\'] : \'' . ((isset(\$User->lang['\\1'])) ? \$User->lang['\\1'] : '') . '\'); ?>'" , $text_blocks);
$text_blocks = preg_replace('#\{([a-z0-9\-_]*?)\}#is', "<?php echo \$this->_tpldata['.'][0]['\\1']; ?>", $text_blocks);
|
|
From: Brian R. <hei...@us...> - 2003-09-15 06:58:22
|
Update of /cvsroot/phpmp/phpMP/core
In directory sc8-pr-cvs1:/tmp/cvs-serv8056/core
Modified Files:
template.php
Log Message:
Template fix.
Index: template.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/template.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** template.php 15 Sep 2003 06:40:24 -0000 1.5
--- template.php 15 Sep 2003 06:58:19 -0000 1.6
***************
*** 396,400 ****
{
global $User;
! $text_blocks = preg_replace('#\{L_([a-z0-9\-_]*?)\}#is', "<?php echo ((isset(\$this->_tpldata['.'][0]['L_\\1'])) ? \$this->_tpldata['.'][0]['L_\\1'] : ((isset(\$User->lang['\\1'])) ? \$User->lang['\\1'] : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }')); ?>", $text_blocks);
}
else
--- 396,400 ----
{
global $User;
! $text_blocks = preg_replace('#\{L_([a-z0-9\-_]*?)\}#is', "<?php echo ((isset(\$this->_tpldata['.'][0]['L_\\1'])) ? \$this->_tpldata['.'][0]['L_\\1'] : ((isset(\$User->lang['\\1'])) ? \$User->lang['\\1'] : ucfirst(strtolower(str_replace('_', ' ', '\\1'))))); ?>", $text_blocks);
}
else
|
|
From: Brian R. <hei...@us...> - 2003-09-15 06:54:02
|
Update of /cvsroot/phpmp/phpMP/core
In directory sc8-pr-cvs1:/tmp/cvs-serv7074/core
Modified Files:
main.php
Log Message:
A few more minor updates.
Index: main.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/main.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** main.php 15 Sep 2003 06:40:24 -0000 1.9
--- main.php 15 Sep 2003 06:53:55 -0000 1.10
***************
*** 76,81 ****
include_once(C_PHPMP_ROOT . CORE_DIR . 'constants.php');
-
- if(DEBUG_ON) { echo "Included constants.php.<br>\n"; }
// Globalize all major class-containing variables.
--- 76,79 ----
|
|
From: Brian R. <hei...@us...> - 2003-09-15 06:54:02
|
Update of /cvsroot/phpmp/phpMP/core/dba
In directory sc8-pr-cvs1:/tmp/cvs-serv7074/core/dba
Modified Files:
mysql.php
Log Message:
A few more minor updates.
Index: mysql.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/dba/mysql.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** mysql.php 15 Sep 2003 06:40:24 -0000 1.7
--- mysql.php 15 Sep 2003 06:53:55 -0000 1.8
***************
*** 54,58 ****
{
return false;
- if(DEBUG_ON) { echo "Could not connect to database.<br>\n"; }
}
else
--- 54,57 ----
***************
*** 67,71 ****
}
}
- if(DEBUG_ON) { echo "Successfully connected to the DB.<br>\n"; }
return $this->db_connection_id;
}
--- 66,69 ----
|
|
From: Brian R. <hei...@us...> - 2003-09-15 06:40:59
|
Update of /cvsroot/phpmp/phpMP In directory sc8-pr-cvs1:/tmp/cvs-serv3465 Modified Files: directories.php index.php Log Message: A few bug fixes and resolved integration issues. Index: directories.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/directories.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** directories.php 14 Sep 2003 21:26:07 -0000 1.2 --- directories.php 15 Sep 2003 06:40:24 -0000 1.3 *************** *** 1,3 **** ! T<?php /* --- 1,3 ---- ! <?php /* Index: index.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/index.php,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -r1.53 -r1.54 *** index.php 14 Sep 2003 21:55:51 -0000 1.53 --- index.php 15 Sep 2003 06:40:24 -0000 1.54 *************** *** 26,30 **** --- 26,32 ---- include_once( C_PHPMP_ROOT . 'directories.php' ); include_once( C_PHPMP_ROOT . CORE_DIR .'main.php' ); + $Portal = new Portal(); + $Portal->init(); global $Template; |
|
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']))
|
|
From: Brian R. <hei...@us...> - 2003-09-15 06:40:59
|
Update of /cvsroot/phpmp/phpMP/core/dba
In directory sc8-pr-cvs1:/tmp/cvs-serv3465/core/dba
Modified Files:
mysql.php
Log Message:
A few bug fixes and resolved integration issues.
Index: mysql.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/core/dba/mysql.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** mysql.php 15 Sep 2003 03:13:52 -0000 1.6
--- mysql.php 15 Sep 2003 06:40:24 -0000 1.7
***************
*** 54,57 ****
--- 54,58 ----
{
return false;
+ if(DEBUG_ON) { echo "Could not connect to database.<br>\n"; }
}
else
***************
*** 66,69 ****
--- 67,71 ----
}
}
+ if(DEBUG_ON) { echo "Successfully connected to the DB.<br>\n"; }
return $this->db_connection_id;
}
|
|
From: Brian R. <hei...@us...> - 2003-09-15 05:30:00
|
Update of /cvsroot/phpmp/phpMP/core In directory sc8-pr-cvs1:/tmp/cvs-serv22579/core Modified Files: main.php Log Message: Stupid me. Index: main.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/core/main.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** main.php 14 Sep 2003 22:11:04 -0000 1.7 --- main.php 15 Sep 2003 05:29:54 -0000 1.8 *************** *** 81,85 **** include_once( C_PHPMP_ROOT . CORE_DIR . 'dba/' . $dbinfo['type'] . '.php' ); ! $DB = new sql_db($dbinfo['type'], $dbinfo['user'], $dbinfo['pass'], $dbinfo['name'], false); $DB->connect(); --- 81,85 ---- 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(); |