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/xm
$post = xm
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);
}
最佳答案