/** * Redirect to module (and action) * * @param string $newModule * @param string $newAction * @return bool false if the URL to redirect to is already this URL */ public static function redirectToModule($newModule, $newAction = '') { $currentModule = self::getModule(); $currentAction = self::getAction(); if ($currentModule != $newModule || $currentAction != $newAction) { $newUrl = 'index.php' . Core_Url::getCurrentQueryStringWithParametersModified(array('module' => $newModule, 'action' => $newAction)); Core_Url::redirectToUrl($newUrl); } return false; }
/** * Check force_ssl_login and redirect if connection isn't secure and not using a reverse proxy * * @param none * @return void */ protected function checkForceSslLogin() { $forceSslLogin = Zend_Registry::get('config')->General->force_ssl_login; if ($forceSslLogin) { $reverseProxy = Zend_Registry::get('config')->General->reverse_proxy; if (!(Core_Url::getCurrentScheme() == 'https' || $reverseProxy)) { $url = 'https://' . Core_Url::getCurrentHost() . Core_Url::getCurrentScriptName() . Core_Url::getCurrentQueryString(); Core_Url::redirectToUrl($url); } } }