/** * Prevent users registering by administrator * * @return void */ public function handleRequest() { if ($this->isRegisterMode() || 'delete' === \XLite\Core\Request::getInstance()->action) { \XLite\Core\TopMessage::addError('It is impossible to delete or create user accounts because your store currently works ' . 'as an integration with Drupal and shares users with Drupal. Deleting/creating user ' . 'accounts is possible via Drupal administrator interface.'); $this->markAsAccessDenied(); } return parent::handleRequest(); }
/** * init * * @return void */ public function init() { parent::init(); if (\XLite\Controller\Admin\Profile::getInstance()->isRegisterMode()) { foreach ($this->tabs as $key => $tab) { if ('profile' != $key) { unset($this->tabs[$key]); } } } }
/** * The "mode" parameter used to determine if we create new or modify existing profile * * @return boolean */ public function isRegisterMode() { return \XLite\Controller\Admin\Profile::getInstance()->isRegisterMode(); }
/** * Return value for the "register" mode param * * @return string */ public static function getRegisterMode() { return \XLite\Controller\Admin\Profile::getRegisterMode(); }
/** * Check if we need to forbid current action * * @return boolean */ protected function checkForDemoController() { return parent::checkForDemoController() && \XLite::isAdminZone(); }