Пример #1
0
 protected function _construct()
 {
     parent::_construct();
     $this->client = Mage::getSingleton('inchoo_socialconnect/linkedin_oauth2_client');
     if (!$this->client->isEnabled()) {
         return;
     }
     $this->userInfo = Mage::registry('inchoo_socialconnect_linkedin_userinfo');
     // CSRF protection
     Mage::getSingleton('core/session')->setLinkedinCsrf($csrf = md5(uniqid(rand(), true)));
     $this->client->setState($csrf);
     Mage::getSingleton('customer/session')->setSocialConnectRedirect(Mage::helper('core/url')->getCurrentUrl());
     $this->setTemplate('inchoo/socialconnect/linkedin/button.phtml');
 }