owner; /* @var Form $form */ $form = $ctrl->LoginForm(); //$form->addExtraClass('ajax-form'); $form->setLegend('Sign in to your service account'); if ($form->get_protector()) { $form->enableSpamProtection(); } return $form; } public function LostPasswordForm() { if (Security::getCurrentUser()) { return; } $ctrl = $this->owner; $form = Injector::inst()->get(MemberAuthenticator::class) ->getLostPasswordHandler($ctrl->Link()) ->lostPasswordForm(); $form->addExtraClass('ajax-form'); $form->setLegend('Restore your password'); if ($form->get_protector()) { $form->enableSpamProtection(); } return $form; } public static function isFormRequest() { $ctrl = Controller::curr(); /* @var $req SilverStripe\Control\HTTPRequest */ $req = $ctrl->getRequest(); return $req->getHeader('x-requested-form') || $req->requestVar('formid'); } public function passwordsent() { $ctrl = $this->owner; if (self::isFormRequest() && Director::is_ajax()) { $message = _t( 'SilverStripe\\Security\\Security.PASSWORDRESETSENTTEXT', "Thank you. A reset link has been sent, provided an account exists for this email address." ); $json = json_encode([ 'status' => 'success', 'message' => '