/**
  *
  * @param \Magento\Framework\HTTP\ZendClientFactory $httpClientFactory
  * @param \Magento\Backend\App\ConfigInterface $config
  * @param \Magento\Framework\UrlInterface $url
  * @param \Inchoo\SocialConnect\Helper\Data $helperData
  * @param array $data
  */
 public function __construct(\Magento\Framework\HTTP\ZendClientFactory $httpClientFactory, \Magento\Backend\App\ConfigInterface $config, \Magento\Framework\UrlInterface $url, \Inchoo\SocialConnect\Helper\Data $helperData, array $data = array())
 {
     $this->_httpClientFactory = $httpClientFactory;
     $this->_config = $config;
     $this->_url = $url;
     $this->_redirectUri = $this->_url->sessionUrlVar($this->_url->getUrl(self::REDIRECT_URI_ROUTE));
     $this->_helperData = $helperData;
     $this->_clientId = $this->_getClientId();
     $this->_clientSecret = $this->_getClientSecret();
     $this->_config = $config;
     parent::__construct($data);
 }
Example #2
0
 /**
  * base64_decode() for URLs decoding
  *
  * @param    string $url
  * @return   string
  */
 public function decode($url)
 {
     $url = base64_decode(strtr($url, '-_,', '+/='));
     return $this->urlBuilder->sessionUrlVar($url);
 }
Example #3
0
 /**
  *  base64_decode() for URLs decoding
  *
  * @param    string $url
  * @return   string
  */
 public function decode($url)
 {
     return $this->_url->sessionUrlVar(base64_decode(strtr($url, '-_,', '+/=')));
 }
Example #4
0
 /**
  * Note: isolation flushes the URL memory cache
  * @magentoAppIsolation enabled
  *
  * Note: to enforce SID in URLs, base URL must be different from the current $_SERVER['HTTP_HOST']
  * @magentoConfigFixture current_store web/unsecure/base_link_url http://domain.com/
  */
 public function testSessionUrlVar()
 {
     $sessionId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\Session\\Generic')->getSessionId();
     $sessionUrl = $this->_model->sessionUrlVar('<a href="http://example.com/?___SID=U">www.example.com</a>');
     $this->assertEquals('<a href="http://example.com/?SID=' . $sessionId . '">www.example.com</a>', $sessionUrl);
 }