Link($action); } public function __construct(Controller $controller, $name) { // Set default fields $fields = new FieldList( HiddenField::create("AuthenticationMethod", null, $this->authenticator_class, $this), HiddenField::create('tempid', null, $controller->getRequest()->requestVar('tempid')), PasswordField::create("Password", _t('Member.PASSWORD', 'Password')), LiteralField::create( 'forgotPassword', sprintf( '

%s

', $this->getExternalLink('lostpassword'), _t('CMSMemberLoginForm.BUTTONFORGOTPASSWORD', "Forgot password?") ) ) ); if (Security::config()->autologin_enabled) { $fields->push(CheckboxField::create( "Remember", _t('Member.REMEMBERME', "Remember me next time?") )); } // Determine returnurl to redirect to parent page $logoutLink = $this->getExternalLink('logout'); if ($returnURL = $controller->getRequest()->requestVar('BackURL')) { $logoutLink = Controller::join_links($logoutLink, '?BackURL='.urlencode($returnURL)); } // Make actions $actions = new FieldList( FormAction::create('dologin', _t('CMSMemberLoginForm.BUTTONLOGIN', "Log back in")), LiteralField::create( 'doLogout', sprintf( '

%s

', $logoutLink, _t('CMSMemberLoginForm.BUTTONLOGOUT', "Log out") ) ) ); parent::__construct($controller, $name, $fields, $actions); } protected function buildRequestHandler() { return CMSMemberLoginHandler::create($this); } }