/** * Perform some actions after the "login" action * * @return void */ public function redirectFromLogin() { $url = $this->getRedirectFromLoginURL(); if (isset($url)) { \XLite\Core\CMSConnector::isCMSStarted() ? \XLite\Core\Operator::redirect($url, true) : $this->setReturnURL($url); } }
/** * Perform redirect * * @param string $url Redirect URL OPTIONAL * * @return void */ protected function redirect($url = null) { $location = $this->getReturnURL(); if (!isset($location)) { $location = isset($url) ? $url : $this->getURL(); } // filter FORM ID from redirect url // FIXME - check if it's really needed $action = $this->get('action'); if (empty($action)) { $location = $this->filterXliteFormID($location); } \XLite\Core\Event::getInstance()->display(); \XLite\Core\Event::getInstance()->clear(); $location = $this->addCleanupCacheMark($location); \XLite\Core\Operator::redirect($location, $this->getRedirectMode(), $this->getParam(static::PARAM_REDIRECT_CODE)); }
/** * Dispatch request * * @return string */ protected static function dispatchRequest() { $result = static::TARGET_DEFAULT; if (isset(\XLite\Core\Request::getInstance()->url)) { if (LC_USE_CLEAN_URLS) { // Get target $result = static::getTargetByCleanURL(); // Get canonical redirect URL $canonicalURL = \XLite\Core\Database::getRepo('XLite\\Model\\CleanURL')->getRedirectCanonicalURL($result); if ($canonicalURL) { // Redirect \XLite\Core\Operator::redirect($canonicalURL); } } else { $result = static::isCheckForCleanURL() ? $result : null; } } return $result; }
/** * Perform some actions to prohibit access to storefornt * * @return void */ protected function closeStorefront() { $this->getDrupalLink() ? \XLite\Core\Operator::redirect($this->getDrupalLink()) : parent::closeStorefront(); }