Version 2.0.0
This commit is contained in:
1 parent
5699abfc0e
commit
0eecc172d9
696 files changed
+120723
-77160
No files matched your search
+113
-41
@@ -2,48 +2,128 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board v1.1
|
||||
| Invision Power Board v2.0.0
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001,2002 Invision Power Services, Inc
|
||||
| http://www.ibforums.com
|
||||
| (c) 2004 Invision Power Services, Inc
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| Web: http://www.ibforums.com
|
||||
| Email: phpboards@ibforums.com
|
||||
| Licence Info: phpib-licence@ibforums.com
|
||||
| Web: http://www.invisionpower.com
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > IP Chat => IPB Bridge Script
|
||||
| > Script written by Matt Mecham
|
||||
| > Date started: 17th February 2003
|
||||
| > Date started: 17th February 2003 (Updated: 1 July 2004)
|
||||
|
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$root_path = './';
|
||||
//-----------------------------------------------
|
||||
// USER CONFIGURABLE ELEMENTS
|
||||
//-----------------------------------------------
|
||||
|
||||
// Root path
|
||||
|
||||
define( 'ROOT_PATH' , "./" );
|
||||
define( 'KERNEL_PATH', ROOT_PATH.'ips_kernel/' );
|
||||
|
||||
$CACHE = array();
|
||||
|
||||
//----------------------------------------------
|
||||
// END OF USER EDITABLE COMPONENTS
|
||||
//---------------------------------------------
|
||||
|
||||
require $root_path."conf_global.php";
|
||||
error_reporting (E_ERROR | E_WARNING | E_PARSE);
|
||||
set_magic_quotes_runtime(0);
|
||||
|
||||
require ROOT_PATH."conf_global.php";
|
||||
|
||||
define( 'DENIED', 0 );
|
||||
define( 'ACCESS', 1 );
|
||||
define( 'ADMIN' , 2 );
|
||||
|
||||
$db_info = array();
|
||||
//--------------------------------
|
||||
// Load the DB driver and such
|
||||
//--------------------------------
|
||||
|
||||
$db_info['host'] = $INFO['sql_host'];
|
||||
$db_info['user'] = $INFO['sql_user'];
|
||||
$db_info['pass'] = $INFO['sql_pass'];
|
||||
$db_info['database'] = $INFO['sql_database'];
|
||||
$db_info['tbl_prefix'] = $INFO['sql_tbl_prefix'];
|
||||
$INFO['sql_driver'] = ! $INFO['sql_driver'] ? 'mysql' : strtolower($INFO['sql_driver']);
|
||||
|
||||
require ( KERNEL_PATH.'class_db_'.$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;
|
||||
|
||||
//-----------------------------------
|
||||
// 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();
|
||||
|
||||
//--------------------------------
|
||||
// Make CONSTANT
|
||||
//--------------------------------
|
||||
|
||||
define( 'SQL_PREFIX', $DB->obj['sql_tbl_prefix'] );
|
||||
define( 'SQL_DRIVER', $INFO['sql_driver'] );
|
||||
|
||||
//===========================================================================
|
||||
// Get cache...
|
||||
//===========================================================================
|
||||
|
||||
$DB->simple_construct( array( 'select' => '*', 'from' => 'cache_store', 'where' => "cs_key IN ( 'settings', 'group_cache', 'systemvars' )" ) );
|
||||
$DB->simple_exec();
|
||||
|
||||
while ( $r = $DB->fetch_row() )
|
||||
{
|
||||
if ( $r['cs_key'] == 'settings' )
|
||||
{
|
||||
$tmp = unserialize(stripslashes($r['cs_value']));
|
||||
|
||||
if ( is_array( $tmp ) and count( $tmp ) )
|
||||
{
|
||||
foreach( $tmp as $k => $v )
|
||||
{
|
||||
$INFO[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
unset( $tmp );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $r['cs_array'] )
|
||||
{
|
||||
$CACHE[ $r['cs_key'] ] = unserialize(stripslashes($r['cs_value']));
|
||||
}
|
||||
else
|
||||
{
|
||||
$CACHE[ $r['cs_key'] ] = $r['cs_value'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$allowed_groups = $INFO['chat_admin_groups'];
|
||||
$access_groups = $INFO['chat_access_groups'];
|
||||
$autologin = 0;
|
||||
$allow_guest_access = $INFO['chat_allow_guest'] == 1 ? ACCESS : DENIED;
|
||||
$allow_guest_access = strstr( ','.$INFO['chat_access_groups'].',', ','.$INFO['guest_group'].',' ) ? ACCESS : DENIED;
|
||||
|
||||
// Stupid PHP changing it's mind on HTTP args
|
||||
|
||||
@@ -77,34 +157,16 @@ $output_int = $allow_guest_access;
|
||||
$output_name = "";
|
||||
|
||||
|
||||
|
||||
$DB = @mysql_connect( $db_info['host'], $db_info['user'], $db_info['pass'] );
|
||||
|
||||
if ( ! @mysql_select_db( $db_info['database'] ) )
|
||||
{
|
||||
die_nice();
|
||||
|
||||
//-- script exits --//
|
||||
}
|
||||
|
||||
//------------------------------
|
||||
// Attempt to find the user
|
||||
//------------------------------
|
||||
|
||||
if ( ! $autologin )
|
||||
{
|
||||
$md5_password = md5($password);
|
||||
}
|
||||
else
|
||||
{
|
||||
$md5_password = $password;
|
||||
}
|
||||
$DB->query( "SELECT m.mgroup, m.name, m.id, c.* FROM ".SQL_PREFIX."members m
|
||||
LEFT JOIN ".SQL_PREFIX."members_converge c ON (m.id=c.converge_id)
|
||||
WHERE m.name='".$DB->add_slashes($username)."'" );
|
||||
|
||||
$query_id = @mysql_query("SELECT m.mgroup, m.password, m.name, m.id FROM {$db_info['tbl_prefix']}members m
|
||||
WHERE m.name='".addslashes($username)."' LIMIT 1"
|
||||
, $DB );
|
||||
|
||||
if ( ! $query_id )
|
||||
if ( ! $member = $DB->fetch_row() )
|
||||
{
|
||||
die_nice();
|
||||
|
||||
@@ -112,7 +174,7 @@ if ( ! $query_id )
|
||||
}
|
||||
|
||||
|
||||
if ( ! $member = @mysql_fetch_array( $query_id, MYSQL_ASSOC ) )
|
||||
if ( ! $member['id'] )
|
||||
{
|
||||
// No member found - allow guest access?
|
||||
|
||||
@@ -122,8 +184,18 @@ if ( ! $member = @mysql_fetch_array( $query_id, MYSQL_ASSOC ) )
|
||||
}
|
||||
|
||||
|
||||
@mysql_close();
|
||||
//------------------------------
|
||||
// Update passy
|
||||
//------------------------------
|
||||
|
||||
if ( ! $autologin )
|
||||
{
|
||||
$md5_password = md5( md5( $member['converge_pass_salt'] ) . md5($password) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$md5_password = $password;
|
||||
}
|
||||
|
||||
//------------------------------
|
||||
// Check password - member exists
|
||||
@@ -133,7 +205,7 @@ if ( $password != "" )
|
||||
{
|
||||
// Password was entered..
|
||||
|
||||
if ( $md5_password != $member['password'] )
|
||||
if ( $md5_password != $member['converge_pass_hash'] )
|
||||
{
|
||||
// Password incorrect..
|
||||
|
||||
|
||||
Reference in new issue
Block a user