Comments (8)
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.
@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.
@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.
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.
@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.
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.
I'm new on Symfony2 and Github but I'll try to do my best :-)
from multisite-bundle.
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)
- Using Twig_Loader_String and AlexMultisiteBundle, return a prefixed string HOT 2
- Sf 2.8.6 , multisite-bundle 0.1.1 is breaking the debugtoolbar HOT 3
- Symfony 3 Compatibility issue. HOT 1
- Wrong findTemplates declaration in Alex\MultisiteBundle\Twig\MultisiteLoader
- Activate Travis builds HOT 1
- Cannot import resource (Unknown property 'paths' on annotation 'Sensio\Bundle\FrameworkExtraBundle\Configuration\Route'.) HOT 6
- override a template using @Template HOT 4
- Avoid the generated route in the cache HOT 6
- Can't be change current branding or locale HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multisite-bundle.