Beispiel #1
0
 public function oauth_callback()
 {
     $id = intval(ISession::get('oauth'));
     if (!$id) {
         $this->redirect('login');
         exit;
     }
     $oauthObj = new Oauth($id);
     $result = $oauthObj->checkStatus($_GET);
     if ($result === true) {
         $oauthObj->getAccessToken($_GET);
         $userInfo = $oauthObj->getUserInfo();
         if (isset($userInfo['id']) && isset($userInfo['name']) && $userInfo['id'] != '' && $userInfo['name'] != '') {
             $this->bindUser($userInfo, $id);
         } else {
             $this->redirect('login');
         }
     } else {
         $this->redirect('login');
     }
 }