/**
  * Log out user and redirect to new admin custom url
  *
  * @param \Magento\Framework\Event\Observer $observer
  * @return void
  * @SuppressWarnings(PHPMD.ExitExpression)
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function execute(\Magento\Framework\Event\Observer $observer)
 {
     if ($this->_coreRegistry->registry('custom_admin_path_redirect') === null) {
         return;
     }
     $this->_authSession->destroy();
     $adminUrl = $this->_backendData->getHomePageUrl();
     $this->_response->setRedirect($adminUrl)->sendResponse();
     exit(0);
 }
 /**
  * Log out user and redirect him to new admin custom url
  *
  * @param \Magento\Framework\Event\Observer $observer
  * @return void
  * @SuppressWarnings(PHPMD.ExitExpression)
  */
 public function execute(\Magento\Framework\Event\Observer $observer)
 {
     if ($this->_coreRegistry->registry('custom_admin_path_redirect') === null) {
         return;
     }
     $this->_authSession->destroy();
     $route = $this->_backendData->getAreaFrontName();
     $this->_response->setRedirect($this->_storeManager->getStore()->getBaseUrl() . $route)->sendResponse();
     exit(0);
 }
Example #3
0
 /**
  * Log out user and redirect him to new admin custom url
  *
  * @return void
  * @SuppressWarnings(PHPMD.ExitExpression)
  */
 public function afterCustomUrlChanged()
 {
     if (is_null($this->_coreRegistry->registry('custom_admin_path_redirect'))) {
         return;
     }
     $this->_authSession->destroy();
     $route = $this->_backendData->getAreaFrontName();
     $this->_response->setRedirect($this->_storeManager->getStore()->getBaseUrl() . $route)->sendResponse();
     exit(0);
 }
Example #4
0
 /**
  * Admin Session prolong functionality
  *
  * @param Session $session
  * @param \Closure $proceed
  * @return mixed
  */
 public function aroundProlong(Session $session, \Closure $proceed)
 {
     if (!$this->sessionsManager->getCurrentSession()->isLoggedInStatus()) {
         $session->destroy();
         $this->addUserLogoutNotification();
         return null;
     }
     $result = $proceed();
     $this->sessionsManager->processProlong();
     return $result;
 }
 /**
  * {@inheritdoc}
  */
 public function destroy(array $options = null)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'destroy');
     if (!$pluginInfo) {
         return parent::destroy($options);
     } else {
         return $this->___callPlugins('destroy', func_get_args(), $pluginInfo);
     }
 }