Example #1
0
 /**
  * {@inheritdoc}
  */
 protected function _toHtml()
 {
     if (!$this->_customerHelper->isRegistrationAllowed() || $this->httpContext->getValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH)) {
         return '';
     }
     return parent::_toHtml();
 }
Example #2
0
 /**
  * Customer register form page
  *
  * @return void
  */
 public function execute()
 {
     if ($this->_getSession()->isLoggedIn() || !$this->customerHelper->isRegistrationAllowed()) {
         $this->_redirect('*/*');
         return;
     }
     $this->_view->loadLayout();
     $this->_view->getLayout()->initMessages();
     $this->_view->renderLayout();
 }
Example #3
0
 /**
  * Is registration allowed
  *
  * @return bool
  */
 protected function isRegistrationAllowed()
 {
     return $this->_customerHelperData->isRegistrationAllowed();
 }