[Tickets #11518] Re: Login Tasks

noreply at bugs.horde.org noreply at bugs.horde.org
Tue Apr 9 13:19:43 UTC 2013


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/11518
------------------------------------------------------------------------------
  Ticket             | 11518
  Updated By         | aarno.sandvik at helsinki.fi
  Summary            | Login Tasks
  Queue              | IMP
  Version            | Git master
  Type               | Bug
  State              | Not A Bug
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             | Michael Slusarz
------------------------------------------------------------------------------


aarno.sandvik at helsinki.fi (2013-04-09 13:19) wrote:

I'd like this to be re-examined. I've just received feedback from a  
user that has both DeleteSentmailMonthly and RenameSentmailMonthly set  
active. It appears that the RenameSentMailMonthly is never called if  
both are active.

Horde does ask the user permission for both logintasks, but only  
DeleteSentmailMonthly is called. I've debugged this further in  
LoginTasks.php. The problem is in the runTasks-function and the way it  
handles user confirmation.

Logintasks are executed only if one of the following is true:

if (($val instanceof Horde_LoginTasks_SystemTask) ||
        in_array($val->display, array(self::DISPLAY_AGREE,  
self::DISPLAY_NOTICE, self::DISPLAY_NONE)) ||
        in_array($key, $opts['confirmed']))

First two aren't but the third one should be because the user has  
confirmed the tasks. I've debugged $key and $opts['confirmed'] and  
they contain the following if both tasks are active:

$key:
2013-04-09T13:02:22+00:00 DEBUG: Variable information:
int(0)
2013-04-09T13:02:19+00:00 DEBUG: Variable information:
int(1)

$opts['confirmed']:
2013-04-09T13:02:22+00:00 DEBUG: Variable information:
array(2) {
   [0]=>
   string(20) "logintasks_confirm_0"
   [1]=>
   string(20) "logintasks_confirm_1"
}

The non-strict checking with in_array(0, "logintasks_confirm_X") will  
always evaluate to true because of this:  
https://bugs.php.net/bug.php?id=14343&edit=1
In other hand all the other tasks won't be executed because every  
non-zero check with in_array will evaluate to false.

The comparison between int and string seems to result in strange behaviour.







More information about the bugs mailing list