tk5或者6 使用uctenter

浏览:87 发布日期:2019/11/20 分类:ThinkPHP6专区 关键字: uctenter
thinkphp3通信uctenter可以成功,使用thinkphp5或者6的时候始终通信失败,求救!!!!!!!!!!!!!!!!!



define( 'DISCUZ_ROOT', '../' );

//note 普通的 http 通知方式
if( !defined( 'IN_UC' ) )
{

error_reporting( 0 );
set_magic_quotes_runtime( 0 );

defined( 'MAGIC_QUOTES_GPC' ) || define( 'MAGIC_QUOTES_GPC',
get_magic_quotes_gpc() );
require_once DISCUZ_ROOT . './public/ucenter.php';

$_DCACHE = $get = $post = array();

$code = @$_GET[ 'code' ];
parse_str( _authcode( $code, 'DECODE', UC_KEY ), $get );
if( MAGIC_QUOTES_GPC )
{
$get = _stripslashes( $get );
}

$timestamp = time();
if( $timestamp - $get[ 'time' ] > 3600 )
{
exit( 'Authracation has expiried' );
}
if( empty( $get ) )
{
exit( 'Invalid Request' );
}
$action = $get[ 'action' ];

require_once DISCUZ_ROOT . './uc_client/lib/xml.class.php';
$post = xml_unserialize( file_get_contents( 'php://input' ) );

if( in_array( $get[ 'action' ],
array( 'test', 'deleteuser', 'renameuser', 'gettag', 'synlogin',
'synlogout', 'updatepw', 'updatebadwords', 'updatehosts', 'updateapps',
'updateclient', 'updatecredit', 'getcreditsettings', 'updatecreditsettings' ) ) )
{
require_once DISCUZ_ROOT . './uc_client/lib/db.class.php';
$GLOBALS[ 'db' ] = new ucclient_db;
$GLOBALS[ 'db' ]->connect( UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME,
UC_DBCONNECT, true, UC_DBCHARSET );
$GLOBALS[ 'tablepre' ] = UC_DBTABLEPRE;
// unset( UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, UC_DBCONNECT);
$uc_note = new uc_note();
exit( $uc_note->$get[ 'action' ]( $get, $post ) );
}
else
{
exit( API_RETURN_FAILED );
}

//note include 通知方式
}
else
{

require_once DISCUZ_ROOT . './public/ucenter.php';
require_once DISCUZ_ROOT . './uc_client/lib/db.class.php';
$GLOBALS[ 'db' ] = new ucclient_db;
$GLOBALS[ 'db' ]->connect( UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME,
UC_DBCONNECT, true, UC_DBCHARSET );
$GLOBALS[ 'tablepre' ] = UC_DBTABLEPRE;
// unset(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, UC_DBCONNECT);
}
最佳答案
评论( 相关
后面还有条评论,点击查看>>