Example #1
0
 /**
  * Juser开放平台登录回调
  * @param null
  * @return mixed
  */
 public function openCallBack($isLogin = null)
 {
     JuserRouter::OpenCallBackInit();
     $Open = $this->openInit();
     if (JUSER_OPEN_CODE) {
         $acceToken = $Open->getAccessToken(JUSER_OPEN_CODE);
     } else {
         #用户手动刷新了回调页
         emDirect(BLOG_URL . '?plugin=juser&type=' . strtolower($_GET['type']));
     }
     if ($acceToken) {
         $openID = $Open->getOpenID($acceToken);
         if ($openID) {
             $OpenUser = $Open->getUserInfo($acceToken);
             $this->__openLoginHandle($isLogin, $OpenUser);
             #调度处理
         }
     } else {
         #Token获取异常 回到插件首页
         emDirect(BLOG_URL . '?plugin=juser');
     }
 }
Example #2
0
require_once 'JuserController.class.php';
require_once 'JuserRouter.class.php';
require_once 'JuserCommnet.class.php';
/*===================================================================================================*/
global $CACHE;
$BlogInfo = $CACHE->readCache('options');
$blogname = $BlogInfo['blogname'];
$bloginfo = $BlogInfo['bloginfo'];
$site_title = $blogname;
$site_key = $BlogInfo['site_key'];
$site_description = $blogname . '用户中心。';
$icp = $BlogInfo['icp'];
$footer_info = $BlogInfo['footer_info'];
/*===================================================================================================*/
$isLogin = Juser::isLogin();
$Acttion = JuserRouter::getActionName();
#登录状态下的控制器矛盾处理
if ($isLogin && in_array($Acttion, array('__empty', 'register', 'login'))) {
    emDirect(BLOG_URL . '?plugin=juser&a=UserCenter');
}
#非登录状态下的控制器矛盾处理
if (!$isLogin && in_array($Acttion, array('doChange', 'usercenter', 'userinfo', 'userpasswd', 'usercomment'))) {
    emDirect(BLOG_URL . '?plugin=juser&a=login');
}
$site_title = Juser_getTitle($Acttion) . $site_title;
$JuserController = new JuserController();
$ReflctionClass = new ReflectionClass('JuserController');
#调度执行各种方法
if ($ReflctionClass->hasMethod($Acttion)) {
    $ReflectionMethod = $ReflctionClass->getMethod($Acttion);
    if ($ReflectionMethod->isPublic() && !$ReflectionMethod->isStatic()) {