public function actionAdminFetchStatus() { if ($this->getRole() != 2) { return; } $adminUid = Yii::app()->params['adminWeiboUid']; $adminUser = User::model()->findByAttributes(array('sns_uid' => $adminUid)); $access_token = $adminUser->access_token; $c = new SaeTClientV2(WB_AKEY, WB_SKEY, $access_token); $contents = $c->public_timeline(); if (isset($contents['error_code'])) { $o = new SaeTOAuthV2(WB_AKEY, WB_SKEY); $weiboUrl = $o->getAuthorizeURL(WB_CALLBACK_URL); $this->render('weibologin', array('weiboUrl' => $weiboUrl)); } else { } }