Version 2.1.7

This commit is contained in:
Neo committed 2025-12-19 00:21:15 -08:00
1 parent 0eecc172d9
commit f73f8bff6d
941 files changed
+215301 -103093

No files matched your search

+88 -170
View File
@@ -2,17 +2,24 @@
/*
+--------------------------------------------------------------------------
| Invision Power Board v2.0.0
| ========================================
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2003 Invision Power Services
| (c) 2001 - 2005 Invision Power Services, Inc.
| http://www.invisionpower.com
| ========================================
| =============================================
| Web: http://www.invisionboard.com
| Time: Tue, 21 Sep 2004 16:34:28 GMT
| Release: 150aa7a702c3c8b6f6eb90ad49305d2f
| Email: matt@invisionpower.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
|
| > IPB CHAT 2004 INTEGRATION
@@ -23,84 +30,42 @@
+--------------------------------------------------------------------------
*/
//-----------------------------------------------
// USER CONFIGURABLE ELEMENTS
//-----------------------------------------------
/**
* Parachat auth file.
*
* Set-up and load module to run
*
* @package InvisionPowerBoard
* @author Matt Mecham
* @version 2.1
*/
define( 'ROOT_PATH' , "../" );
define( 'KERNEL_PATH', ROOT_PATH.'ips_kernel/' );
/**
* Script type
*
*/
define( 'IPB_THIS_SCRIPT', 'public' );
define( 'IPB_LOAD_SQL' , 'queries' );
//-----------------------------------------------
// NO USER EDITABLE SECTIONS BELOW
//-----------------------------------------------
define ( 'IN_IPB', 0 );
define ( 'IN_DEV', 0 );
error_reporting (E_ERROR | E_WARNING | E_PARSE);
set_magic_quotes_runtime(0);
//===========================================================================
// DEBUG CLASS
//===========================================================================
class Debug
{
function startTimer()
{
global $starttime;
$mtime = microtime ();
$mtime = explode (' ', $mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
}
function endTimer()
{
global $starttime;
$mtime = microtime ();
$mtime = explode (' ', $mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = round (($endtime - $starttime), 5);
return $totaltime;
}
}
//===========================================================================
// INFO CLASS
//===========================================================================
class info {
var $member = array();
var $input = array();
var $session_id = "";
var $base_url = "";
var $vars = "";
var $lang_id = "en";
var $skin = "";
var $lang = "";
var $server_load = 0;
function info()
{
global $sess, $std, $DB, $INFO;
$this->vars = &$INFO;
}
}
require_once( '../init.php' );
//===========================================================================
// MAIN PROGRAM
//===========================================================================
//--------------------------------
// Import $INFO, now!
//--------------------------------
$INFO = array();
require ROOT_PATH."conf_global.php";
//--------------------------------
// Load our classes
//--------------------------------
require_once ROOT_PATH . "sources/ipsclass.php";
require_once KERNEL_PATH . "class_converge.php";
require_once ROOT_PATH . "conf_global.php";
# Initiate super-class
$ipsclass = new ipsclass();
$ipsclass->vars = $INFO;
//--------------------------------
// The clocks a' tickin'
@@ -113,91 +78,38 @@ $Debug->startTimer();
// Load the DB driver and such
//--------------------------------
$INFO['sql_driver'] = !$INFO['sql_driver'] ? 'mysql' : $INFO['sql_driver'];
require ( KERNEL_PATH.'class_db_'.strtolower($INFO['sql_driver']).".php" );
$DB = new db_driver;
$DB->obj['sql_database'] = $INFO['sql_database'];
$DB->obj['sql_user'] = $INFO['sql_user'];
$DB->obj['sql_pass'] = $INFO['sql_pass'];
$DB->obj['sql_host'] = $INFO['sql_host'];
$DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix'];
$DB->obj['use_shutdown'] = 0;
$DB->obj['debug'] = 0;
//-----------------------------------
// Required vars?
//-----------------------------------
if ( is_array( $DB->connect_vars ) and count( $DB->connect_vars ) )
{
foreach( $DB->connect_vars as $k => $v )
{
$DB->connect_vars[ $k ] = $INFO[ $k ];
}
}
//--------------------------------
// Get a DB connection
//--------------------------------
$DB->connect();
//--------------------------------
// Wrap it all up in a nice easy to
// transport super class
//--------------------------------
$ibforums = new info();
//--------------------------------
// Require our global functions
//--------------------------------
require ROOT_PATH."sources/functions.php";
require KERNEL_PATH."class_converge.php";
$std = new FUNC;
$ipsclass->init_db_connection();
//--------------------------------
// Set up our vars
//--------------------------------
$ibforums->input = $std->parse_incoming();
$ipsclass->parse_incoming();
//--------------------------------
// Set converge
//--------------------------------
$ibforums->converge = new class_converge( $DB );
$ipsclass->converge = new class_converge( $ipsclass->DB );
//--------------------------------
// Start off the cache array
//--------------------------------
$ipsclass->cache_array = array_merge( array(), array('rss_calendar', 'rss_export','components','banfilters', 'settings', 'group_cache', 'systemvars', 'skin_id_cache', 'forum_cache', 'moderators', 'stats', 'languages') );
//===========================================================================
// Get cache...
//===========================================================================
$DB->simple_construct( array( 'select' => '*', 'from' => 'cache_store', 'where' => "cs_key IN ( ".$choice[ strtolower($ibforums->input['act']) ][2]."'banfilters', 'settings', 'group_cache', 'systemvars', 'skin_id_cache', 'forum_cache', 'moderators', 'stats', 'languages' )" ) );
$DB->simple_exec();
$ipsclass->init_load_cache( $ipsclass->cache_array );
while ( $r = $DB->fetch_row() )
{
if ( $r['cs_key'] == 'settings' )
{
$ibforums->vars = $ibforums->vars + unserialize(stripslashes($r['cs_value']));
}
else
{
if ( $r['cs_array'] )
{
$ibforums->cache[ $r['cs_key'] ] = unserialize(stripslashes($r['cs_value']));
}
else
{
$ibforums->cache[ $r['cs_key'] ] = $r['cs_value'];
}
}
}
//--------------------------------
// Initialize the FUNC
//--------------------------------
$ipsclass->initiate_ipsclass();
//===========================================================================
// AUTHORIZE...
@@ -208,25 +120,35 @@ $reply_nouser = 'Result=UserNotFound';
$reply_nopass = 'Result=WrongPassword';
$reply_error = 'Result=Error';
$in_user = $std->clean_value(urldecode(trim($_GET['user'])));
$in_pass = $std->clean_value(urldecode(trim($_GET['pass'])));
$in_cookie = $std->clean_value(urldecode(trim($_GET['cookie'])));
$access_groups = $ibforums->vars['chat04_access_groups'];
$in_user = $ipsclass->parse_clean_value(urldecode(trim($_GET['user'])));
$in_pass = $ipsclass->parse_clean_value(urldecode(trim($_GET['pass'])));
$in_cookie = $ipsclass->parse_clean_value(urldecode(trim($_GET['cookie'])));
$access_groups = $ipsclass->vars['chat04_access_groups'];
$in_md5_pass = "";
$nametmp = "";
$in_userid = 0;
$query = 0;
//----------------------------------------------
// Did we pass a "pretend" cookie to unord?
//----------------------------------------------
if ( $in_cookie )
if ( preg_match( "/^md5pass\((.+?)\)(.+?)$/", $in_pass, $match ) )
{
foreach( explode( '_', $in_cookie ) as $ord )
{
$nametmp .= chr( intval($ord) );
}
$in_md5_pass = $match[1];
$in_userid = intval($match[2]);
}
$in_user = $nametmp;
//----------------------------------------------
// Did we pass a user ID?
//----------------------------------------------
if ( $in_userid )
{
$query = "m.id=".$in_userid;
$in_user = 1;
}
else
{
$in_user = str_replace( '-', '_', $in_user );
$timeoff = time() - 3600;
$query = "m.members_display_name LIKE '".addslashes($in_user)."' AND last_activity > $timeoff";
}
//----------------------------------------------
@@ -245,11 +167,11 @@ if ( $in_user and $in_pass )
// Attempt to get member...
//------------------------------------------
$DB->query("SELECT m.mgroup, m.name, m.id, c.* FROM ibf_members m
LEFT JOIN ibf_members_converge c ON (m.id=c.converge_id)
WHERE lower(m.name)='".strtolower(addslashes($in_user))."'");
$ipsclass->DB->query("SELECT m.mgroup, m.name, m.id, c.* FROM ibf_members m
LEFT JOIN ibf_members_converge c ON (m.id=c.converge_id)
WHERE $query");
$member = $DB->fetch_row();
$member = $ipsclass->DB->fetch_row();
if ( ! $member['id'] )
{
@@ -264,11 +186,7 @@ if ( $in_user and $in_pass )
// Test for MD5 (future proof)
//------------------------------------------
if ( preg_match( "/^md5pass\((.+?)\)$/", $in_pass, $match ) )
{
$in_md5_pass = $match[1];
}
else
if ( ! $in_md5_pass )
{
$in_md5_pass = md5( md5( $member['converge_pass_salt'] ) . md5($in_pass) );
}
@@ -277,7 +195,7 @@ if ( $in_user and $in_pass )
// PASSWORD?
//------------------------------------------
if ( $in_pass and ($in_md5_pass == $member['converge_pass_hash']) )
if ( $in_md5_pass == $member['converge_pass_hash'] )
{
//--------------------------------------
// Check for access
@@ -317,7 +235,7 @@ function test_for_guest()
{
global $reply_nouser, $reply_error;
if ( $ibforums->vars['chat04_allow_guest'] )
if ( preg_match( "/(^|,)".$ipsclass->vars['guest_group']."(,|$)/", $access_groups ) )
{
show_message( $reply_nouser );
//## EXIT ##