[dev] [commits] Horde branch Horde_LoginTasks-Refactor created. b70b84343d05538bad914a0738ae25e63ab31806
Michael M Slusarz
slusarz at horde.org
Fri Mar 5 06:10:32 UTC 2010
Quoting Gunnar Wrobel <p at rdus.de>:
>> For example, if you have the following tasks:
>>
>> DISPLAY_CONFIRM_NO
>> DISPLAY_CONFIRM_YES
>> DISPLAY_NONE
>> DISPLAY_NOTICE
>> DISPLAY_CONFIRM_YES
>> DISPLAY_NONE
>>
>> There should be 3 confirmation screens generated: 1 with CONFIRM_NO
>> and CONFIRM_YES tasks,
>
> As CONFIRM_NO != CONFIRM_YES the check "$v['task']->display !=
> $display" in needDisplay() should disallow displaying both on the
> same screen or do I misunderstand that section?
I think the code is correct. When adding the task with addTask(),
CONFIRM_NO will have 'display' set to true and $_addFlag will be
false. CONFIRM _YES will also have 'display set to true since it is
not DISPLAY_NONE and $_addFlag is not set. Therefore, when you run
needDisplay(), both tasks will skip the break statement (in our
example, CONFIRM_NO will skip because 'displa'y is true and $display
is null; CONFIRM_YES will skip because 'display' is true and
$v['task']->display == $display).
> I'm done with the core part of the refactoring. Having the abstract
> Horde_LoginTasks_Backend class should be sufficient for me to plug
> the system into something other than Horde. Can you give me some
> feedback if you think the modifications are okay and if I can merge?
I will take a look. It would be best to move all Horde-specific
backend stuff to Core - like I did with the Notification driver. That
would remove all horde core-specific code from LoginTasks.
> Two additional items...
>
> One question concerning ONCE tasks: Why is the _once value set when
> the task is being added to the tasklist? Shouldn't it be set once
> the task was actually executed? I didn't test this but I assume the
> user could login, visit the confirmation page, kill his session,
> login again and thus avoid execution of the task.
That's fine. To me this is an implicit decision by the user that they
didn't want the task to be run.
> The Horde_Util::getFormData() in runTasks() is still inconvenient as
> it accesses $_POST directly so I guess I will add a workaround there
> later.
You could use Horde_Variables instead (from the Util package). The
Util package is already marked as a dependency of LoginTasks.
michael
--
___________________________________
Michael Slusarz [slusarz at horde.org]
More information about the dev
mailing list