protected function _getButtonUrl() { if (is_null($this->userInfo) || !$this->userInfo->hasData()) { return $this->client->createAuthUrl(); } else { return $this->getUrl('socialconnect/google/disconnect'); } }
protected function _construct() { parent::_construct(); $this->client = Mage::getSingleton('inchoo_socialconnect/google_oauth2_client'); if (!$this->client->isEnabled()) { return; } $this->userInfo = Mage::registry('inchoo_socialconnect_google_userinfo'); $this->setTemplate('inchoo/socialconnect/google/account.phtml'); }
protected function _load() { try { $response = $this->client->api('/userinfo', 'GET', $this->params); foreach ($response as $key => $value) { $this->{$key} = $value; } } catch (Inchoo_SocialConnect_Google_OAuth2_Exception $e) { $this->_onException($e); } catch (Exception $e) { $this->_onException($e); } }