[horde] Re: [imp] Webmail and timeout

Colin Devine devinec at sas.upenn.edu
Thu Dec 5 14:05:22 PST 2002


We have been experiencing this same problem since our upgrade to
horde-2.1/imp-3.1 in September.  Noticing that the cvs had a solution
(the timeout warning) but not wanting to upgrade to an unstable version
a coworker and I backported the code this morning.  It wasn't too
difficult and only involved adding lines to 3 files.  I have included
the diff files and here is a description of our work:

added the following code to the end of
imp/templates/compose/javascript.inc:
-----------

function timeoutReminder(first_reminder)
{
    if (first_reminder) {
        var msg = '<?php echo addslashes(_("Your session will expire in
5 minutes. Do you want to reload the page to prevent losing your
work?")) ?>';
    } else {
        var msg = '<?php echo addslashes(_("Your session will expire in
1 minute. Do you want to reload the page to prevent losing your work?"))
?>';
    }
    if (window.confirm(msg)) {
        document.compose.actionID.value = '<?php echo REFRESH_COMPOSE
?>';
        uniqSubmit();
    }
}

window.setTimeout('timeoutReminder(true)', (<?php echo $timeout ?> -
300) * 1000);
window.setTimeout('timeoutReminder(false)', (<?php echo $timeout ?> -
60) * 1000);




//-->
</script>

--------------------

Added the following constant to imp/lib/constants.php
/** @const REFRESH_COMPOSE Refresh the compose window. */
define('REFRESH_COMPOSE', 166);

--------------------

Added the following line at line 1088 of imp/compose.php:
$timeout = ini_get('session.gc_maxlifetime');

-------------------


--Colin Devine

Big thanks to Warren Petrofsky for his help.

Paul J wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Dear All,
> 
> I received the following email from a user of our Horde+IMP framework:
> 
> ========================================================================
> 
> Feel free to classify this as a bug or feature request. Basically, I
> have spent 20 minutes writing an email last night. I've sent it off and
> it seemed to have gone OK. When I tried to check my mail, it asked me to
> log on again. Timeout, fair enough. But, it actually didn't send that
> email! Nor did it inform me that there was a timeout, or at least offer
> me a chance to save the text. This should be improved, IMHO.
> 
> ========================================================================
> 
> Any thoughts on this?
> 
> Paul
> - --
> Department of Computing, Imperial College London
> http://myitcv.org.uk/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
> 
> iD8DBQE976Gm0YkfvYj92P4RAnG3AJ9QCoMk7gEWRXUNweo957Ez+a8a2wCdEHcO
> xrD4JVs+yxv6QsPdZTH2n50=
> =ez1h
> -----END PGP SIGNATURE-----
> 
> --
> IMP mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: imp-unsubscribe at lists.horde.org
-------------- next part --------------
1088c1088
< 
---
> $timeout = ini_get('session.gc_maxlifetime');
-------------- next part --------------
65a66
> /** @const REFRESH_COMPOSE Refresh the compose window. */ define('REFRESH_COMPOSE', 166);
-------------- next part --------------
164a165,183
> function timeoutReminder(first_reminder)
> {
>     if (first_reminder) {
>         var msg = '<?php echo addslashes(_("Your session will expire in 5 minutes. Do you want to reload the page to prevent losing your work?")) ?>';
>     } else {
>         var msg = '<?php echo addslashes(_("Your session will expire in 1 minute. Do you want to reload the page to prevent losing your work?")) ?>';
>     }
>     if (window.confirm(msg)) {
>         document.compose.actionID.value = '<?php echo REFRESH_COMPOSE ?>';
>         uniqSubmit();
>     }
> }
> 
> window.setTimeout('timeoutReminder(true)', (<?php echo $timeout ?> - 300) * 1000);
> window.setTimeout('timeoutReminder(false)', (<?php echo $timeout ?> - 60) * 1000);
> 
> 
> 
> 


More information about the horde mailing list