/** * Redirects the user to the external login page * * @return SS_HTTPResponse */ protected function redirectToExternalLogin() { $loginURL = Security::create()->Link('login'); $loginURLATT = Convert::raw2att($loginURL); $loginURLJS = Convert::raw2js($loginURL); $message = _t('CMSSecurity.INVALIDUSER', '<p>Invalid user. <a target="_top" href="{link}">Please re-authenticate here</a> to continue.</p>', 'Message displayed to user if their session cannot be restored', array('link' => $loginURLATT)); $response = $this->getResponse(); $response->setStatusCode(200); $response->setBody(<<<PHP <!DOCTYPE html> <html><body> {$message} <script type="application/javascript"> setTimeout(function(){top.location.href = "{$loginURLJS}";}, 0); </script> </body></html> PHP ); $this->setResponse($response); return $response; }
/** * Get link to use for external security actions * * @param string $action Action * @return string */ public function getExternalLink($action = null) { return Security::create()->Link($action); }