[Tickets #4609] Down
bugs@bugs.horde.org
bugs at bugs.horde.org
Wed Nov 1 14:52:13 PST 2006
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/?id=4609
-----------------------------------------------------------------------
Ticket | 4609
Created By | jkau at jasper.k12.ga.us
Summary | Down
Queue | IMP
Version | 4.1.3
Type | Bug
State | Unconfirmed
Priority | 1. Low
Owners |
-----------------------------------------------------------------------
jkau at jasper.k12.ga.us (2006-11-01 14:52) wrote:
In link attachment downloaded notifications emails, the "Attachment Date:"
is set to GMT-10 instead of GMT-5 on our system in the EST timezone.
Using a real example, when the receipient of the link attachment
downloaded the attachment, the sender received the link attachment
download notification email with:
Attachment date: Wed, 1 Nov 2006 03:37:12 -0500
when the correct time the attachment was uploaded was actually:
Wed, 1 Nov 2006 08:37:12 -0500.
The problem appears to be caused by the use of gmmktime in
horde/imp/lib/Compose.php. It uses:
$ts = gmmktime();
$fullpath = sprintf('%s/%s/%d', IMP_VFS_LINK_ATTACH_PATH, $auth, $ts);
So this generates a URL in email sent to the receipient like so:
https://server/attachment.php?u=<email>&t=<gmmktime()>&f=<attachment>
horde/imp/attachment.php then uses the value of t=<gmmktime()> as the
date:
time_stamp = Util::getFormData('t');
[snip]
$msg->setContents(String::wrap(sprintf(_("Your linked attachment has been
downloaded by at least one user.\n\nAttachment name: %s\nAtt
achment date: %s\n\nClick on the following link to permanently delete the
attachment:\n%s"), $file_name, date('r', $time_stamp), Util::addParamete
r(Horde::selfUrl(true, false, true), 'd', $id))));
On my system, gmmktime() returns seconds since epoch + 5 hours and time()
returns second since epoch. So I used this patch:
[root at puma imp]# diff attachment.php attachment.php.orig
47,49d46
< // generate timestamp that shows correct timezone for notification
email
< $time_stamp_display = $time_stamp - intval(date('Z', $time_stamp));
<
113c110
< $msg->setContents(String::wrap(sprintf(_("Your linked
attachment has been downloaded by at least one user.\n\nAttachment name:
%s\nAttachment date: %s\n\nClick on the following link to permanently
delete the attachment:\n%s"), $file_name, date('r', $time_stamp_display),
Util::addParameter(Horde::selfUrl(true, false, true), 'd', $id))));
---
> $msg->setContents(String::wrap(sprintf(_("Your linked
attachment has been downloaded by at least one user.\n\nAttachment name:
%s\nAttachment date: %s\n\nClick on the following link to permanently
delete the attachment:\n%s"), $file_name, date('r', $time_stamp),
Util::addParameter(Horde::selfUrl(true, false, true), 'd', $id))));
I'm using Horde 3.1.4, IMP 4.1.3 on RHEL 4 AS U4. This has PHP version
4.3.9.
More information about the bugs
mailing list