YII framework 整合ucenter 一直显示通信失败 [ 求助交流 ]
YII framework 整合ucenter 一直显示通信失败 根据教程来做的,但是整合的是 discuz! x 2.5 ,整合的时候,操作更改了配置,但还是 通信失败。
共 8 条回复
-
因为 discuz ! x 2.5 里用的是ucenter 1.6 所以代码有些不一样。这是我改的:
error_reporting(0); define('UC_CLIENT_VERSION', '1.6.0'); define('UC_CLIENT_RELEASE', '20110501'); define('API_DELETEUSER', 1); define('API_RENAMEUSER', 1); define('API_GETTAG', 1); define('API_SYNLOGIN', 1); define('API_SYNLOGOUT', 1); define('API_UPDATEPW', 1); define('API_UPDATEBADWORDS', 1); define('API_UPDATEHOSTS', 1); define('API_UPDATEAPPS', 1); define('API_UPDATECLIENT', 1); define('API_UPDATECREDIT', 1); define('API_GETCREDIT', 1); define('API_GETCREDITSETTINGS', 1); define('API_UPDATECREDITSETTINGS', 1); define('API_ADDFEED', 1); define('API_RETURN_SUCCEED', '1'); define('API_RETURN_FAILED', '-1'); define('API_RETURN_FORBIDDEN', '1'); define('IN_API', true); define('CURSCRIPT', 'api'); define('DISCUZ_ROOT', '../'); if(!defined('IN_UC')) { //require_once '../source/class/class_core.php'; //$discuz = C::app(); //$discuz->init(); require DISCUZ_ROOT.'./config.inc.php'; $get = $post = array(); $code = @$_GET['code']; parse_str(authcode($code, 'DECODE', UC_KEY), $get); if(time() - $get['time'] > 3600) { exit('Authracation has expiried'); } if(empty($get)) { exit('Invalid Request'); } include_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', 'getcredit', 'getcreditsettings', 'updatecreditsettings', 'addfeed'))) { require_once DISCUZ_ROOT.'./include/db_mysql.class.php'; $GLOBALS['db'] = new dbstuff; $GLOBALS['db']->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset); $GLOBALS['tablepre'] = $tablepre; unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect); $uc_note = new uc_note(); exit($uc_note->$get['action']($get, $post)); } else { exit(API_RETURN_FAILED); } } else { //exit; require_once DISCUZ_ROOT.'./config.inc.php'; require_once DISCUZ_ROOT.'./include/db_mysql.class.php'; $GLOBALS['db'] = new dbstuff; $GLOBALS['db']->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true, $dbcharset); $GLOBALS['tablepre'] = $tablepre; unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect); }
-
marco_dong 回复于 2013-07-30 17:32 举报
学习一下
oraclelee 山东济南
注册时间:2012-05-12
最后登录:2015-04-14
在线时长:0小时6分
最后登录:2015-04-14
在线时长:0小时6分
- 粉丝0
- 金钱170
- 威望0
- 积分170