Remove the _addFlag.
I still don't grasp its logic and it prevents the display sequence I
currently expect. Probably my expectations are wrong. Anyhow, I
wrapped my idea of how the display series should look like into a
lengthy test (that would need to be slimmed down at some point):
Assume you have a list of tasks with
DISPLAY_CONFIRM_NO
DISPLAY_CONFIRM_YES
DISPLAY_NONE
DISPLAY_NOTICE
DISPLAY_CONFIRM_YES
DISPLAY_NONE
DISPLAY_CONFIRM_YES
DISPLAY_NOTICE
then there would be five screens with
- 1 with CONFIRM_NO and CONFIRM_YES tasks
- 1 with NOTICE task
- 1 with CONFIRM_YES task
- 1 with CONFIRM_YES task
- 1 with NOTICE task
Once the user posted to the login service page he is redirected to the
login service page again in case the tasks are not finished. Only in
case all tasks are completed he is beind redirected to the final
redirect URL provided on the first call of runTasks().