'HTMLFragment' ); private static $allowed_actions = array( 'login', 'LoginForm', 'success' ); /** * Enable in-cms reauthentication * * @var boolean * @config */ private static $reauth_enabled = true; protected function init() { parent::init(); Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/client/dist/js/vendor.js'); } public function login($request = null, $service = Authenticator::CMS_LOGIN) { return parent::login($request, Authenticator::CMS_LOGIN); } public function Link($action = null) { /** @skipUpgrade */ return Controller::join_links(Director::baseURL(), "CMSSecurity", $action); } protected function getAuthenticator($name = 'cms') { return parent::getAuthenticator($name); } public function getApplicableAuthenticators($service = Authenticator::CMS_LOGIN) { return parent::getApplicableAuthenticators($service); } /** * Get known logged out member * * @return Member */ public function getTargetMember() { if ($tempid = $this->getRequest()->requestVar('tempid')) { return Member::member_from_tempid($tempid); } return null; } public function getResponseController($title) { // Use $this to prevent use of Page to render underlying templates return $this; } protected function getLoginMessage(&$messageType = null) { return parent::getLoginMessage($messageType) ?: _t( 'SilverStripe\\Security\\CMSSecurity.LoginMessage', '
If you have any unsaved work you can return to where you left off by logging back in below.
' ); } public function getTitle() { // Check if logged in already if (Security::getCurrentUser()) { return _t('SilverStripe\\Security\\CMSSecurity.SUCCESS', 'Success'); } // Display logged-out message $member = $this->getTargetMember(); if ($member) { return _t( 'SilverStripe\\Security\\CMSSecurity.TimedOutTitleMember', 'Hey {name}!Invalid user. Please re-authenticate here to continue.
', 'Message displayed to user if their session cannot be restored', array('link' => $loginURLATT) ); $response = $this->getResponse(); $response->setStatusCode(200); $response->setBody(<<Login success. If you are not automatically redirected ' . 'click here
', 'Login message displayed in the cms popup once a user has re-authenticated themselves', array('link' => Convert::raw2att($backURL)) ) )); return $controller->renderWith($this->getTemplatesFor('success')); } }