6.0.0-alpha14
7/2/25

[#11518] Login Tasks
Summary Login Tasks
Queue Horde Base
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester laurent.foucher (at) iut-tlse3 (dot) fr
Created 10/14/2012 (4644 days ago)
Due
Updated 04/16/2013 (4460 days ago)
Assigned 04/16/2013 (4460 days ago)
Resolved 04/16/2013 (4460 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
04/16/2013 04:40:33 AM Michael Slusarz Comment #13
State ⇒ Resolved
Reply to this comment
Fixed in Horde 5.0.5.  Will mark as resolved since the reported code 
was broken and would have caused the behavior described here.
04/16/2013 04:37:37 AM Git Commit Comment #12 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_0):

commit aba06060e577b72b2df863bcb4044c546a57b494
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Mon Apr 15 22:34:20 2013 -0600

     Bug #11518: Fix confirmation of login tasks

     Conflicts:
             horde/templates/logintasks/logintasks.html.php
             horde/templates/logintasks/smartmobile.html.php

  horde/services/logintasks.php               |    7 ++++---
  horde/templates/logintasks/logintasks.html  |    4 ++--
  horde/templates/logintasks/smartmobile.html |    4 ++--
  3 files changed, 8 insertions(+), 7 deletions(-)

http://git.horde.org/horde-git/-/commit/aba06060e577b72b2df863bcb4044c546a57b494
04/16/2013 04:37:26 AM Michael Slusarz Version ⇒ Git master
Queue ⇒ Horde Base
State ⇒ Feedback
 
04/16/2013 04:34:42 AM Git Commit Comment #11 Reply to this comment
Changes have been made in Git (master):

commit 4dbbc7a9745aadc6d97dd5d0b0a973d99579d841
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Mon Apr 15 22:34:20 2013 -0600

     Bug #11518: Fix confirmation of login tasks

  horde/services/logintasks.php                   |    7 ++++---
  horde/templates/logintasks/logintasks.html.php  |    4 ++--
  horde/templates/logintasks/smartmobile.html.php |    4 ++--
  3 files changed, 8 insertions(+), 7 deletions(-)

http://git.horde.org/horde-git/-/commit/4dbbc7a9745aadc6d97dd5d0b0a973d99579d841
04/09/2013 01:19:43 PM aarno (dot) sandvik (at) helsinki (dot) fi Comment #10 Reply to this comment
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.


10/17/2012 07:11:09 PM Michael Slusarz State ⇒ Not A Bug
 
10/17/2012 08:20:46 AM laurent (dot) foucher (at) iut-tlse3 (dot) fr Comment #9 Reply to this comment
I can reproduce this, but this is the expected behavior.

You've cleared out all the user's preferences before trying this 
out, correct?

Unless you can debug this yourself, this ticket will be closed as 
this behavior is not reproducible.
Thanks for your answer. Close the ticket. I will search what's wrong 
in my configuration.
10/17/2012 06:54:24 AM Michael Slusarz Comment #8
Priority ⇒ 1. Low
Reply to this comment

[Show Quoted Text - 61 lines]
Can't reproduce. If both are non-zero, they will both be active and 
appear on the same confirmation page.

[Show Quoted Text - 17 lines]
I can reproduce this, but this is the expected behavior.

You've cleared out all the user's preferences before trying this out, correct?

Unless you can debug this yourself, this ticket will be closed as this 
behavior is not reproducible.
10/15/2012 08:47:05 PM Git Commit Comment #7 Reply to this comment
Changes have been made in Git (develop):

commit 590f8d984fa60424dc8be2d50fb0c02eee2d162c
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Sun Oct 14 20:14:51 2012 -0600

     Bug #11518: Fix display mailbox list

  imp/lib/LoginTasks/Task/PurgeSentmail.php |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

http://git.horde.org/horde-git/-/commit/590f8d984fa60424dc8be2d50fb0c02eee2d162c
10/15/2012 09:48:08 AM laurent (dot) foucher (at) iut-tlse3 (dot) fr Comment #6 Reply to this comment
I guess I am still not understanding the issue.  I can verify that 
both the rename sentmail monthly and the delete sentmail monthly 
tasks are working correctly.

You will have to debug further to explain what is not working 
correctly on your system, or else you should take your questions to 
the mailing list.
Here the debug i try. I put some traces in /usr/share/php/Horde/LoginTasks.php

public function runTasks(array $opts = arraimp/lib/LoginTasks/Task/y())
     {

         Horde::logMessage('==== ENTRY IN RUN TASK =====', 'WARNING');
        .....
          /* Perform ready tasks now. */
         foreach ($this->_tasklist->ready(!$this->_tasklist->processed 
|| $opts['user_confirmed']) as $key => $val) {
             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'])) {
                 Horde::logMessage('RUN TASK : '.get_class($val), 'WARNING');
                 $val->execute();
             }
         }

In imp/lib/LoginTasks/Task/DeleteSentmailMonthly.php
    public function execute()
     {
         Horde::logMessage('DELETE_SENT_MONTHLY EXECUTE', 'WARNING');

and imp/lib/LoginTasks/Task/RenameSentmailMonthly.php
public function execute()
     {
         Horde::logMessage('RENAMESENTMAILMONTHLY EXECUTE', 'WARNING');

TEST1
---------

rename_sentmail_monthly is set to on and delete_sentmail_monthly_keep 
is different from 0. Perform tasks are well displayed on screen. Here 
the log :

HORDE: [imp] ==== ENTRY IN RUN TASK ===== [pid 26221 on line 192 of 
"/usr/share/php/Horde/LoginTasks.php"]
HORDE: [imp] RUN TASK : IMP_LoginTasks_Task_DeleteSentmailMonthly [pid 
26221 on line 216 of "/usr/share/php/Horde/LoginTasks.php"]
HORDE: [imp] DELETE_SENT_MONTHLY EXECUTE [pid 26221 on line 35 of 
"/var/www/horde4/imp/lib/LoginTasks/Task/DeleteSentmailMonthly.php"]
HORDE: [imp] ==== ENTRY IN RUN TASK ===== [pid 26221 on line 192 of 
"/usr/share/php/Horde/LoginTasks.php"]
HORDE: [imp] ==== ENTRY IN RUN TASK ===== [pid 26221 on line 192 of 
"/usr/share/php/Horde/LoginTasks.php"]
HORDE: [imp] ==== ENTRY IN RUN TASK ===== [pid 26213 on line 192 of 
"/usr/share/php/Horde/LoginTasks.php"]

I don't understand why RenameSentmailMonthly.php is not called after 
DeleteSentmailMonthly.php

TEST2
---------
rename_sentmail_monthly is set to on and delete_sentmail_monthly_keep 
is set to zero. Here the log :

HORDE: [imp] ==== ENTRY IN RUN TASK ===== [pid 26257 on line 192 of 
"/usr/share/php/Horde/LoginTasks.php"]
HORDE: [imp] RUN TASK : IMP_LoginTasks_Task_RenameSentmailMonthly [pid 
26257 on line 216 of "/usr/share/php/Horde/LoginTasks.php"]
HORDE: [imp] RENAMESENTMAILMONTHLY EXECUTE [pid 26257 on line 46 of 
"/var/www/horde4/imp/lib/LoginTasks/Task/RenameSentmailMonthly.php"]
HORDE [imp] ==== ENTRY IN RUN TASK ===== [pid 26257 on line 192 of 
"/usr/share/php/Horde/LoginTasks.php"]
HORDE: [imp] ==== ENTRY IN RUN TASK ===== [pid 26257 on line 192 of 
"/usr/share/php/Horde/LoginTasks.php"]
HORDE: [imp] ==== ENTRY IN RUN TASK ===== [pid 26146 on line 192 of 
"/usr/share/php/Horde/LoginTasks.php"]

Now, folders are well created.

Thanks.

10/15/2012 07:56:17 AM Michael Slusarz Comment #5 Reply to this comment
  In fact, i would like to delete the old renamed sent-mail folders 
and put the old sent-mail messages in a new created folder 
sent-mail-yy-mm-dd. Thanks.
I guess I am still not understanding the issue.  I can verify that 
both the rename sentmail monthly and the delete sentmail monthly tasks 
are working correctly.

You will have to debug further to explain what is not working 
correctly on your system, or else you should take your questions to 
the mailing list.
10/15/2012 07:24:01 AM laurent (dot) foucher (at) iut-tlse3 (dot) fr Comment #4 Reply to this comment

[Show Quoted Text - 11 lines]
Sorry, not sure to understand. The test i had made is about the tasks 
DeleteSentmailMonthly.php and RenameSentmailMonthly.php. In this test, 
i had disabled PurgeSentmail.php. In fact, i would like to delete the 
old renamed sent-mail folders and put the old sent-mail messages in a 
new created folder sent-mail-yy-mm-dd. Thanks.
10/15/2012 02:39:16 AM Michael Slusarz Comment #3
State ⇒ Feedback
Assigned to Michael Slusarz
Reply to this comment
When the preference delete_sentmail_monthly_keep is different from 
zero and rename_sentmail_monthly is active, the task 
RenameSentmailMonthly is never called and then the folders are never 
renamed.
And this is the correct behavior.  If the purge task deletes sent-mail 
messages older than a month, there may very well be no messages left 
to move to an older month sentmail maiilbox (we don't "rename" the 
sentmail mailbox; we move messages sent in a previous month to a 
separate mailbox).

If you don't want this behavior, you should disable the purge task.
$mbox_list[] = $val->display_html;
Fixed.
10/15/2012 02:36:48 AM Git Commit Comment #2 Reply to this comment
Changes have been made in Git (master):

commit 590f8d984fa60424dc8be2d50fb0c02eee2d162c
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Sun Oct 14 20:14:51 2012 -0600

     Bug #11518: Fix display mailbox list

  imp/lib/LoginTasks/Task/PurgeSentmail.php |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

http://git.horde.org/horde-git/-/commit/590f8d984fa60424dc8be2d50fb0c02eee2d162c
10/14/2012 05:09:22 PM laurent (dot) foucher (at) iut-tlse3 (dot) fr Comment #1
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ Login Tasks
Type ⇒ Bug
Queue ⇒ IMP
Reply to this comment
I have a strange behavior related to the tasks DeleteSentmailMonthly 
and RenameSentmailMonthly.

When the preference delete_sentmail_monthly_keep is different from 
zero and rename_sentmail_monthly is active, the task 
RenameSentmailMonthly is never called and then the folders are never 
renamed.

Moreover, not sure but in PurgeSentmail.php Line 84.
$mbox_list = $val->display_html; shouldn't be

$mbox_list[] = $val->display_html;

Thanks.



Saved Queries