Version 3.0.5
This commit is contained in:
1 parent
19b38c7c74
commit
1d4720f3e2
3755 files changed
+508378
-664541
No files matched your search
+39
-117
@@ -1,106 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| Email: matt@invisionpower.com
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > IPB CHAT 2004 INTEGRATION
|
||||
| > Script written by Matt Mecham
|
||||
| > Date started: 20th April 2004
|
||||
| > Interesting fact: Radiohead rock
|
||||
| > Which Radiohead track features the words "In a city of the future"?
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Parachat auth file.
|
||||
*
|
||||
* Set-up and load module to run
|
||||
*
|
||||
* @package InvisionPowerBoard
|
||||
* @author Matt Mecham
|
||||
* @version 2.1
|
||||
*/
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Parachat remote authentication file
|
||||
* Last Updated: $Date: 2009-07-08 21:23:44 -0400 (Wed, 08 Jul 2009) $
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Chat
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @version $Rev: 4856 $
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Script type
|
||||
*
|
||||
*/
|
||||
define( 'IPB_THIS_SCRIPT', 'public' );
|
||||
define( 'IPB_LOAD_SQL' , 'queries' );
|
||||
define( 'IPB_THIS_SCRIPT', 'chat' );
|
||||
|
||||
require_once( '../init.php' );
|
||||
require_once( '../initdata.php' );
|
||||
|
||||
//===========================================================================
|
||||
// MAIN PROGRAM
|
||||
//===========================================================================
|
||||
|
||||
$INFO = array();
|
||||
|
||||
//--------------------------------
|
||||
// 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'
|
||||
//--------------------------------
|
||||
|
||||
$Debug = new Debug;
|
||||
$Debug->startTimer();
|
||||
|
||||
//--------------------------------
|
||||
// Load the DB driver and such
|
||||
//--------------------------------
|
||||
|
||||
$ipsclass->init_db_connection();
|
||||
|
||||
//--------------------------------
|
||||
// Set up our vars
|
||||
//--------------------------------
|
||||
|
||||
$ipsclass->parse_incoming();
|
||||
|
||||
//--------------------------------
|
||||
// Set converge
|
||||
//--------------------------------
|
||||
|
||||
$ipsclass->converge = new class_converge( $ipsclass->DB );
|
||||
|
||||
//--------------------------------
|
||||
// Start off the cache array
|
||||
//--------------------------------
|
||||
|
||||
$ipsclass->cache_array = array('rss_calendar', 'rss_export','components','banfilters', 'settings', 'group_cache', 'systemvars', 'skin_id_cache', 'forum_cache', 'moderators', 'stats', 'languages');
|
||||
|
||||
|
||||
//===========================================================================
|
||||
// Get cache...
|
||||
//===========================================================================
|
||||
|
||||
$ipsclass->init_load_cache( $ipsclass->cache_array );
|
||||
|
||||
//--------------------------------
|
||||
// Initialize the FUNC
|
||||
//--------------------------------
|
||||
|
||||
$ipsclass->initiate_ipsclass();
|
||||
/**
|
||||
* IPB registry
|
||||
*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );
|
||||
$ipbRegistry = ipsRegistry::instance();
|
||||
$ipbRegistry->init();
|
||||
|
||||
//===========================================================================
|
||||
// AUTHORIZE...
|
||||
@@ -111,10 +41,10 @@ $reply_nouser = 'Result=UserNotFound';
|
||||
$reply_nopass = 'Result=WrongPassword';
|
||||
$reply_error = 'Result=Error';
|
||||
|
||||
$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_user = IPSText::parseCleanValue(urldecode(trim($_GET['user'])));
|
||||
$in_pass = IPSText::parseCleanValue(urldecode(trim($_GET['pass'])));
|
||||
$in_cookie = IPSText::parseCleanValue(urldecode(trim($_GET['cookie'])));
|
||||
$access_groups = ipsRegistry::$settings['chat04_access_groups'];
|
||||
$in_md5_pass = "";
|
||||
$nametmp = "";
|
||||
$in_userid = 0;
|
||||
@@ -132,14 +62,14 @@ if ( preg_match( "/^md5pass\((.+?)\)(.+?)$/", $in_pass, $match ) )
|
||||
|
||||
if ( $in_userid )
|
||||
{
|
||||
$query = "m.id=".$in_userid;
|
||||
$query = "member_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";
|
||||
$query = "members_display_name LIKE '" . addslashes($in_user) . "' AND last_activity > {$timeoff}";
|
||||
}
|
||||
|
||||
//----------------------------------------------
|
||||
@@ -149,7 +79,6 @@ else
|
||||
if ( $in_user and ! $in_pass )
|
||||
{
|
||||
show_message( $reply_nopass );
|
||||
//## EXIT ##
|
||||
}
|
||||
|
||||
if ( $in_user and $in_pass )
|
||||
@@ -158,20 +87,16 @@ if ( $in_user and $in_pass )
|
||||
// Attempt to get member...
|
||||
//------------------------------------------
|
||||
|
||||
$ipsclass->DB->build_query( array( 'select' => 'm.mgroup, m.name, m.id, c.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
ipsRegistry::DB()->build( array( 'select' => '*',
|
||||
'from' => 'members',
|
||||
'where' => $query,
|
||||
'limit' => array( 0, 1 ),
|
||||
'add_join' => array( 1 => array( 'type' => 'left',
|
||||
'from' => array( 'members_converge' => 'c' ),
|
||||
'where' => 'c.converge_email=m.email',
|
||||
) )
|
||||
) );
|
||||
$ipsclass->DB->exec_query();
|
||||
ipsRegistry::DB()->execute();
|
||||
|
||||
$member = $ipsclass->DB->fetch_row();
|
||||
$member = ipsRegistry::DB()->fetch();
|
||||
|
||||
if ( ! $member['id'] )
|
||||
if ( ! $member['member_id'] )
|
||||
{
|
||||
//--------------------------------------
|
||||
// Guest...
|
||||
@@ -186,20 +111,20 @@ if ( $in_user and $in_pass )
|
||||
|
||||
if ( ! $in_md5_pass )
|
||||
{
|
||||
$in_md5_pass = md5( md5( $member['converge_pass_salt'] ) . md5($in_pass) );
|
||||
$in_md5_pass = md5( md5( $member['members_pass_salt'] ) . md5($in_pass) );
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// PASSWORD?
|
||||
//------------------------------------------
|
||||
|
||||
if ( $in_md5_pass == $member['converge_pass_hash'] )
|
||||
if ( $in_md5_pass == $member['members_pass_hash'] )
|
||||
{
|
||||
//--------------------------------------
|
||||
// Check for access
|
||||
//--------------------------------------
|
||||
|
||||
if ( ! preg_match( "/(^|,)".$member['mgroup']."(,|$)/", $access_groups ) )
|
||||
if ( ! preg_match( "/(^|,)".$member['member_group_id']."(,|$)/", $access_groups ) )
|
||||
{
|
||||
show_message( $reply_error );
|
||||
//## EXIT ##
|
||||
@@ -233,7 +158,7 @@ function test_for_guest()
|
||||
{
|
||||
global $reply_nouser, $reply_error;
|
||||
|
||||
if ( preg_match( "/(^|,)".$ipsclass->vars['guest_group']."(,|$)/", $access_groups ) )
|
||||
if ( preg_match( "/(^|,)".ipsRegistry::$settings['guest_group']."(,|$)/", $access_groups ) )
|
||||
{
|
||||
show_message( $reply_nouser );
|
||||
//## EXIT ##
|
||||
@@ -254,7 +179,4 @@ function show_message($msg="Result=Error")
|
||||
@flush();
|
||||
echo $msg;
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
}
|
||||
Reference in new issue
Block a user