Commit Graph

26 Commits

Author SHA1 Message Date
Andreas Gohr d4f83172d9 code style: line breaks 2023-08-31 22:44:40 +02:00
Andreas Gohr 177d6836e2 coding style: control flow whitespaces 2023-08-31 14:22:35 +02:00
Andreas Gohr d868eb89f1 codestyle adjustments: function declaration braces/spaces 2023-08-30 17:09:14 +02:00
Andreas Gohr 8c7c53b032 codestyle adjustments: class declaration braces 2023-08-30 17:05:28 +02:00
Andreas Gohr 74981a4e68 apply PSR-12 constant visibility rule
PSR-12 says constants need their visibility declared from PHP 7.1
onwards
2023-08-30 13:02:49 +02:00
Andreas Gohr 24870174d2 Apply rector fixes to the rest of inc 2023-08-29 19:42:15 +02:00
Andreas Gohr ecad51dd49 fix handling of loading auth backend
When a non existing auth backend was configured, the action router ran
into an infinie loop exception. The reason was that the denied action
required a configured auth system, but denying access should always
work.

Interestingly the problem did not occur when the auth backend signalled
a failure to load. This was because the auth backend was not properly
deinitialized. This is now done.

To aid debugging similar problems, fatal errors are now logged through
the logging mechanism in the action router
2021-12-17 22:32:51 +01:00
Damien Regad 985f440f62 Fix typo in error message 2020-06-07 11:45:15 +02:00
Andreas Gohr e1d9dcc8b4 First go at moving the plugin classes into their own namespace 2019-04-20 21:33:23 +02:00
Andreas Gohr b2c9cd19ff renamed ActionRouter::checkPermissions to checkPreconditions
As discussed in #1933
2018-04-12 15:36:43 +02:00
Andreas Gohr c7d61a4e93 pass action name by reference. fixes #2117
This fixes plugins that expect that they can change the global $ACT
instead of $event->data in the ACTION_ACT_PREPROCESS event.

This make the whole route a little bit uncleaner but would increase
backwards compatibility.

I'm not sure how widespread the problem is and if adding this is a good
idea.
2017-09-07 15:54:21 +02:00
Michael Große 68667f4a8a
fix(ActionRouter): trigger ACTION_ACT_PREPROCESS for all actions
This should recreate the behaviour prior to #1933, where the event was
triggered for all ACT values. Some plugins, like edittable, depend on
the functionality.
2017-09-06 12:47:17 +02:00
Andreas Gohr 7675e7072c do not hide fatal exceptions during unit tests 2017-08-27 22:14:05 +02:00
Andreas Gohr 6e4577dcdb undo unecessary action routing adjustments 2017-08-27 22:10:01 +02:00
LarsDW223 572dc222f8 Test code for workflow 'show - sectionedit - save/cancel' (with modifications in test classes and 'send_redirect()' and 'act_dispatch()'. 2017-08-27 15:42:12 +02:00
Andreas Gohr d5d08c05f8 fixed some style errors found by scrutinizer 2017-08-27 09:40:53 +02:00
Andreas Gohr 58528803ad introduce a redirect action
Action can now abort to 'redirect' to explicitly trigger a redirect
back to showing the current page. Automatic triggering for post->show is
now only done when a 'show' action was not explicitly requested.
2017-05-18 12:58:50 +02:00
Andreas Gohr 81f9e22b2e allow actions to throw exception that are shown to the user 2017-05-18 11:41:25 +02:00
Andreas Gohr 16d428e9e0 removed unneeded check
the $from != $to check is handled further up already and throws an
exception.
2017-04-01 08:16:12 +02:00
Andreas Gohr 480336a332 no longer rely on actionOk when checking if actions are disabled
loadAction() and checkAction() are now public and could be used within
actionOK(). However some weird circular references prevent that. In
addition, actionOK is also used to check for things that aren't Actions
(yet) like 'rss' and 'top'.
2017-03-31 17:49:15 +02:00
Andreas Gohr 73522543bc fixed export action by supporting underscores in actions
Now underscores can be used to have sub actions. The loader will try to
find an exact match first, then begin removing parts from the end until
a matching action is found.
2017-03-31 11:56:35 +02:00
Andreas Gohr ae7bcdc71a fix singleton pattern in ActionRouter 2017-03-31 11:56:35 +02:00
Andreas Gohr 50701b661a better action transitions
It should now catch any circular loops (by having a maxiumum recursion
depth) and it handles the automatic redirect after save (and others)
2017-03-31 11:56:35 +02:00
Andreas Gohr a3f6fae668 Add action plugin hooks back into the ActionRouter
This is not how integration of plugins would ideally be done in this new
system. Ideally an action plugin would actually implement an instance of
AbstractAction and would just fall into the normal flow of actions here.

However to not break a gazillion of existing plugins, this is just add
the existing two events into the new system through the use of a Plugin
action.

Maybe we could add "new" action plugins later.
2017-03-31 11:56:35 +02:00
Andreas Gohr f21dad3906 all actions should have a class now
Lots of FIXMEs and the routing isn't integrated, yet
2017-03-31 11:56:34 +02:00
Andreas Gohr 64ab5140f7 start of a refactoring the action routing
This is neither complete nor working, yet
2017-03-31 11:56:34 +02:00