protected function _getButtonUrl()
 {
     if (is_null($this->userInfo) || !$this->userInfo->hasData()) {
         return $this->client->createAuthUrl();
     } else {
         return $this->getUrl('socialconnect/facebook/disconnect');
     }
 }
 protected function _construct()
 {
     parent::_construct();
     $this->client = Mage::getSingleton('inchoo_socialconnect/facebook_oauth2_client');
     if (!$this->client->isEnabled()) {
         return;
     }
     $this->userInfo = Mage::registry('inchoo_socialconnect_facebook_userinfo');
     $this->setTemplate('inchoo/socialconnect/facebook/account.phtml');
 }
Example #3
0
 protected function _load()
 {
     try {
         $response = $this->client->api('/me', 'GET', array('fields' => implode(',', $this->params)));
         foreach ($response as $key => $value) {
             $this->{$key} = $value;
         }
     } catch (Inchoo_SocialConnect_Facebook_OAuth2_Exception $e) {
         $this->_onException($e);
     } catch (Exception $e) {
         $this->_onException($e);
     }
 }
Example #4
0
 protected function _load()
 {
     try {
         $response = $this->client->api('/me', 'GET', array('fields' => 'id,name,first_name,last_name,link,birthday,gender,email,picture.type(large)'));
         foreach ($response as $key => $value) {
             $this->{$key} = $value;
         }
     } catch (Inchoo_SocialConnect_Facebook_OAuth2_Exception $e) {
         $this->_onException($e);
     } catch (Exception $e) {
         $this->_onException($e);
     }
 }
 protected function _load()
 {
     $this->params['fields'] = 'first_name,last_name,email';
     try {
         $response = $this->client->api('/me', 'GET', $this->params);
         foreach ($response as $key => $value) {
             $this->{$key} = $value;
         }
     } catch (Inchoo_SocialConnect_Facebook_OAuth2_Exception $e) {
         $this->_onException($e);
     } catch (Exception $e) {
         $this->_onException($e);
     }
 }