Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Help internationalizing the login page


Go to End


3 Posts   1230 Views

Avatar
Voodoo Priest

Community Member, 32 Posts

29 January 2013 at 4:17am

Edited: 29/01/2013 4:17am

Hi,

In the wake of my previous efforts to internationalize the login page, I am now trying to extend the MemberAuthenticator class with a custom class.

The reason I'm trying to do that is that despite my aforementioned efforts, error messages still appear in en_US when the page is normally in fr_FR. To solve that problem, I've realized that I need to add a call to i18n::set_locale() in the static function MemberAuthenticator::authenticate.

I have created a subclass to MemberAuthenticator that does just that, added

Object::useCustomClass('MemberAuthenticator', 'MyMemberAuthenticator');

in mysite/_config.php, and run /dev/build.

And yet, using XDebug and Eclipse, I see that the standard MemberAuthenticator still gets called in lieu of my custom class, the file of which I've dropped in mysite/code/security/MyMemberAuthenticator.php. Is there something I did wrong?

Thank you.

Avatar
Tony Air

Community Member, 13 Posts

21 February 2013 at 5:20pm

Hi,
I had the same issue. Solution is to create your own security controller for an instance "SecurityExtended" and rewrite Director rules by routes.yml

Here's an example:

---
Name: zz-basicroutes
---
Director:
  rules:
    'Security//$Action/$ID/$OtherID': 'SecurityExtended'

Cheers

Avatar
prvz

Community Member, 1 Post

12 April 2013 at 11:42am

Thanks Tony Air can You Please Explain How to extend the security controller and change it sorry I am a new bee to silver stripe.
I am finding harder to extend the internal classes and use it. Or if you can provide me link.