_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->isEnabledAuthor()) { $resultRedirect->setPath('customer/account'); return $resultRedirect; } if (!$this->_helperBlog->isAuthor()) { $author = $this->_helperBlog->getCurrentAuthor(); $this->coreRegistry->register('mp_author', $author); $page = $this->resultPageFactory->create(); $page->getConfig()->setPageLayout(SideBarLR::LEFT); $page->getConfig()->getTitle()->set($author->getName()); return $page; } if ($this->_helperBlog->isLogin()) { $resultRedirect->setPath('mpblog/*/signup'); } else { $resultRedirect->setPath('customer/account'); } return $resultRedirect; } }