Merge pull request #1862 from robbieaverill/pulls/4.0/fix-missing-memberauthenticator

FIX Ensure LoginForm on ContentController can load the member authenticator correctly
This commit is contained in:
Damian Mooyman 2017-06-28 12:10:28 +12:00 committed by GitHub
commit 2251138bed

View File

@ -9,6 +9,7 @@ use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPResponse; use SilverStripe\Control\HTTPResponse;
use SilverStripe\Control\HTTPResponse_Exception; use SilverStripe\Control\HTTPResponse_Exception;
use SilverStripe\Core\Convert; use SilverStripe\Core\Convert;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\i18n\i18n; use SilverStripe\i18n\i18n;
use SilverStripe\ORM\ArrayList; use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObject;
@ -17,6 +18,7 @@ use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\ORM\FieldType\DBHTMLText; use SilverStripe\ORM\FieldType\DBHTMLText;
use SilverStripe\ORM\FieldType\DBVarchar; use SilverStripe\ORM\FieldType\DBVarchar;
use SilverStripe\ORM\SS_List; use SilverStripe\ORM\SS_List;
use SilverStripe\Security\MemberAuthenticator\MemberAuthenticator;
use SilverStripe\Security\Permission; use SilverStripe\Security\Permission;
use SilverStripe\Security\Security; use SilverStripe\Security\Security;
use SilverStripe\SiteConfig\SiteConfig; use SilverStripe\SiteConfig\SiteConfig;
@ -311,10 +313,11 @@ class ContentController extends Controller
* *
* @todo Check if here should be returned just the default log-in form or * @todo Check if here should be returned just the default log-in form or
* all available log-in forms (also OpenID...) * all available log-in forms (also OpenID...)
* @return \SilverStripe\Security\MemberAuthenticator\MemberLoginForm
*/ */
public function LoginForm() public function LoginForm()
{ {
return MemberAuthenticator::singleton()->loginForm($this); return Injector::inst()->get(MemberAuthenticator::class)->getLoginHandler($this->Link())->loginForm();
} }
public function SilverStripeNavigator() public function SilverStripeNavigator()