Bug 171 - [Chameleon Core] enhancement: popup manager when session expires
: [Chameleon Core] enhancement: popup manager when session expires
Status: NEW
: Chameleon
Widget
: 1.99
: PC Windows 2000
: P5 enhancement
: FUTURE
Assigned To:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2003-12-24 04:25 by
Modified: 2005-12-13 10:49 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2003-12-24 04:25:21
Bart,
 
this is not something that is very easy to handle which is why we have avoided 
it.
 
One suggestion ... in your application template, you could write a custom piece 
of javascript that starts a timer for, say, 29 minutes and closes open popups 
if it expires.  The only problem then is that there is no central place where 
popups window handles are registered.  There may be some hooks in javascript to 
determine the handles of windows opened via window.open ... you may also be 
able to close them by window name (in the window.open call, a window is 
assigned a unique name) and then search the source of your page 
for all the window names (by looking for window.open calls)
 
Cheers,
 
Paul
 
PS  this would be a nice addition to chameleon at some point, to have all open 
windows go through a popup manager that keeps all the window handles and 
manages the callback mechanism, and also handles session expiry automagically.  
It won't be in the next version though.
 
bartvde@xs4all.nl wrote:
 
Hi list,
 we have noticed some strange behaviour (lots of error messages) in
Chameleon when a session has expired and popup windows are still open.
 Is there a way to close all popups when a session expires to prevent this
behaviour, or can't anything be done about this and is it the
responsibility of the user?
 Best regards,
Bart
------- Comment #1 From 2004-04-05 14:24:11 -------
This is still an open item, but there is a new widget called KeepSessionAlive
that you can place in your template and it will keep the current PHP session
active while the main application window is open.  It does this by using a
single pixel transparent image generated by a php script and replacing the
contents every n seconds (n is specified in the widget attributes), the script
also opens the session which is sufficient to keep it from expiring.
------- Comment #2 From 2004-04-08 08:39:54 -------
updated version to 1.99
------- Comment #3 From 2004-07-08 10:50:49 -------
Changed target to 2.1.
------- Comment #4 From 2004-08-10 16:04:16 -------
Changed Target Milestone to FUTURE. (Enhancements may be moved from this target 
to specific "versioned" targets after product design review cycles.)
------- Comment #5 From 2004-08-10 20:14:30 -------
Changed Severity to enhancement.
------- Comment #6 From 2005-12-13 10:49:25 -------
Here's some code I wrote to close all popups when the main application window
closes or refreshes. Maybe it can be used here as well.

It works for IE and W3 DOM compliant browsers, but not for Opera, so some work
may be needed.
Also, this closes popups after *any* refresh, for instance when zooming in. This
may or may not be desirable.

Replacement JavaScript code for CWCPopup->DrawPublish():

var wh = window.open('{$url}', '{$name}', '{$options}');
if (!wh)
{
  alert( 'unable to open popup dialog.  Perhaps you have a popup blocker
installed?' );
}
else
{
  if (window.opera) // Opera
    window.opera.addEventListener("BeforeEvent.unload", function(){wh.close()},
false);
  else if (window.addEventListener) // W3 DOM
    window.addEventListener("unload", function(){wh.close()}, false);
  else if (window.attachEvent) // IE
    window.attachEvent("onunload", function(){wh.close()});
  wh.focus();
}