/**
  * Check if current section is found and is allowed
  *
  * @param \Magento\Framework\App\RequestInterface $request
  * @return \Magento\Framework\App\ResponseInterface
  */
 public function dispatch(\Magento\Framework\App\RequestInterface $request)
 {
     if (!$request->getParam('section')) {
         $request->setParam('section', $this->_configStructure->getFirstSection()->getId());
     }
     return parent::dispatch($request);
 }
Example #2
0
 /**
  * Check if current section is found and is allowed
  *
  * @param \Magento\Framework\App\RequestInterface $request
  * @return \Magento\Framework\App\ResponseInterface
  */
 public function dispatch(\Magento\Framework\App\RequestInterface $request)
 {
     $section = null;
     if (!$request->getParam('section')) {
         $section = $this->_configStructure->getFirstSection();
         $request->setParam('section', $section->getId());
     } else {
         $this->_isSectionAllowed($request->getParam('section'));
     }
     return parent::dispatch($request);
 }
 /**
  * Performs login, if user submitted login form
  *
  * @param \Magento\Framework\App\RequestInterface $request
  * @return bool
  */
 protected function _performLogin(\Magento\Framework\App\RequestInterface $request)
 {
     $outputValue = true;
     $postLogin = $request->getPost('login');
     $username = isset($postLogin['username']) ? $postLogin['username'] : '';
     $password = isset($postLogin['password']) ? $postLogin['password'] : '';
     $request->setPostValue('login', null);
     try {
         $this->_auth->login($username, $password);
     } catch (AuthenticationException $e) {
         if (!$request->getParam('messageSent')) {
             $this->messageManager->addError($e->getMessage());
             $request->setParam('messageSent', true);
             $outputValue = false;
         }
     }
     return $outputValue;
 }
Example #4
0
 /**
  * @dataProvider textTranslationMode
  */
 public function testTextTranslationMode($mode)
 {
     $this->_request->setParam('translation_mode', $mode);
     $this->_helperData->setTranslationMode($this->_request);
     $this->assertEquals($mode, $this->_helperData->getTranslationMode());
 }