_helperBlog = $helperData; $this->resultPageFactory = $resultPageFactory; $this->resultForwardFactory = $resultForwardFactory; $this->authorCollection = $authorCollection; $this->customerSession = $customerSession; $this->coreRegistry = $coreRegistry; parent::__construct($context); } /** * @return ResponseInterface|Redirect|ResultInterface|Page */ public function execute() { $resultRedirect = $this->resultRedirectFactory->create(); $this->_helperBlog->setCustomerContextId(); if (!$this->_helperBlog->isEnabled() || !$this->_helperBlog->isEnabledAuthor()) { $resultRedirect->setPath('customer/account'); return $resultRedirect; } if (!$this->_helperBlog->isAuthor()) { $this->coreRegistry->register('mp_author', $this->_helperBlog->getCurrentAuthor()); $page = $this->resultPageFactory->create(); $page->getConfig()->setPageLayout(SideBarLR::LEFT); $page->getConfig()->getTitle()->set('Information Author'); return $page; } if ($this->_helperBlog->isLogin()) { $resultRedirect->setPath('mpblog/*/signup'); } else { $resultRedirect->setPath('customer/account'); } return $resultRedirect; } }