Skip to main content
Topic: Flow interruptions in subs (Read 1970 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Flow interruptions in subs

The same as controllers should be "query-free", subs should not have any interruption of the "flow".
What do I mean? Things like isAllowedTo, fatal_lang_error, etc. that "hard-stop" the code and force php to present another page to the user.

At the moment the situation in ElkArte 1.0 is the following:
isAllowedTo 25
fatal_lang_error and fatal_error 92
redirectexit 5
obExit 13
die 2
exit 10
Bugs creator.
Features destroyer.
Template killer.

Re: Flow interruptions in subs

Reply #1

Good points :D ... the security checks etc should be back in the controllers.   Looks like some more fun in 1.1 !

Re: Flow interruptions in subs

Reply #2

Not sure of when and where but there may be a time when you want to do some kind of security check outside of the controller. In which case, you need to inject the user and the security stuff. When you do that, you should be returning an exception so that it can be caught.

Re: Flow interruptions in subs

Reply #3

Some good news:

isAllowedTo 7
fatal_lang_error 75
fatal_error 3
redirectexit 2
obExit 11
die 2 (Graphics.subs.php for reference)
* exit 10

Going off of the current development branch

Re: Flow interruptions in subs

Reply #4

Where did all that stuff go? LOL
I don't remember so many changes! xD
Bugs creator.
Features destroyer.
Template killer.