# |
Feb 11th 2020, 14:05 |
admad |
@spriz Application::bootstrap() :) |
# |
Feb 11th 2020, 14:05 |
challgren |
Sorry @admad my twig knowledge is very limited |
# |
Feb 11th 2020, 14:04 |
spriz |
I want those events to kick in no matter from where they are fired after all - it being cli workers/http requests - controllers or models |
# |
Feb 11th 2020, 14:03 |
spriz |
Like where would I put those 3 first lines in this example for best practises? https://book.cakephp.org/3/en/core-libraries/events.html#interacting-with-existing-listeners |
# |
Feb 11th 2020, 14:03 |
spriz |
Hey peeps! Where do you generally put all your `$foo->getEventManager->on('Claim.claimActionAdded', new EventListener())` code? In `bootstrap.php` ? |
# |
Feb 11th 2020, 14:00 |
sebastian.krzewinski. |
it should be? |
# |
Feb 11th 2020, 13:59 |
sebastian.krzewinski. |
but view/ edit from related articles (in tags) dont work |
# |
Feb 11th 2020, 13:58 |
sebastian.krzewinski. |
i do everything in tut |
# |
Feb 11th 2020, 13:58 |
sebastian.krzewinski. |
can someone help me with (CMS Tutorial - Tags and Users)? |
# |
Feb 11th 2020, 13:52 |
challgren |
Ok, I’ll have to hack it together. Coming from 8.5 I was expecting it to be less painful |
# |
Feb 11th 2020, 13:52 |
rochasmarcelo |
@challgren does it make sense? |
# |
Feb 11th 2020, 13:52 |
rochasmarcelo |
So a new handler to behave like this could also help |
# |
Feb 11th 2020, 13:51 |
rochasmarcelo |
in Authorization plugin the user does not goes back to the page they came from as it happen in AuthComponent |
# |
Feb 11th 2020, 13:50 |
rochasmarcelo |
I found this on AuthComponent doc page ``` If all checks fail, the user will be redirected to the page they came from. Additionally, you can halt all authorization by throwing an exception. You will need to catch any thrown exceptions and handle them.``` |
# |
Feb 11th 2020, 13:49 |
rochasmarcelo |
Extending https://github.com/cakephp/authorization/blob/master/src/Middleware/UnauthorizedHandler/CakeRedirectHandler.php |
# |
Feb 11th 2020, 13:49 |
rochasmarcelo |
I see two options here, first always redirects to one public action like '/' and second create a new unauthorized handler to redirect non logged user to /login and logged user to '/my-protected-action' |
# |
Feb 11th 2020, 13:34 |
challgren |
Is this valid twig? `{% for alias, details in associations.BelongsTo if field == details.foreignKey %}` |
# |
Feb 11th 2020, 13:20 |
challgren |
Ok so with 8.5 if I wasnt allowed to access that location, it would flash `You are not authorized to access that location.` But my loginRedirect is the same URL as AuthorizationMiddleware.unauthorizedRedirect URL |
# |
Feb 11th 2020, 13:14 |
challgren |
I made it redirect to login |
# |
Feb 11th 2020, 13:14 |
rochasmarcelo |
I'll need to check this |
# |
Feb 11th 2020, 13:13 |
rochasmarcelo |
if '/' is unprotected it should not redirect to login |
# |
Feb 11th 2020, 13:11 |
challgren |
Yep, my / is unprotected and redirects to login |
# |
Feb 11th 2020, 13:11 |
rochasmarcelo |
not the protected page configured |
# |
Feb 11th 2020, 13:11 |
rochasmarcelo |
Right, cause now the user only can access /login |
# |
Feb 11th 2020, 13:07 |
sebastian.krzewinski. |
:+1: |
# |
Feb 11th 2020, 13:05 |
admad |
read my previous statement again |
# |
Feb 11th 2020, 13:04 |
sebastian.krzewinski. |
then app is useless? and i should use only app local? |
# |
Feb 11th 2020, 13:03 |
admad |
@sebastian.krzewinski. the idea is to have all your common config in app.php and environment specific config app_local.php |
# |
Feb 11th 2020, 13:03 |
sebastian.krzewinski. |
if i dellete/rename app local cake dont work |
# |
Feb 11th 2020, 13:02 |
sebastian.krzewinski. |
i know |
# |
Feb 11th 2020, 13:01 |
challgren |
appl_local overrides it |
# |
Feb 11th 2020, 13:01 |
sebastian.krzewinski. |
and still use app local |
# |
Feb 11th 2020, 13:01 |
sebastian.krzewinski. |
why app.php isnt work if i edit it to my database |
# |
Feb 11th 2020, 12:53 |
challgren |
@rochasmarcelo so that doesnt work when the user isnt logged in |
# |
Feb 11th 2020, 12:52 |
admad |
@sebastian.krzewinski. that's what the tutorial is for, to you show you to use those plugins :) |
# |
Feb 11th 2020, 12:52 |
challgren |
It didnt work for me |
# |
Feb 11th 2020, 12:52 |
sebastian.krzewinski. |
yea but i really dont know how to use this plugins, i will try again |
# |
Feb 11th 2020, 12:52 |
steinkel |
that works too |
# |
Feb 11th 2020, 12:51 |
challgren |
But thats what I did for now |
# |
Feb 11th 2020, 12:51 |
challgren |
@steinkel I thought https://github.com/cakephp/debug_kit/pull/737 fixed it |
# |
Feb 11th 2020, 12:51 |
admad |
the latter shows use of the new auth plugins |