Giter Club home page Giter Club logo

Comments (8)

alexandresalome avatar alexandresalome commented on July 30, 2024

Looks like the router is not correctly detecting the I18N route. Changing to annotations won't change anything.

You should look at the Router class of the bundle, add some echo "foo"; die; to understand exactly why he's not matching your route.

Might it be because you're on login route, which is "world_site"/"en", and your route is in another site?

from multisite-bundle.

giovkanata avatar giovkanata commented on July 30, 2024

@alexandresalome Thanks for the reply.
Regarding Might it be because you're on login route, which is "world_site"/"en", and your route is in another site? I already did a test with only admin_control_panel:

alex_multisite:
    default_branding: admin_control_panel
    default_locale:   %locale%
    brandings:
        _defaults:
            active: true
        admin_control_panel:
            en: { host: %domain_admin_control_panel% }

but nothing changes (obviously I've completely disabled all related stuff to the other domains/subdomains).
I'm new on Symfony2 (I'm using 2.5.2 version) but I'll follow your tip, I'll give a look to the Router class of the bundle and and I'll keep you updated.

from multisite-bundle.

giovkanata avatar giovkanata commented on July 30, 2024

@alexandresalome I think that maybe this problem is not related to the Router class of the bundle because looking carefully at the security docs of Symfony2 and wandering on stackoverflow and google I seem to understand that we are not allowed to use routes on check_path (and seems the same thing for the logout path). This feature seems not available out-of-the-box and, if it's true, is incredible for a framework like Symfony2 IMHO... can you confirm this?

Maybe is possible to do it through a Custom Login-Listener with a related Voter (and implement it in the multisite-bundle) but I don't know if is the best approach to follow to try to resolve the problem and I'm not completely sure if it's really possible.
I need someone pointing me on a right direction before wasting too much time for nothing.
Thanks for any help/tips you can give me.

from multisite-bundle.

alexandresalome avatar alexandresalome commented on July 30, 2024

I can't confirm, because it is not true. Symfony can handle route names in check path (since I often use it).

It's probably because the routes generated by multisite-bundle do not have the same name as the original one

Can you try giving a full route name, with the _i18n_ prefix?

from multisite-bundle.

giovkanata avatar giovkanata commented on July 30, 2024

@alexandresalome You are right, with full route name like _i18n__admin_control_panel_en__security_admin_login_check and _i18n__admin_control_panel_en__security_admin_logout all works as expected.
The unique problem with full route name is how can I internazionalize the login_check and logout names?
Is possible to inject a parameter like this in security.yml? _i18n__admin_control_panel_(_locale)__security_admin_login_check (I hope to be still wrong, but I don't think it is possible).
Or there is another mode to do it?
Thanks again for the help.

from multisite-bundle.

alexandresalome avatar alexandresalome commented on July 30, 2024

I think the only viable solution is to create a listener as you said. You're the first one to hit the problem, but probably not the last. Feel free to contribute to this bundle, so that we handle the problem for the community.

from multisite-bundle.

giovkanata avatar giovkanata commented on July 30, 2024

I'm new on Symfony2 and Github but I'll try to do my best :-)

from multisite-bundle.

alexandresalome avatar alexandresalome commented on July 30, 2024

Well, I made some investigations and automated tests.

Looks like the only thing you need to do is avoiding multisite features for login-check and logout routes.

I added automated tests, and it keeps the branding/locale in context.

I added a notice in README file. Feel free to test it.

from multisite-bundle.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.