From 4b23205838a8bb16d64a3e44a069731b235ca6ca Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Tue, 4 Jul 2017 14:18:47 +1200 Subject: [PATCH] Fix unnamespaced i18n keys Fixes https://github.com/silverstripe/silverstripe-framework/issues/6862 --- lang/en.yml | 5 ++--- src/Security/Security.php | 7 ++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lang/en.yml b/lang/en.yml index 84fac9481..e75973795 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -1,7 +1,4 @@ en: - Security: - LOGIN: 'Log in' - LOGOUT: 'Log out' SilverStripe\AssetAdmin\Forms\UploadField: Dimensions: Dimensions EDIT: Edit @@ -315,6 +312,8 @@ en: CONFIRMLOGOUT: 'Please click the button below to confirm that you wish to log out.' ENTERNEWPASSWORD: 'Please enter a new password.' ERRORPASSWORDPERMISSION: 'You must be logged in in order to change your password!' + LOGIN: 'Log in' + LOGOUT: 'Log out' LOSTPASSWORDHEADER: 'Lost Password' NOTEPAGESECURED: 'That page is secured. Enter your credentials below and we will send you right along.' NOTERESETLINKINVALID: '

The password reset link is invalid or expired.

You can request a new one here or change your password after you logged in.

' diff --git a/src/Security/Security.php b/src/Security/Security.php index 4c03eed47..5938fe9f7 100644 --- a/src/Security/Security.php +++ b/src/Security/Security.php @@ -12,7 +12,6 @@ use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\HTTPResponse; use SilverStripe\Control\HTTPResponse_Exception; use SilverStripe\Control\RequestHandler; -use SilverStripe\Control\Session; use SilverStripe\Core\ClassInfo; use SilverStripe\Core\Convert; use SilverStripe\Core\Injector\Injector; @@ -655,6 +654,7 @@ class Security extends Controller implements TemplateGlobalProvider * @param null|HTTPRequest $request * @param int $service * @return HTTPResponse|string Returns the "login" page as HTML code. + * @throws HTTPResponse_Exception */ public function login($request = null, $service = Authenticator::LOGIN) { @@ -684,7 +684,7 @@ class Security extends Controller implements TemplateGlobalProvider return $this->delegateToMultipleHandlers( $handlers, - _t('Security.LOGIN', 'Log in'), + _t(__CLASS__.'.LOGIN', 'Log in'), $this->getTemplatesFor('login'), [$this, 'aggregateTabbedForms'] ); @@ -721,7 +721,7 @@ class Security extends Controller implements TemplateGlobalProvider return $this->delegateToMultipleHandlers( $handlers, - _t('Security.LOGOUT', 'Log out'), + _t(__CLASS__.'.LOGOUT', 'Log out'), $this->getTemplatesFor('logout'), [$this, 'aggregateTabbedForms'] ); @@ -733,6 +733,7 @@ class Security extends Controller implements TemplateGlobalProvider * * @param int $service * @param HTTPRequest $request + * @return Authenticator[] * @throws HTTPResponse_Exception */ protected function getServiceAuthenticatorsFromRequest($service, HTTPRequest $request)